Quality control queries

From Black Bibliography Project
Revision as of 15:24, 9 December 2020 by Mc2343 (talk | contribs)
Jump to navigation Jump to search


Missing instance statements

Get a list of Item pages that lack an "instance of" declaration:

# Return all items that are missing an "instance of" statement
prefix wbb: <http://wikiba.se/ontology-beta#> 
prefix wb: <http://wikiba.se/ontology#> 

SELECT ?label ?link
WHERE
{
 ?item rdf:type ?wbitem ;
       rdfs:label ?label .    
 FILTER(?wbitem in (wbb:Item, wb:Item))
 FILTER((LANG(?label)) = "en")
 FILTER NOT EXISTS { ?item 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!


Checking in on the Andrews List editions

# list of editions associated with the Andrews biography that lack a pubilshed by statement, but might have a printed by statement
SELECT ?label ?link ?printer WHERE {
 ?edition wdt:P121 wd:Q1176 ; #wd:Q1176 is the Andrews bibliography
          rdfs:label ?label .
  OPTIONAL {?edition wdt:P32 ?printer }.
  BIND(IRI(CONCAT('http://172.17.10.220/wiki/Item:', REPLACE( str(?edition) , 'http://wikibase.svc/entity/', '' ))) AS ?link )
  FILTER NOT EXISTS { ?edition wdt:P29 ?publisher }.
}

Try it out!