query-cd66468a56342cf134cc52af6d14dbe9
Propertiesprotonym of (P12765)original combination (P1403)subject has role (P2868)of (P642)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?qid ?P12765 WHERE {
?item p:P2868 ?s.
?s ps:P2868 wd:Q10640897;
pq:P642 ?protonymof .
FILTER NOT EXISTS { ?s prov:wasDerivedFrom ?r }
FILTER NOT EXISTS { ?item wdt:P12765 ?protonymof }
?protonymof wdt:P1403 ?item. # only those matched with a reciprocal statement
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en". }
BIND (ENCODE_FOR_URI(REPLACE(STR(?item), ".*Q", "Q")) AS ?qid)
BIND (ENCODE_FOR_URI(REPLACE(STR(?protonymof ), ".*Q", "Q")) AS ?P12765)
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?P12765"):::projected
v1("?item")
v2("?protonymof")
v5("?qid"):::projected
v4("?r")
v3("?s")
c9(["bd:serviceParam"]):::iri
c5(["wd:Q10640897"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:direct/P12765"--> e0v2
e0v1("?item"):::projected
e0v2("?protonymof"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"p:direct/P12765"--> v2
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"prov:wasDerivedFrom"--> e1v2
e1v2("?r"):::projected
e1v1("?s"):::projected
end
f1--EXISTS--> f1e1
f1 --> v3
f1 --> c2
f1 --> v4
v3 --"prov:wasDerivedFrom"--> v4
v1 --"p:P2868"--> v3
v3 --"p:statement/P2868"--> c5
v3 --"p:qualifier/P642"--> v2
v2 --"p:direct/P1403"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind2[/"encode-for-uri(replace(str(?item),'.*Q','Q'))"/]
v1 --o bind2
bind2 --as--o v5
bind3[/"encode-for-uri(replace(str(?protonymof),'.*Q','Q'))"/]
v2 --o bind3
bind3 --as--o v6