query-ebc24ec9c497f92f78f9a9845cf3ee09
Propertiesinstance of (P31)subclass of (P279)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?statements ?sites WHERE {
?item wikibase:sitelinks [] .
MINUS { ?item (wdt:P31|wdt:P279) [] } .
?wikilink schema:about ?item .
{ ?wikilink schema:isPartOf <https://or.wikipedia.org/> . }
OPTIONAL { ?item wikibase:statements ?statements .} # for counting statements
OPTIONAL { ?item wikibase:sitelinks ?sites. } # for counting sitelinks
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en" . } # for generating label
}
ORDER BY ASC (?sites)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?sites"):::projected
v4("?statements"):::projected
v3("?wikilink")
a1((" "))
a2((" "))
c9(["bd:serviceParam"]):::iri
c6([https://or.wikipedia.org/]):::iri
c11(["#91;AUTO_LANGUAGE#93;, en"]):::literal
v2 --"wikibase:sitelinks"--> a1
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P279"--> a2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P31"--> a2
end
union0r <== or ==> union0l
end
end
v3 --"schema:about"--> v2
v3 --"schema:isPartOf"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wikibase:statements".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wikibase:sitelinks".-> v1
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end