query-b45a6d2873cbfb52de4bdd8eaf0da018

rq turtle/ttl

title:Items with redundant dates of death referenced only with Open Library, to be removed (note: run on QLever) SELECT ?item ?date (COUNT(DISTINCT ?ref) AS ?nref) WHERE { ?item p:P570 ?st, ?st2 . ?st2 prov:wasDerivedFrom ?ref3 . MINUS { ?ref3 pr:P143 ?wp } . FILTER(?st != ?st2 && YEAR(?date) = YEAR(?date2)) ?st ps:P570 ?date ; prov:wasDerivedFrom ?ref, ?ref2 . ?ref2 pr:P648 ?v . ?st2 ps:P570 ?date2 . } GROUP BY ?item ?date HAVING(?nref = 1)

Use at

PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
#title:Items with redundant dates of death referenced only with Open Library, to be removed (note: run on QLever)
SELECT ?item ?date (COUNT(DISTINCT ?ref) AS ?nref)
WHERE {
  ?item p:P570 ?st, ?st2 . ?st2 prov:wasDerivedFrom ?ref3 . MINUS { ?ref3 pr:P143 ?wp } .
  FILTER(?st != ?st2 && YEAR(?date) = YEAR(?date2))
  ?st ps:P570 ?date ; prov:wasDerivedFrom ?ref, ?ref2 . ?ref2 pr:P648 ?v . ?st2 ps:P570 ?date2 .
}
GROUP BY ?item ?date
HAVING(?nref = 1)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?date"):::projected v5("?date2") v6("?item"):::projected v12("?nref") v9("?ref"):::projected v10("?ref2") v7("?ref3") v2("?st") v3("?st2") v11("?v") v8("?wp") f0[["?nref = '1^^xsd:integer'"]] f0 --> v12 f1[["?st != ?st2year-from-dateTime(?date) = year-from-dateTime(?date2)"]] f1 --> v2 f1 --> v3 f1 --> v4 f1 --> v5 v6 --"p:P570"--> v2 v6 --"p:P570"--> v3 v3 --"prov:wasDerivedFrom"--> v7 subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v7 --"p:reference/P143"--> v8 end v2 --"p:statement/P570"--> v4 v2 --"prov:wasDerivedFrom"--> v9 v2 --"prov:wasDerivedFrom"--> v10 v10 --"p:reference/P648"--> v11 v3 --"p:statement/P570"--> v5 bind4[/"count(?ref)"/] v9 --o bind4 bind4 --as--o v12