query-e64f73b0e8933e0424846c8c72a6f575
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX schema: <http://schema.org/>
#items without instance of and subclass of
SELECT ?item ?statements (COUNT(DISTINCT ?sitelink) AS ?sites) ?itemLabel WHERE {
?wikilink schema:about ?item.
?wikilink schema:isPartOf <https://bg.wikipedia.org/>.
?item wikibase:sitelinks _:b4.
MINUS { ?item (wdt:P31|wdt:P279) _:b5. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "bg". }
?item wikibase:statements ?statements.
OPTIONAL {
?sitelink schema:about ?item.
?sitelink schema:inLanguage ?lang.
}
}
GROUP BY ?item ?statements ?itemLabel
HAVING (?sites = 1)
ORDER BY ?sites
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v6("?lang")
v5("?sitelink"):::projected
v7("?sites")
v4("?statements"):::projected
v2("?wikilink")
a1((" "))
a2((" "))
c11(["bg"]):::literal
c4([https://bg.wikipedia.org/]):::iri
c9(["bd:serviceParam"]):::iri
f0[["?sites = '1^^xsd:integer'"]]
f0 --> v7
v2 --"schema:about"--> v3
v2 --"schema:isPartOf"--> c4
v3 --"wikibase:sitelinks"--> a1
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P279"--> a2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P31"--> a2
end
union0r <== or ==> union0l
end
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
v3 --"wikibase:statements"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."schema:about".-> v3
v5 --"schema:inLanguage"--> v6
end
bind3[/"count(?sitelink)"/]
v5 --o bind3
bind3 --as--o v7