query-82a96d5b3e46011688400cc08d3a1a18

rq turtle/ttl

Propertiescollection (P195)inventory number (P217)inception (P571)language of work or name (P407)

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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?thing ?thingLabel (GROUP_CONCAT(DISTINCT ?year; separator=", ") as ?years) ?shelfmark (GROUP_CONCAT(DISTINCT ?langLabel ; separator=", ") as ?languages) WHERE {
{ ?thing wdt:P195 wd:Q82133} UNION { ?thing p:P217/pq:P195 wd:Q82133 } #wd:Q16147979 
OPTIONAL {?thing wdt:P217 ?shelfmark}
OPTIONAL {?thing wdt:P571 ?date. BIND(YEAR(?date) AS ?year) }
OPTIONAL {?thing wdt:P407 ?lang }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" . ?thing rdfs:label ?thingLabel . ?lang rdfs:label ?langLabel }
} GROUP BY ?thing ?thingLabel ?shelfmark
ORDER BY ?thingLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?date") v6("?lang") v7("?langLabel"):::projected v9("?languages") v3("?shelfmark"):::projected v2("?thing"):::projected v1("?thingLabel"):::projected v5("?year"):::projected v8("?years") a1((" ")) c9(["bd:serviceParam"]):::iri c2(["wd:Q82133"]):::iri c11(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"p:P217"--> a1 a1 --"p:qualifier/P195"--> c2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P195"--> c2 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P217".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P571".-> v4 bind0[/"year-from-dateTime(?date)"/] v4 --o bind0 bind0 --as--o v5 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P407".-> v6 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 v2 --"rdfs:label"--> v1 v6 --"rdfs:label"--> v7 end bind3[/"?year"/] v5 --o bind3 bind3 --as--o v8 bind4[/"?langLabel"/] v7 --o bind4 bind4 --as--o v9