query-4f6e0c32279eca93b215ee03f90a083f
TODO
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 schema: <http://schema.org/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?sitelink ?duplicate_of ?duplicate_ofLabel ?d_sitelink ?typeLabel
WHERE
{
?article schema:about ?item ;
schema:isPartOf <https://ta.wikipedia.org/> ;
schema:name ?sitelink .
?item p:P31 ?stat .
?stat ps:P31 wd:Q17362920 .
OPTIONAL {?stat pq:P642 ?duplicate_of .
OPTIONAL { ?d_article schema:about ?duplicate_of ;
schema:isPartOf <https://ta.wikipedia.org/> ;
schema:name ?d_sitelink .}
OPTIONAL { ?duplicate_of wdt:P31 ?type . }
}
filter exists {?type wdt:P279* wd:Q16521 .}
SERVICE wikibase:label { bd:serviceParam wikibase:language 'ta' }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?article")
v7("?d_article")
v8("?d_sitelink"):::projected
v6("?duplicate_of"):::projected
v3("?item"):::projected
v4("?sitelink"):::projected
v5("?stat")
v1("?type")
c5([https://ta.wikipedia.org/]):::iri
c15(["ta"]):::literal
c13(["bd:serviceParam"]):::iri
c2(["wd:Q16521"]):::iri
c9(["wd:Q17362920"]):::iri
f0[[" "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:direct/P279"--> e0c2
e0v1("?type"):::projected
e0c2(["wd:Q16521"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> c2
v1 --"p:direct/P279"--> c2
v2 --"schema:about"--> v3
v2 --"schema:isPartOf"--> c5
v2 --"schema:name"--> v4
v3 --"p:P31"--> v5
v5 --"p:statement/P31"--> c9
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."p:qualifier/P642".-> v6
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v7 -."schema:about".-> v6
v7 --"schema:isPartOf"--> c5
v7 --"schema:name"--> v8
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v6 -."p:direct/P31".-> v1
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end