query-edfe9872e29f037f6f85530ae47641f4
Slightly different results after federating a queryI noticed slightly different numbers in the results between my ordinary query and my rewritten for WDGS query. What's going on (probably I did something wrong!) The query is to count the types of things that main subjects of my theses are. The original query:
Use at
- https://query.wikidata.org/sparql
PREFIX wdsubgraph: <https://query.wikidata.org/subgraph/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:BubbleChart
SELECT DISTINCT ?instanceLabel (count(?instanceLabel) as ?count)
WHERE {
{
SERVICE wdsubgraph:scholarly_articles {
?thesis wdt:P5008 wd:Q111645234 ;
wdt:P921 ?mainsubject.
}
}
OPTIONAL {
?mainsubject wdt:P31 ?instance
BIND(?instanceLabel as ?instanceLabel)
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?instanceLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?count")
v4("?instance")
v5("?instanceLabel"):::projected
v3("?mainsubject")
v2("?thesis")
c3(["wd:Q111645234"]):::iri
c7(["bd:serviceParam"]):::iri
c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph s1["https://query.wikidata.org/subgraph/scholarly_articles"]
style s1 stroke-width:4px;
v2 --"wdt:P5008"--> c3
v2 --"wdt:P921"--> v3
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P31".-> v4
bind0[/"?instanceLabel"/]
v5 --o bind0
bind0 --as--o v5
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c7 --"wikibase:language"--> c9
end
bind2[/"count(?instanceLabel)"/]
v5 --o bind2
bind2 --as--o v6