query-ecafb666493b95ba2901dc4c600499d3

rq turtle/ttl

Propertiessubclass of (P279)copyright license (P275)operating system (P306)instance of (P31)

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#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
SELECT DISTINCT
  ?item
  (SAMPLE(COALESCE(?en_label, ?label)) as ?name)
  (GROUP_CONCAT(DISTINCT ?en_class_label; separator=", ") as ?classes)
  (GROUP_CONCAT(DISTINCT ?license_label; separator=", ") as ?licenses)
  (GROUP_CONCAT(DISTINCT ?platform_label; separator=", ") as ?platforms)
WHERE {
  ?item p:P31/ps:P31/wdt:P279* wd:Q341. #wd:Q7397.
  ?item p:P31/ps:P31 ?class.
  OPTIONAL {?class rdfs:label ?en_class_label. FILTER(LANG(?en_class_label) = "en")}
  OPTIONAL {?item rdfs:label ?en_label. FILTER(LANG(?en_label) = "en")} OPTIONAL {?item rdfs:label ?label}
  OPTIONAL{?item wdt:P275 ?license. ?license rdfs:label ?license_label . FILTER(LANG(?license_label) = "en")}
  OPTIONAL{?item wdt:P306 ?platform. ?platform rdfs:label ?platform_label . FILTER(LANG(?platform_label) = "en")}
} GROUP BY ?item ORDER BY ASC(?name)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?class") v11("?classes") v5("?en_class_label"):::projected v4("?en_label"):::projected v6("?item"):::projected v8("?label"):::projected v9("?license") v3("?license_label"):::projected v12("?licenses") v11("?name") v10("?platform") v2("?platform_label"):::projected v13("?platforms") a1((" ")) a2((" ")) a3((" ")) c5(["wd:Q341"]):::iri v6 --"p:P31"--> a1 a1 --"p:statement/P31"--> a2 a2 --"p:direct/P279"--> c5 v6 --"p:P31"--> a3 a3 --"p:statement/P31"--> v7 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v7 -."rdfs:label".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -."rdfs:label".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v6 -."rdfs:label".-> v8 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P275".-> v9 v9 --"rdfs:label"--> v3 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v6 -."p:direct/P306".-> v10 v10 --"rdfs:label"--> v2 end bind4[/"sample(?en_label?label)"/] v4 --o bind4 v8 --o bind4 bind4 --as--o v11 bind5[/"?en_class_label"/] v5 --o bind5 bind5 --as--o v11 bind6[/"?license_label"/] v3 --o bind6 bind6 --as--o v12 bind7[/"?platform_label"/] v2 --o bind7 bind7 --as--o v13