query-8d82aff51b5ee79035f6b0309423b708
Approach 2:
Use at
- https://query.wikidata.org/sparql
PREFIX schema: <http://schema.org/>
SELECT (COUNT(DISTINCT(?item)) AS ?count)
WHERE {
{
SELECT ?item (SAMPLE(?sitelink) AS ?sl) WHERE {
?sitelink schema:about ?item .
} GROUP BY ?item
HAVING (COUNT(?sitelink) = 1)
}
?sl schema:isPartOf <https://commons.wikimedia.org/>.
FILTER (STRSTARTS(str(?sl), "https://commons.wikimedia.org/wiki/Category:")) .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?_anon_42b5416610844a34809f33a099ae9de147183")
v5("?count")
v3("?item"):::projected
v2("?sitelink")
v5("?sl")
a1((" "))
c5([https://commons.wikimedia.org/]):::iri
f0[["starts-with(str(?sl),'https://commons.wikimedia.org/wiki/Category:')"]]
f0 --> v5
f1[[" = '1^^xsd:integer'"]]
f1 --> a1
v2 --"schema:about"--> v3
bind4[/"count(?sitelink)"/]
v2 --o bind4
bind4 --as--o v4
bind5[/"sample(?sitelink)"/]
v2 --o bind5
bind5 --as--o v5
v5 --"schema:isPartOf"--> c5
bind7[/"count(?item)"/]
v3 --o bind7
bind7 --as--o v5