query-b1ba7410b7beee8a40913721090d72c5

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?sexualityLabel ?linkcount WHERE {
  ?item wdt:P91 ?sexuality .
  values ?sexuality {wd:Q592 wd:Q6636 wd:Q6649 wd:Q43200 wd:Q51415 wd:Q255155 wd:Q271534 wd:Q339014 wd:Q724351 wd:Q8354594
}  FILTER NOT EXISTS {                              # has no en.wikipedia sitelink
    ?wen schema:about ?item .
    ?wen schema:isPartOf <https://en.wikipedia.org/> .
  }
  ?item wdt:P31 wd:Q5 .                            # human
  OPTIONAL {?item wikibase:sitelinks ?linkcount .} # count of sitelinks 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} order by DESC(?linkcount)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?item"):::projected v1("?linkcount"):::projected v5("?sexuality") v2("?wen") c3([https://en.wikipedia.org/]):::iri c9(["bd:serviceParam"]):::iri c6(["wd:Q5"]):::iri c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"schema:about"--> e0v2 e0v1 --"schema:isPartOf"--> e0c3 e0v2("?item"):::projected e0v1("?wen"):::projected e0c3([https://en.wikipedia.org/]):::iri end f0--EXISTS--> f0e0 f0 --> v2 f0 --> c1 f0 --> v3 f0 --> c2 f0 --> c3 v2 --"schema:about"--> v3 v2 --"schema:isPartOf"--> c3 v3 --"wdt:P91"--> v5 bind1[/VALUES ?sexuality/] bind1-->v5 bind10(["wd:Q592"]) bind10 --> bind1 bind11(["wd:Q6636"]) bind11 --> bind1 bind12(["wd:Q6649"]) bind12 --> bind1 bind13(["wd:Q43200"]) bind13 --> bind1 bind14(["wd:Q51415"]) bind14 --> bind1 bind15(["wd:Q255155"]) bind15 --> bind1 bind16(["wd:Q271534"]) bind16 --> bind1 bind17(["wd:Q339014"]) bind17 --> bind1 bind18(["wd:Q724351"]) bind18 --> bind1 bind19(["wd:Q8354594"]) bind19 --> bind1 v3 --"wdt:P31"--> c6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wikibase:sitelinks".-> v1 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end