query-b40fcf1e5d16d1daf22552cac4a1f8d5

rq turtle/ttl

Propertiesinstance of (P31)time period (P2348)country (P17)country of origin (P495)collection (P195)made from material (P186)inventory number (P217)

Use at

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 bd: <http://www.bigdata.com/rdf#>
SELECT ?dynastyLabel ?thing ?thingLabel (GROUP_CONCAT(DISTINCT ?typel; separator=", ") AS ?what) (GROUP_CONCAT(DISTINCT ?matl; separator=", ") AS ?materials) ?thingDescription ?collectionLabel ?inventoryNo WHERE {
?dynasty wdt:P31 wd:Q50068795.
VALUES ?prop {wdt:P2348 wdt:P17 wdt:P495}.
?thing ?prop ?dynasty;
       wdt:P31 ?type;
       wdt:P195 ?collection.
 ?type rdfs:label ?typel FILTER(lang(?typel) = "en").
OPTIONAL {?thing wdt:P186 ?material. ?material rdfs:label ?matl FILTER(lang(?matl) = "en") }.
OPTIONAL {?thing wdt:P217 ?inventoryNo }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} GROUP BY ?dynastyLabel ?thing ?thingLabel?thingDescription ?collectionLabel ?inventoryNo
ORDER BY ?dynastyLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?collection") v4("?dynasty") v1("?dynastyLabel"):::projected v10("?inventoryNo"):::projected v9("?material") v12("?materials") v3("?matl"):::projected v5("?prop") v6("?thing"):::projected v7("?type") v2("?typel"):::projected v11("?what") c9(["bd:serviceParam"]):::iri c3(["wd:Q50068795"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?typel = 'en'"]] f0 --> v2 v4 --"wdt:P31"--> c3 bind1[/VALUES ?prop/] bind1-->v5 bind10(["wdt:P2348"]) bind10 --> bind1 bind11(["wdt:P17"]) bind11 --> bind1 bind12(["wdt:P495"]) bind12 --> bind1 v6 -->v5--> v4 v6 --"wdt:P31"--> v7 v6 --"wdt:P195"--> v8 v7 --"rdfs:label"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P186".-> v9 v9 --"rdfs:label"--> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."wdt:P217".-> v10 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind4[/"?typel"/] v2 --o bind4 bind4 --as--o v11 bind5[/"?matl"/] v3 --o bind5 bind5 --as--o v12