query-45d61f379b0a837d0a896c193e5382bf

rq turtle/ttl

Overview of entities (Qnumbers) on the focus list of this project, what they are, and which album they are related to SELECT DISTINCT ?item ?itemLabel

?itemIsA

(GROUP_CONCAT(DISTINCT ?itemIsALabel ; separator = " --- ") as ?ThisItemIsA) ?relatedToAlbum ?relatedToAlbumLabel WHERE { ?item (p:P5008/ps:P5008) wd:Q99484628; . OPTIONAL {?item p:P31 [ps:P31 ?itemIsA].} OPTIONAL {?item p:P5008 [pq:P518 ?relatedToAlbum].}

SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". ?item rdfs:label ?itemLabel. ?itemIsA rdfs:label ?itemIsALabel. ?relatedToAlbum rdfs:label ?relatedToAlbumLabel. } } GROUP BY ?item ?itemLabel ?relatedToAlbum ?relatedToAlbumLabel ORDER BY ?relatedToAlbum

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
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#>
#Overview of entities (Qnumbers) on the focus list of this project, what they are, and which album they are related to 
SELECT DISTINCT ?item ?itemLabel 
#?itemIsA 
(GROUP_CONCAT(DISTINCT ?itemIsALabel ; separator = " --- ") as ?ThisItemIsA) 
?relatedToAlbum ?relatedToAlbumLabel
WHERE 
{
  ?item (p:P5008/ps:P5008) wd:Q99484628; .
  OPTIONAL {?item p:P31 [ps:P31 ?itemIsA].}
  OPTIONAL {?item p:P5008 [pq:P518 ?relatedToAlbum].}

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
  ?item rdfs:label ?itemLabel.
  ?itemIsA rdfs:label ?itemIsALabel.
  ?relatedToAlbum rdfs:label ?relatedToAlbumLabel.
  }
}
GROUP BY ?item ?itemLabel ?relatedToAlbum ?relatedToAlbumLabel
ORDER BY ?relatedToAlbum

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?ThisItemIsA") v2("?item"):::projected v3("?itemIsA") v5("?itemIsALabel"):::projected v4("?itemLabel"):::projected v1("?relatedToAlbum"):::projected v6("?relatedToAlbumLabel"):::projected a1((" ")) a2((" ")) a3((" ")) c8(["bd:serviceParam"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal c3(["wd:Q99484628"]):::iri v2 --"p:P5008"--> a1 a1 --"p:statement/P5008"--> c3 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; a2 -."p:statement/P31".-> v3 v2 --"p:P31"--> a2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; a3 -."p:qualifier/P518".-> v1 v2 --"p:P5008"--> a3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 v2 --"rdfs:label"--> v4 v3 --"rdfs:label"--> v5 v1 --"rdfs:label"--> v6 end bind1[/"?itemIsALabel"/] v5 --o bind1 bind1 --as--o v7