query-2b3295ad5c92669b7d7b95078f3868e5

rq turtle/ttl

Exclusion of items

Use at

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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 ?sitelinks
where {
    {
   select distinct ?item 
   where {

      values ?item_class {wd:Q34 wd:Q183}
      ?item wdt:P27 ?item_class; wdt:P21 wd:Q6581072; wdt:P31 wd:Q5.
      filter not exists {[] schema:about ?item; schema:isPartOf <https://de.wikipedia.org/>}
   }
}
   bind(xsd:integer(substr(str(?item), 33)) as ?num).
   ?item wikibase:sitelinks ?sitelinks 
   service wikibase:label {bd:serviceParam wikibase:language "de,en".}
} 
order by desc(?sitelinks) asc(?num)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?item"):::projected v4("?item_class") v5("?num") v1("?sitelinks"):::projected a1((" ")) c3([https://de.wikipedia.org/]):::iri c6(["wd:Q6581072"]):::iri c11(["bd:serviceParam"]):::iri c8(["wd:Q5"]):::iri c13(["de,en"]):::literal f0[["not "]] subgraph f0e0["Exists Clause"] e0a1 --"schema:about"--> e0v1 e0a1 --"schema:isPartOf"--> e0c3 e0v1("?item"):::projected e0a1((" ")):::projected e0c3([https://de.wikipedia.org/]):::iri end f0--EXISTS--> f0e0 f0 --> a1 f0 --> c1 f0 --> v3 f0 --> c2 f0 --> c3 a1 --"schema:about"--> v3 a1 --"schema:isPartOf"--> c3 bind1[/VALUES ?item_class/] bind1-->v4 bind10(["wd:Q34"]) bind10 --> bind1 bind11(["wd:Q183"]) bind11 --> bind1 v3 --"wdt:P27"--> v4 v3 --"wdt:P21"--> c6 v3 --"wdt:P31"--> c8 bind2[/"http://www.w3.org/2001/XMLSchema#integer(substring(str(?item),'33^^xsd:integer'))"/] v3 --o bind2 bind2 --as--o v5 v3 --"wikibase:sitelinks"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end