query-f1d1a6c654632e22b633b512672bd044
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 bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?item ?article ?sitelink ?itemLabel ?linkTo WHERE {
{ ?item wdt:P361* wd:Q395 .}
union
{ ?item wdt:P361/wdt:P279* wd:Q395 .}
union
{ ?item wdt:P31/wdt:P279* wd:Q1936384 .}
union
{ ?item wdt:P921/wdt:P279* wd:Q395 .}
?sitelink ^schema:name ?article .
?article schema:about ?item ;
schema:isPartOf <https://en.wikipedia.org/> .
#?article schema:inLanguage "en".
# ?article schema:about ?item.
OPTIONAL { ?item wdt:P361 ?linkTo. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?article"):::projected
v1("?item"):::projected
v4("?linkTo"):::projected
v3("?sitelink"):::projected
a1((" "))
a2((" "))
a3((" "))
c14(["en"]):::literal
c5(["wd:Q1936384"]):::iri
c10([https://en.wikipedia.org/]):::iri
c12(["bd:serviceParam"]):::iri
c2(["wd:Q395"]):::iri
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
subgraph union1[" Union "]
subgraph union1l[" "]
style union1l fill:#abf,stroke-dasharray: 3 3;
subgraph union2[" Union "]
subgraph union2l[" "]
style union2l fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P921"--> a3
a3 --"wdt:P279"--> c2
end
subgraph union2r[" "]
style union2r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c5
end
union2r <== or ==> union2l
end
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P361"--> a1
a1 --"wdt:P279"--> c2
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"wdt:P361"--> c2
end
union0r <== or ==> union0l
end
v2 --"schema:name"--> v3
v2 --"schema:about"--> v1
v2 --"schema:isPartOf"--> c10
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P361".-> v4
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end