Difference between revisions of "Workdocumentation 2022-08-13"
Jump to navigation
Jump to search
(4 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | {{PageSequence|prev=Workdocumentation 2022-08-12|next=Workdocumentation 2022-08-15|category=Workdocumentation}} | ||
= Participants = | = Participants = | ||
* Beyza | * Beyza | ||
Line 64: | Line 65: | ||
* https://github.com/ceurws/lod/issues | * https://github.com/ceurws/lod/issues | ||
* [https://github.com/ceurws/lod/discussions/29 SePublica Example] | * [https://github.com/ceurws/lod/discussions/29 SePublica Example] | ||
+ | * [https://github.com/ceurws/lod/discussions/27 IWSECO Example] | ||
+ | |||
= Tools = | = Tools = | ||
− | == Wikibase Command line Tools (NPM/Javascript | + | == Wikibase Command line Tools (NPM/Javascript == |
* https://github.com/maxlath/wikibase-cli | * https://github.com/maxlath/wikibase-cli | ||
<source lang='bash'> | <source lang='bash'> | ||
wd search "SePublica" | wd search "SePublica" | ||
Q30276418 Proceedings of the 2nd Workshop on Semantic Publishing | Q30276418 Proceedings of the 2nd Workshop on Semantic Publishing | ||
+ | </source> | ||
+ | == Scholar script == | ||
+ | For result see {{Link|target=List of Scholars}} | ||
+ | <source lang='bash'> | ||
+ | #!/bin/bash | ||
+ | # WF 2022-08-08 | ||
+ | # search for a scholar | ||
+ | |||
+ | wikidataProps() { | ||
+ | cat << EOF | ||
+ | item given_name P735 firstName | ||
+ | item family_name P734 name | ||
+ | url official_website P856 homepage | ||
+ | id DBLP_author_ID P2456 dblpId | ||
+ | id ORCID P496 orcid | ||
+ | id LinkedIn personal profile ID P634 linkedInId | ||
+ | id GND_ID P227 gndId | ||
+ | id Google_Scholar_author_ID P1960 googleScholarUser | ||
+ | EOF | ||
+ | } | ||
+ | smwScholar() { | ||
+ | local l_qid="$1" | ||
+ | cat << EOF | ||
+ | {{Scholar | ||
+ | |wikiDataId=$l_qid | ||
+ | EOF | ||
+ | wikidataProps | while read line | ||
+ | do | ||
+ | propType=$(echo $line | cut -f1 -d ' ') | ||
+ | propName=$(echo $line | cut -f2 -d ' ') | ||
+ | propId=$(echo $line | cut -f3 -d ' ') | ||
+ | propVar=$(echo $line | cut -f4 -d ' ') | ||
+ | #echo $propId | ||
+ | propValue=$(wd q --subject $l_qid -p $propId 2>&1) | ||
+ | if [ $? -eq 0 ] | ||
+ | then | ||
+ | case $propType in | ||
+ | 'item') | ||
+ | propValue=$(wd label $propValue) | ||
+ | ;; | ||
+ | esac | ||
+ | echo "|$propVar=$propValue" | ||
+ | fi | ||
+ | done | ||
+ | cat << EOF | ||
+ | }} | ||
+ | EOF | ||
+ | } | ||
+ | name="$*" | ||
+ | wd search "$name" | while read line | ||
+ | do | ||
+ | echo $line | ||
+ | qid=$(echo $line | cut -f1 -d' ') | ||
+ | smwScholar "$qid" | ||
+ | done | ||
</source> | </source> |
Latest revision as of 04:56, 18 August 2022
Participants
- Beyza
- Wolfgang
Agenda
- CEUR-WS
- Tools
CEUR-WS
pyCEURMake
git clone https://github.com/WolfgangFahl/pyCEURmake
Indexparser
- reads index.html to create volume dicts
- VolumeManager then takes dicts to creates Volumes
- VolumeManager.store() stores to Sqlite database
def testReadVolumePages(self):
'''
test reading the volume pages
'''
vm=VolumeManager()
vm.loadFromIndexHtml(force=False)
volumesByNumber, _duplicates = LOD.getLookup(vm.getList(), 'number')
debug=True
limit=len(volumesByNumber)+1
#limit=10
for number in range(1,limit):
volume=volumesByNumber[number]
volume.extractValuesFromVolumePage(debug=False,withPapers=False)
if debug and volume.valid:
print(f"{volume.url}:{volume.acronym}:{volume.desc}:{volume.h1}:{volume.title}")
withStore=False
if withStore:
vm.store()
Database
see https://github.com/coleifer/sqlite-web
sqlite_web ceurws.db
gsimport/pyOnlineSpreadSheetEditing
git clone https://github.com/WolfgangFahl/pyOnlineSpreadSheetEditing
Install Liclipse
- https://www.liclipse.com/
- Use existing Eclipse Installation
- Help/Install new software
- Add "liclipse" http://update.liclipse.com/latest
Python installation
Get a copy of index.html
curl -s http://ceur-ws.org > index.html
Series Examples
Tools
Wikibase Command line Tools (NPM/Javascript
wd search "SePublica"
Q30276418 Proceedings of the 2nd Workshop on Semantic Publishing
Scholar script
For result see List of Scholars
#!/bin/bash
# WF 2022-08-08
# search for a scholar
wikidataProps() {
cat << EOF
item given_name P735 firstName
item family_name P734 name
url official_website P856 homepage
id DBLP_author_ID P2456 dblpId
id ORCID P496 orcid
id LinkedIn personal profile ID P634 linkedInId
id GND_ID P227 gndId
id Google_Scholar_author_ID P1960 googleScholarUser
EOF
}
smwScholar() {
local l_qid="$1"
cat << EOF
{{Scholar
|wikiDataId=$l_qid
EOF
wikidataProps | while read line
do
propType=$(echo $line | cut -f1 -d ' ')
propName=$(echo $line | cut -f2 -d ' ')
propId=$(echo $line | cut -f3 -d ' ')
propVar=$(echo $line | cut -f4 -d ' ')
#echo $propId
propValue=$(wd q --subject $l_qid -p $propId 2>&1)
if [ $? -eq 0 ]
then
case $propType in
'item')
propValue=$(wd label $propValue)
;;
esac
echo "|$propVar=$propValue"
fi
done
cat << EOF
}}
EOF
}
name="$*"
wd search "$name" | while read line
do
echo $line
qid=$(echo $line | cut -f1 -d' ')
smwScholar "$qid"
done