query-cbf6396a92676321d3e00f6dde249310

rq turtle/ttl

Propertiesinstance of (P31)subclass of (P279)equivalent class (P1709)narrower external class (P3950)subject named as (P1810)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
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 ?res ?resLabel ?resDescription (GROUP_CONCAT(DISTINCT ?typeLabel;SEPARATOR=" | ") AS ?types) (GROUP_CONCAT(DISTINCT ?hasCategoryOfResLabel;SEPARATOR=" | ") AS ?lrmType)
WHERE {
  VALUES ?res {
    wd:Q36322 # Jane Austen
    wd:Q84 # London
    wd:Q170583 # Pride and Prejudice (work)
    wd:Q940014 # Pride and Prejudice (film)
    wd:Q63296184 # Pride and Prejudice (manifestation)
  }
  OPTIONAL {
    ?res wdt:P31 ?type .
    ?res wdt:P31/wdt:P279* ?wdType .
    ?wdType p:P1709 | p:P3950 [
      ps:P1709 | ps:P3950 ?hasCategoryOfRes ;
               pq:P1810 ?hasCategoryOfResLabel
    ].
    FILTER(STRSTARTS(STR(?hasCategoryOfRes), "http://iflastandards.info/ns/lrm/lrmer/"))
  }
  SERVICE wikibase:label { 
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en".
    ?type rdfs:label ?typeLabel .
    ?res rdfs:label ?resLabel .
    ?res schema:description ?resDescription .
  }
}
GROUP BY ?res ?resLabel ?resDescription #?hasCategoryOfRes ?hasCategoryOfResLabel
ORDER BY ?res

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?hasCategoryOfRes") v5("?hasCategoryOfResLabel"):::projected v10("?lrmType") v3("?res"):::projected v8("?resDescription"):::projected v7("?resLabel"):::projected v3("?type") v6("?typeLabel"):::projected v9("?types") v4("?wdType") a1((" ")) a2((" ")) a3((" ")) c10(["bd:serviceParam"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?res/] bind0-->v3 bind00(["wd:Q36322"]) bind00 --> bind0 bind01(["wd:Q84"]) bind01 --> bind0 bind02(["wd:Q170583"]) bind02 --> bind0 bind03(["wd:Q940014"]) bind03 --> bind0 bind04(["wd:Q63296184"]) bind04 --> bind0 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P31".-> v3 v3 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> v4 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; a2 --"p:statement/P3950"--> v2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; a2 --"p:statement/P1709"--> v2 end union0r <== or ==> union0l end a2 --"p:qualifier/P1810"--> v5 subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; a3 --"p:statement/P3950"--> v2 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; a3 --"p:statement/P1709"--> v2 end union1r <== or ==> union1l end a3 --"p:qualifier/P1810"--> v5 subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v4 --"p:P3950"--> a3 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v4 --"p:P1709"--> a2 end union2r <== or ==> union2l end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 v3 --"rdfs:label"--> v6 v3 --"rdfs:label"--> v7 v3 --"schema:description"--> v8 end bind3[/"?typeLabel"/] v6 --o bind3 bind3 --as--o v9 bind4[/"?hasCategoryOfResLabel"/] v5 --o bind4 bind4 --as--o v10