query-c0037a9fece4556af0b709ccd2f1153b

rq turtle/ttl

]reply[19:56, 9 July 2023 (UTC)) talk (Jobu0101-- in the same item. normal rank only has a d:Q3409032P31: , while preferred rank has a d:Q202444P31: is not selected, because d:Q3943046: item Jobu0101Hello @ also Ryan is found. d:Q202444If you also select for

Use at

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#>
SELECT DISTINCT ?item ?name ?sex WHERE {
  ?item wdt:P31 ?sex .
   { VALUES ?sex {wd:Q3409032} . } UNION  { VALUES ?sex {wd:Q202444} . }
  ?item rdfs:label ?name FILTER (lang(?name) = "en") . FILTER(STRLEN(?name)=4 && StrStarts(?name,"R"))
} ORDER BY ?name

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v1("?name"):::projected v4("?sex"):::projected f0[["string-length(?name) = '4^^xsd:integer'starts-with(?name,'R')"]] f0 --> v1 f1[["?name = 'en'"]] f1 --> v1 v2 --"wdt:P31"--> v4 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; bind2[/VALUES ?sex/] bind2-->v4 bind20(["wd:Q202444"]) bind20 --> bind2 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; bind3[/VALUES ?sex/] bind3-->v4 bind30(["wd:Q3409032"]) bind30 --> bind3 end union0r <== or ==> union0l end v2 --"rdfs:label"--> v1