query-d784d88722bb72daaf6724455786e6d5

rq turtle/ttl

Propertiespart of (P361)instance of (P31)subclass of (P279)

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel WHERE {# (group_concat(?instanceLabel;SEPARATOR=";") as ?org_types) WHERE {
  filter(NOT EXISTS {?item  wdt:P361 wd:Q129421.} )
  filter(EXISTS{?item  wdt:P31/wdt:P279* wd:Q43229})
{
  SELECT ?item WHERE {
  {
    SERVICE wikibase:mwapi {
      bd:serviceParam wikibase:endpoint "www.wikidata.org";
                    wikibase:api "Generator";
                    mwapi:generator "search";
                    mwapi:gsrsearch "inlabel:university of California, davis"@en;
                    mwapi:gsrlimit "max".
      ?item wikibase:apiOutputItem mwapi:title.
    }
  } UNION {
    SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:endpoint "www.wikidata.org";
                    wikibase:api "Generator";
                    mwapi:generator "search";
                    mwapi:gsrsearch "inlabel:UC Davis"@en;
                    mwapi:gsrlimit "max".
    ?item wikibase:apiOutputItem mwapi:title.
    }
  }
}
}
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} limit 20 #group by ?item ?itemLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?item"):::projected a1((" ")) c9(["www.wikidata.org"]):::literal c17(["max"]):::literal c20([sinlabel:UC Davis^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]):::literal c5(["wd:Q129421"]):::iri c3(["wd:Q43229"]):::iri c13(["search"]):::literal c7(["bd:serviceParam"]):::iri c15([sinlabel:university of California, davis^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#langString>"]):::literal c23(["#91;AUTO_LANGUAGE#93;,en"]):::literal c19(["mwapi:title"]):::iri c11(["Generator"]):::literal f0[[" "]] subgraph f0e0["Exists Clause"] e0v1 --"wdt:P31"--> e0a1 e0a1 --"wdt:P279"--> e0c3 e0v1("?item"):::projected e0a1((" ")):::projected e0c3(["wd:Q43229"]):::iri end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c1 f0 --> a1 f0 --> c2 f0 --> c3 v1 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"wdt:P361"--> e1c2 e1v1("?item"):::projected e1c2(["wd:Q129421"]):::iri end f1--EXISTS--> f1e1 f1 --> v1 f1 --> c4 f1 --> c5 v1 --"wdt:P361"--> c5 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c7 --"mwapi:endpoint"--> c9 c7 --"mwapi:api"--> c11 c7 --"mwapi:generator"--> c13 c7 --"mwapi:gsrsearch"--> c20 c7 --"mwapi:gsrlimit"--> c17 v1 --"mwapi:apiOutputItem"--> c19 end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c7 --"mwapi:endpoint"--> c9 c7 --"mwapi:api"--> c11 c7 --"mwapi:generator"--> c13 c7 --"mwapi:gsrsearch"--> c15 c7 --"mwapi:gsrlimit"--> c17 v1 --"mwapi:apiOutputItem"--> c19 end end union0r <== or ==> union0l end subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c7 --"mwapi:language"--> c23 end