query-fb46557465b119f5485f872719ec48db
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; wdt:P396 ?sbn; p:P19 ?st . ?st prov:wasDerivedFrom ?ref . ?ref pr:P143 [] . #importato da qualsiasi progetto wiki FILTER NOT EXISTS { ?st prov:wasDerivedFrom ?other . FILTER( ?other != ?ref ) } #dove non esiste altra fonte diversa dalla prima } 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; wdt:P396 ?sbn; p:P19 ?st . ?st prov:wasDerivedFrom ?ref . ?ref pr:P143 [] . #importato da qualsiasi progetto wiki
FILTER NOT EXISTS { ?st prov:wasDerivedFrom ?other . FILTER( ?other != ?ref ) } #dove non esiste altra fonte diversa dalla prima
}
GROUP BY ?item
HAVING(?nst = 1)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?dbi")
v5("?item"):::projected
v8("?nst")
v2("?other")
v3("?ref")
v7("?sbn")
v4("?st"):::projected
a1((" "))
f0[["?nst = '1^^xsd:integer'"]]
f0 --> v8
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:direct/P396"--> v7
v5 --"p:P19"--> v4
v4 --"prov:wasDerivedFrom"--> v3
v3 --"p:reference/P143"--> a1
bind4[/"count(?st)"/]
v4 --o bind4
bind4 --as--o v8