Quality control queries: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| Line 41: | Line 41: | ||
== Checking in on the Andrews List editions == | == Checking in on the Andrews List editions == | ||
<pre> | <pre> | ||
# list of editions associated with the Andrews | # list of editions associated with the Andrews bibliography | ||
SELECT ? | SELECT | ||
?editionLabel | |||
?link | |||
(group_concat(distinct ?publisherLabel;separator='; ') as ?publishers) | |||
(group_concat(distinct ?pubPlaceLabel;separator='; ') as ?publishedPlaces) | |||
(group_concat(distinct ?pubDate;separator='; ') as ?publishedDates) | |||
(group_concat(distinct ?printerLabel;separator='; ') as ?printers) | |||
(group_concat(distinct ?printPlaceLabel;separator='; ') as ?printedPlaces) | |||
(group_concat(distinct ?printDate;separator='; ') as ?printedDates) | |||
WHERE { | |||
?edition wdt:P121 wd:Q1176 ; #wd:Q1176 is the Andrews bibliography | ?edition wdt:P121 wd:Q1176 ; #wd:Q1176 is the Andrews bibliography | ||
rdfs:label ?label . | rdfs:label ?editionLabel . | ||
OPTIONAL {?edition wdt:P32 ?printer }. | |||
OPTIONAL {?edition wdt:P29 ?publisher . ?publisher rdfs:label ?publisherLabel }. | |||
OPTIONAL {?edition ?has ?pubStmt . ?pubStmt ps:P29 ?publisher ; pq:P30 ?pubPlace . ?pubPlace rdfs:label ?pubPlaceLabel }. | |||
OPTIONAL {?edition ?has ?pubStmt . ?pubStmt ps:P29 ?publisher ; pq:P31 ?pubDate }. | |||
OPTIONAL {?edition wdt:P32 ?printer . ?printer rdfs:label ?printerLabel }. | |||
OPTIONAL {?edition ?has ?printStmt . ?printStmt ps:P32 ?printer ; pq:P30 ?printPlace . ?printPlace rdfs:label ?printPlaceLabel }. | |||
OPTIONAL {?edition ?has ?printStmt . ?printStmt ps:P32 ?printer ; pq:P31 ?printDate }. | |||
BIND(IRI(CONCAT('http://172.17.10.220/wiki/Item:', REPLACE( str(?edition) , 'http://wikibase.svc/entity/', '' ))) AS ?link ) | BIND(IRI(CONCAT('http://172.17.10.220/wiki/Item:', REPLACE( str(?edition) , 'http://wikibase.svc/entity/', '' ))) AS ?link ) | ||
} | } | ||
group by ?editionLabel ?link | |||
</pre> | </pre> | ||
[http://172.17.10.220:8834/embed.html#%23%20list%20of%20editions%20associated%20with%20the%20Andrews%20biography%20that%20lack%20a%20pubilshed%20by%20statement%2C%20but%20might%20have%20a%20printed%20by%20statement%0ASELECT%20% | [http://172.17.10.220:8834/embed.html#%23%20list%20of%20editions%20associated%20with%20the%20Andrews%20biography%20that%20lack%20a%20pubilshed%20by%20statement%2C%20but%20might%20have%20a%20printed%20by%20statement%0ASELECT%20%0A%3FeditionLabel%0A%3Flink%20%0A%28group_concat%28distinct%20%3FpublisherLabel%3Bseparator%3D%27%3B%20%27%29%20as%20%3Fpublishers%29%20%0A%28group_concat%28distinct%20%3FpubPlaceLabel%3Bseparator%3D%27%3B%20%27%29%20as%20%3FpublishedPlaces%29%0A%28group_concat%28distinct%20%3FpubDate%3Bseparator%3D%27%3B%20%27%29%20as%20%3FpublishedDates%29%0A%0A%28group_concat%28distinct%20%3FprinterLabel%3Bseparator%3D%27%3B%20%27%29%20as%20%3Fprinters%29%20%0A%28group_concat%28distinct%20%3FprintPlaceLabel%3Bseparator%3D%27%3B%20%27%29%20as%20%3FprintedPlaces%29%0A%28group_concat%28distinct%20%3FprintDate%3Bseparator%3D%27%3B%20%27%29%20as%20%3FprintedDates%29%0A%0AWHERE%20%7B%0A%20%3Fedition%20wdt%3AP121%20wd%3AQ1176%20%3B%20%23wd%3AQ1176%20is%20the%20Andrews%20bibliography%0A%20%20%20%20%20%20%20%20%20%20rdfs%3Alabel%20%3FeditionLabel%20.%0A%20%20%20%0A%20%20OPTIONAL%20%7B%3Fedition%20wdt%3AP29%20%3Fpublisher%20.%20%3Fpublisher%20rdfs%3Alabel%20%3FpublisherLabel%20%7D.%0A%20%20OPTIONAL%20%7B%3Fedition%20%3Fhas%20%3FpubStmt%20.%20%3FpubStmt%20ps%3AP29%20%3Fpublisher%20%3B%20pq%3AP30%20%3FpubPlace%20.%20%3FpubPlace%20rdfs%3Alabel%20%3FpubPlaceLabel%20%7D.%0A%20%20OPTIONAL%20%7B%3Fedition%20%3Fhas%20%3FpubStmt%20.%20%3FpubStmt%20ps%3AP29%20%3Fpublisher%20%3B%20pq%3AP31%20%3FpubDate%20%7D.%0A%20%20%0A%20%20OPTIONAL%20%7B%3Fedition%20wdt%3AP32%20%3Fprinter%20.%20%3Fprinter%20rdfs%3Alabel%20%3FprinterLabel%20%7D.%0A%20%20OPTIONAL%20%7B%3Fedition%20%3Fhas%20%3FprintStmt%20.%20%3FprintStmt%20ps%3AP32%20%3Fprinter%20%3B%20pq%3AP30%20%3FprintPlace%20.%20%3FprintPlace%20rdfs%3Alabel%20%3FprintPlaceLabel%20%7D.%0A%20%20OPTIONAL%20%7B%3Fedition%20%3Fhas%20%3FprintStmt%20.%20%3FprintStmt%20ps%3AP32%20%3Fprinter%20%3B%20pq%3AP31%20%3FprintDate%20%7D.%0A%20%20%0A%20%20%0A%20%20BIND%28IRI%28CONCAT%28%27http%3A%2F%2F10.5.32.142%3A8181%2Fwiki%2FItem%3A%27%2C%20REPLACE%28%20str%28%3Fedition%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%0Agroup%20by%20%3FeditionLabel%20%3Flink Try it out!] | ||
Revision as of 17:50, 9 December 2020
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
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
Checking in on the Andrews List editions
# list of editions associated with the Andrews bibliography
SELECT
?editionLabel
?link
(group_concat(distinct ?publisherLabel;separator='; ') as ?publishers)
(group_concat(distinct ?pubPlaceLabel;separator='; ') as ?publishedPlaces)
(group_concat(distinct ?pubDate;separator='; ') as ?publishedDates)
(group_concat(distinct ?printerLabel;separator='; ') as ?printers)
(group_concat(distinct ?printPlaceLabel;separator='; ') as ?printedPlaces)
(group_concat(distinct ?printDate;separator='; ') as ?printedDates)
WHERE {
?edition wdt:P121 wd:Q1176 ; #wd:Q1176 is the Andrews bibliography
rdfs:label ?editionLabel .
OPTIONAL {?edition wdt:P29 ?publisher . ?publisher rdfs:label ?publisherLabel }.
OPTIONAL {?edition ?has ?pubStmt . ?pubStmt ps:P29 ?publisher ; pq:P30 ?pubPlace . ?pubPlace rdfs:label ?pubPlaceLabel }.
OPTIONAL {?edition ?has ?pubStmt . ?pubStmt ps:P29 ?publisher ; pq:P31 ?pubDate }.
OPTIONAL {?edition wdt:P32 ?printer . ?printer rdfs:label ?printerLabel }.
OPTIONAL {?edition ?has ?printStmt . ?printStmt ps:P32 ?printer ; pq:P30 ?printPlace . ?printPlace rdfs:label ?printPlaceLabel }.
OPTIONAL {?edition ?has ?printStmt . ?printStmt ps:P32 ?printer ; pq:P31 ?printDate }.
BIND(IRI(CONCAT('http://172.17.10.220/wiki/Item:', REPLACE( str(?edition) , 'http://wikibase.svc/entity/', '' ))) AS ?link )
}
group by ?editionLabel ?link