query-6fa7b0b5f2f8a7180b6cfa0fe5aaac3a
19:07, 21 February 2018 (UTC)) talk (Doc TaxonHi! I only want to get those results, which have not a sitelink to de.wikipedia. How can I filter them out?
Use at
- https://query.wikidata.org/sparql
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 ?num ?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
- https://www.wikidata.org/wiki/User_talk:Jura1/6/3/7/1aruJ:klat_resU
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2018/02
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v4("?item_class")
v5("?num"):::projected
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