query-dcad8611e24b8b14ec738881a9eb6345
title:Only one birth date referenced only from a Wikimedia project SELECT ?item (COUNT(DISTINCT ?st) AS ?nst) WHERE { hint:Query hint:optimizer "None" . ?item wdt:P1986 ?dbi; p:P569 ?st . ?st prov:wasDerivedFrom ?ref . ?ref pr:P143 [] . FILTER NOT EXISTS { ?st prov:wasDerivedFrom ?other . FILTER( ?other != ?ref ) } } GROUP BY ?item HAVING(?nst = 1)
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
#title:Only one birth date referenced only from a Wikimedia project
SELECT ?item (COUNT(DISTINCT ?st) AS ?nst)
WHERE
{
?item wdt:P1986 ?dbi; p:P569 ?st . ?st prov:wasDerivedFrom ?ref . ?ref pr:P143 [] .
FILTER NOT EXISTS { ?st prov:wasDerivedFrom ?other . FILTER( ?other != ?ref ) }
}
GROUP BY ?item
HAVING(?nst = 1)
Query found at
- https://www.wikidata.org/wiki/User:Ep%C3%ACdosis/Queries
- https://www.wikidata.org/wiki/User:Ep%C3%ACdosis/sandbox
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?dbi")
v5("?item"):::projected
v7("?nst")
v2("?other")
v3("?ref")
v4("?st"):::projected
a1((" "))
f0[["?nst = '1^^xsd:integer'"]]
f0 --> v7
f1[["not "]]
subgraph f1e0["Exists Clause"]
e0f0[["?other != ?ref"]]
e0f0 --> e0v1
e0f0 --> e0v2
e0v3 --"prov:wasDerivedFrom"--> e0v1
e0v1("?other"):::projected
e0v2("?ref"):::projected
e0v3("?st"):::projected
end
f1--EXISTS--> f1e0
f1 --> v2
f1 --> v3
f1 --> v4
f1 --> c2
f2[["?other != ?ref"]]
f2 --> v2
f2 --> v3
v4 --"prov:wasDerivedFrom"--> v2
v5 --"p:direct/P1986"--> v6
v5 --"p:P569"--> v4
v4 --"prov:wasDerivedFrom"--> v3
v3 --"p:reference/P143"--> a1
bind4[/"count(?st)"/]
v4 --o bind4
bind4 --as--o v7