query-58f1f49988d312cda897aef9eb9900f9

rq turtle/ttl

Finding M-numbers in P486 SELECT ?item ?itemLabel WHERE {?item wdt:P486 ?string. MINUS{?item wdt:P672 [ ].} FILTER(strstarts(?string, 'M'))

     SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
     }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Finding M-numbers in P486
SELECT ?item ?itemLabel
  WHERE {?item wdt:P486 ?string.
      MINUS{?item wdt:P672 [ ].}
            FILTER(strstarts(?string, 'M'))

         SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
         }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v1("?string") a1((" ")) c5(["bd:serviceParam"]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["starts-with(?string,'M')"]] f0 --> v1 v2 --"wdt:P486"--> v1 subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v2 --"wdt:P672"--> a1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end