query-06f195d57acf77740ee93e9ba7477349

rq turtle/ttl

Female names with prefix and fixed length

Use at

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 ?name WHERE {
  ?item wdt:P31 ?sex .
  VALUES ?sex {wd:Q11879590 wd:Q3409032} .
  ?item rdfs:label ?name FILTER (lang(?name) = "en") . FILTER(STRLEN(?name)=5 && StrStarts(?name,"G"))
  SERVICE wikibase:label {bd:serviceParam wikibase:language "en"}
} ORDER BY ?name LIMIT 500

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") c7(["bd:serviceParam"]):::iri c3(["en"]):::literal f0[["string-length(?name) = '5^^xsd:integer'starts-with(?name,'G')"]] f0 --> v1 f1[["?name = 'en'"]] f1 --> v1 v2 --"wdt:P31"--> v4 bind2[/VALUES ?sex/] bind2-->v4 bind20(["wd:Q11879590"]) bind20 --> bind2 bind21(["wd:Q3409032"]) bind21 --> bind2 v2 --"rdfs:label"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c3 end