Quality control queries: Difference between revisions
Jump to navigation
Jump to search
Line 20: | Line 20: | ||
<pre> | <pre> | ||
# Return all places that lack a Wikidata identifier. | # Return all places that lack a Wikidata identifier. | ||
SELECT ? | SELECT ?label ?link | ||
WHERE | WHERE | ||
{ | { | ||
?item wdt:P8 wd:Q10 ; rdfs:label ? | ?item wdt:P8 wd:Q10 ; rdfs:label ?label . | ||
FILTER NOT EXISTS { ?item wdt: | FILTER NOT EXISTS { ?item wdt:P107 ?id } . | ||
BIND(IRI(CONCAT('http://172.17.10.220/wiki/Item:', REPLACE( str(?item) , 'http://wikibase.svc/entity/', '' ))) AS ?link ) | BIND(IRI(CONCAT('http://172.17.10.220/wiki/Item:', REPLACE( str(?item) , 'http://wikibase.svc/entity/', '' ))) AS ?link ) | ||
} | } | ||
order by ? | order by ?label | ||
</pre> | </pre> | ||
[http://172.17.10.220:8834/embed.html | [http://172.17.10.220:8834/embed.html Try it out!] |
Revision as of 17:50, 8 December 2020
Missing instance statements
Get a list of Item pages that lack an "instance of" declaration:
SELECT ?label ?link WHERE { ?item rdfs:label ?label . FILTER((LANG(?label)) = "en") FILTER NOT EXISTS { ?x wdt:P8 ?type } BIND(IRI(CONCAT('http://172.17.10.220/wiki/Item:', REPLACE( str(?item) , 'http://wikibase.svc/entity/', '' ))) AS ?link ) } order by ?label
Places without a Wikidata identifier (also check if they are really places)
# Return all places that lack a Wikidata identifier. SELECT ?label ?link WHERE { ?item wdt:P8 wd:Q10 ; rdfs:label ?label . FILTER NOT EXISTS { ?item wdt:P107 ?id } . BIND(IRI(CONCAT('http://172.17.10.220/wiki/Item:', REPLACE( str(?item) , 'http://wikibase.svc/entity/', '' ))) AS ?link ) } order by ?label