query-43333f5c0326c7a09a63f490813a407e
Christian Ferrerc:File:MA I317916 TePapa Diplodontias-robustus full.jpg
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
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 ?file ?item ?itemLabel ?role ?roleLabel ?for ?forLabel
{
{
# Get items for type specimens at Museum of New Zealand Te Papa Tongarewa from WDQS
SELECT ?item ?itemLabel ?role ?roleLabel ?for ?forLabel
WHERE
{
SERVICE <https://query.wikidata.org/sparql>
{
?item wdt:P31 wd:Q51255340 . # Item is a type specimen
?item wdt:P195 wd:Q915603 . # Collection is Museum of New Zealand Te Papa Tongarewa
OPTIONAL
{
?item p:P2868 ?stat .
?stat ps:P2868 ?role .
?stat pq:P642 ?for .
}
SERVICE wikibase:label
{
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
?item rdfs:label ?itemLabel .
?role rdfs:label ?roleLabel .
?for rdfs:label ?forLabel .
}
}
}
} OPTIONAL { ?file wdt:P180 ?item . }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?file"):::projected
v4("?for"):::projected
v7("?forLabel"):::projected
v1("?item"):::projected
v5("?itemLabel"):::projected
v3("?role"):::projected
v6("?roleLabel"):::projected
v2("?stat")
c5(["wd:Q915603"]):::iri
c3(["wd:Q51255340"]):::iri
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph s1["https://query.wikidata.org/sparql"]
style s1 stroke-width:4px;
v1 --"p:direct/P31"--> c3
v1 --"p:direct/P195"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:P2868".-> v2
v2 --"p:statement/P2868"--> v3
v2 --"p:qualifier/P642"--> v4
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c10 --"wikibase:language"--> c12
v1 --"rdfs:label"--> v5
v3 --"rdfs:label"--> v6
v4 --"rdfs:label"--> v7
end
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v8 -."p:direct/P180".-> v1
end