query-edbee97051ea9f619b016fc60a18fbbe
Exploring overall hierachy in one table.(Q234460)text and (Q87167)manuscript , (Q2217259)miscellaneous manuscript To do: make a clever combination (UNION?) of the 3 queries below to obtain one combined overview of QUERY BEWLOW SEEMS TO WORK, BUT NEED TO CHECK IF IT IS ACTUALLY CORRECT!!!
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 bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?codex ?codexLabel ?manuscript ?manuscriptLabel ?text ?textLabel
WHERE
{
{
?codex wdt:P31 wd:Q2217259; wdt:P195 wd:Q1526131 #manuscript codex from KB collection
OPTIONAL{?codex wdt:P527 ?manuscript.} #manuscripts
OPTIONAL{?manuscript wdt:P527 ?text.} #texts
}
UNION
{
?manuscript wdt:P31 wd:Q87167; wdt:P195 wd:Q1526131 #manuscripts from KB collection
OPTIONAL{?manuscript wdt:P527 ?text.} #texts
}
UNION
{
?text wdt:P31 wd:Q234460; wdt:P195 wd:Q1526131
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC (?codexLabel)(?manuscriptLabel)(?textLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?codex"):::projected
v1("?codexLabel"):::projected
v5("?manuscript"):::projected
v2("?manuscriptLabel"):::projected
v6("?text"):::projected
v3("?textLabel"):::projected
c6(["wd:Q87167"]):::iri
c9(["bd:serviceParam"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c4(["wd:Q1526131"]):::iri
c7(["wd:Q234460"]):::iri
c2(["wd:Q2217259"]):::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;
v6 --"wdt:P31"--> c7
v6 --"wdt:P195"--> c4
end
subgraph union1r[" "]
style union1r fill:#abf,stroke-dasharray: 3 3;
v5 --"wdt:P31"--> c6
v5 --"wdt:P195"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P527".-> v6
end
end
union1r <== or ==> union1l
end
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v4 --"wdt:P31"--> c2
v4 --"wdt:P195"--> c4
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P527".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P527".-> v6
end
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end