query-b9fe4812a2ae4e22123b08c5d2b8cf91

rq turtle/ttl

SF awards without sfadb links

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 bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?parts1 ?itemLabel ?instances ?subclasses ?parts WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
  {
    SELECT DISTINCT ?item 
      (GROUP_CONCAT(DISTINCT ?instancelabel; SEPARATOR=", ") AS ?instances)
      (GROUP_CONCAT(DISTINCT ?subclasslabel; SEPARATOR=", ") AS ?subclasses)
      (GROUP_CONCAT(DISTINCT ?partlabel; SEPARATOR=", ") AS ?parts)
      (GROUP_CONCAT(DISTINCT ?part; SEPARATOR=", ") AS ?parts1)
                WHERE {
      SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }

      ?item wdt:P31*/wdt:P279* wd:Q107581694.
      MINUS {?item wdt:P1343 wd:Q108696153}

      OPTIONAL {?item wdt:P31 ?instance.
        {SERVICE wikibase:label {bd:serviceParam wikibase:language "en-gb,en,mul" . ?instance rdfs:label ?instancelabel}
}
}

      OPTIONAL {?item wdt:P279 ?subclass.
        {SERVICE wikibase:label {bd:serviceParam wikibase:language "en-gb,en,mul" . ?subclass rdfs:label ?subclasslabel}
}
} 
      OPTIONAL {?item wdt:P361 ?part.
        {SERVICE wikibase:label {bd:serviceParam wikibase:language "en-gb,en,mul" . ?part rdfs:label ?partlabel}
}
} 
    }
    GROUP BY ?item
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?instance") v3("?instancelabel") v8("?instances"):::projected v1("?item"):::projected v6("?part") v7("?partlabel") v10("?parts"):::projected v11("?parts1"):::projected v4("?subclass") v9("?subclasses"):::projected v5("?subclasslabel") a1((" ")) c4(["en-gb,en,mul"]):::literal c2(["bd:serviceParam"]):::iri c7(["wd:Q107581694"]):::iri c9(["wd:Q108696153"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c7 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v1 --"wdt:P1343"--> c9 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P31".-> v2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 v2 --"rdfs:label"--> v3 end end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P279".-> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 v4 --"rdfs:label"--> v5 end end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P361".-> v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 v6 --"rdfs:label"--> v7 end end bind5[/"?instancelabel"/] v3 --o bind5 bind5 --as--o v8 bind6[/"?subclasslabel"/] v5 --o bind6 bind6 --as--o v9 bind7[/"?partlabel"/] v7 --o bind7 bind7 --as--o v10 bind8[/"?part"/] v6 --o bind8 bind8 --as--o v11