query-26446efc97ba5ddaf37558317c309e9d

rq turtle/ttl

BHL creator ID (P4081): List

Use at

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#>
SELECT DISTINCT ?item ?itemLabel (GROUP_CONCAT(?creatorId;SEPARATOR = ", ") AS ?creatorIds) ?ipniAuthorId WHERE {
   ?item wdt:P4081 ?creatorId .
   ?item wdt:P31 ?instanceOf . 
   OPTIONAL {?item wdt:P586 ?ipniAuthorId} .
   OPTIONAL {?item rdfs:label ?itemLabel . FILTER(lang(?itemLabel)="en")}
   BIND(wd:Q5 AS ?creatorType) # human
   FILTER(sameTerm(?instanceOf, ?creatorType))
}
GROUP BY ?item ?itemLabel ?ipniAuthorId

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?creatorId"):::projected v7("?creatorIds") v7("?creatorType") v1("?instanceOf") v6("?ipniAuthorId"):::projected v4("?item"):::projected v3("?itemLabel"):::projected f0[["sameterm(?instanceOf,?creatorType)"]] f0 --> v1 f0 --> v7 v4 --"wdt:P4081"--> v5 v4 --"wdt:P31"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P586".-> v6 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."rdfs:label".-> v3 end bind1[/"'wd:Q5'"/] bind1 --as--o v7 bind3[/"?creatorId"/] v5 --o bind3 bind3 --as--o v7