query-d6cbe9d78b2dae5c13c9615e1f5b5eed

rq turtle/ttl

TODO Для поиска людей с фамилией, но без свойства

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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel 
WHERE {

  SERVICE wikibase:mwapi {
    bd:serviceParam wikibase:api "Search";
                    wikibase:endpoint "www.wikidata.org";
                    mwapi:srsearch "മേനോൻ haswbstatement:P31=Q5".
    ?item wikibase:apiOutputItem mwapi:title .
  }
 ?item rdfs:label ?name .
  FILTER((LANG(?name)) = "ml")
  FILTER(REGEX(STR(?name), "മേനോൻ")).
  MINUS { ?item wdt:P734 wd:Q36981039 . } # I tried both MINUS and FILTER NOT EXISTS
  SERVICE wikibase:label { bd:serviceParam wikibase:language "ml". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v1("?name") c8(["www.wikidata.org"]):::literal c15(["wd:Q36981039"]):::iri c10(["മേനോൻ haswbstatement:P31=Q5"]):::literal c4(["bd:serviceParam"]):::iri c6(["Search"]):::literal c12(["mwapi:title"]):::iri c2(["ml"]):::literal f0[["regex(str(?name),'മേനോൻ')"]] f0 --> v1 f1[["?name = 'ml'"]] f1 --> v1 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c4 --"mwapi:api"--> c6 c4 --"mwapi:endpoint"--> c8 c4 --"mwapi:srsearch"--> c10 v2 --"mwapi:apiOutputItem"--> c12 end v2 --"rdfs:label"--> v1 subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v2 --"wdt:P734"--> c15 end subgraph s2["http://wikiba.se/ontology#label"] style s2 stroke-width:4px; c4 --"mwapi:language"--> c2 end