query-f8c8fcfa94a6dbcad3d2f010e40bc03e

rq turtle/ttl

Every 'instance of' X which has more than one 'instance of' statement and a list of values of these 'instance of' statamentsDon't know if it's even possible, but maybe it is: optionally: with a number of items that has such statement and the result of the query should be a list of such values from #2 statement(P31)instance of that has another (Q11173)chemical compound (P31)instance of Every ): (Q11173)chemical compound (P31)instance of has (beside (Q191924)D-methamphetamine As an example: (Q8386)drug (P31)instance of (Q44909815)DL-methamphetamine (P31)instance of (Q12140)medication (P31)instance of And I need a list in which I would have: : 50000; but that can be done using another simpler query).(Q12140)medication (optionally with a number, e.g. (Q11173)chemical compound (P31)instance of ... every other 'instance of' value from every other item with (Q8386)drug (Q44909815)DL-methamphetamine (Q12140)medication 22:37, 10 March 2020 (UTC) )talk( Wostr. (Q11173)chemical compound I want to know which other 'instance of' values are present in items classified as : Wostr@ First one, the list of compound with other instance of value :

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
select ?item {
  ?item wdt:P31 wd:Q11173 filter exists {?item wdt:P31 ?class filter (?class != wd:Q11173) }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?class") v2("?item"):::projected c1(["wd:Q11173"]):::iri f0[[" "]] subgraph f0e0["Exists Clause"] e0f0[["?class != 'wd:Q11173'"]] e0f0 --> e0v1 e0v2 --"wdt:P31"--> e0v1 e0v1("?class"):::projected e0v2("?item"):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> v2 f0 --> c2 f1[["?class != 'wd:Q11173'"]] f1 --> v1 v2 --"wdt:P31"--> v1 v2 --"wdt:P31"--> c1