Skip to content

Commit

Permalink
Update sparql query (#482)
Browse files Browse the repository at this point in the history
- update tsv
- update tests
  • Loading branch information
dr0i committed Sep 25, 2023
1 parent 73d1f1a commit 02f0e42
Show file tree
Hide file tree
Showing 6 changed files with 40,551 additions and 40,298 deletions.
12 changes: 12 additions & 0 deletions conf/getWikidataLookupTableViaSparql.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Items that have an ISIL or DBS ID, add GND ID if existing
curl --header "Accept: text/tab-separated-values" -G 'https://query.wikidata.org/sparql' --data-urlencode query='
SELECT ?item ?itemLabel ?isil ?gndId ?dbsId
WHERE
{
{ ?item wdt:P791 ?isil } # Give back entries that either have an ISIL
UNION # or
{ ?item wdt:P4007 ?dbsId . } # a DBS ID
OPTIONAL { ?item wdt:P227 ?gndId . } # Add GND ID if in Wikidata.
SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en". }
}
' |sed 's#^"##g'|sed 's#"\t<#\t#g'|sed 's#>\t"#\t#g' |sed 's#"@..#\t#g' |sed 's#\t"#\t#g' |sed 's#"\t#\t#g' |sed 's#"\^\^.*##g' |sed 's#\t\t#\t#g' > ./conf/wikidataLookup1.tsv
10 changes: 0 additions & 10 deletions conf/wikidataLookup.sparql

This file was deleted.

Loading

0 comments on commit 02f0e42

Please sign in to comment.