Quality control queries: Difference between revisions

From Black Bibliography Project
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 ?itemLabel ?link  
SELECT ?label ?link
WHERE
WHERE
{
{
  ?item wdt:P8 wd:Q10 ; rdfs:label ?itemLabel
  ?item wdt:P8 wd:Q10 ; rdfs:label ?label .
  FILTER NOT EXISTS { ?item wdt:p107 ?id }
  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 ?itemLabel
order by ?label
</pre>
</pre>
[http://172.17.10.220:8834/embed.html#%23%20Return%20all%20places%20that%20lack%20a%20Wikidata%20identifier.%20%0ASELECT%20%3FitemLabel%20%3Flink%20%0AWHERE%0A%7B%0A%20%3Fitem%20wdt%3AP8%20wd%3AQ10%20%3B%20rdfs%3Alabel%20%3FitemLabel%0A%20FILTER%20NOT%20EXISTS%20%7B%20%3Fitem%20wdt%3Ap107%20%3Fid%20%7D%0A%20BIND%28IRI%28CONCAT%28%27http%3A%2F%2F10.5.32.142%3A8181%2Fwiki%2FItem%3A%27%2C%20REPLACE%28%20str%28%3Fitem%29%20%2C%20%27http%3A%2F%2Fwikibase.svc%2Fentity%2F%27%2C%20%27%27%20%29%29%29%20AS%20%3Flink%20%29%0A%7D%0Aorder%20by%20%3FitemLabel%0A Try it out!]
[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

Try it out!

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

Try it out!