query-ab8f30dfcfad75cb0f9382dfa713ef7f
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 wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:BubbleChart
SELECT DISTINCT ?instanceLabel (count(?instanceLabel) as ?count)
WHERE
{
?entity wdt:P5008 wd:Q111645234; wdt:P31/wdt:P279* wd:Q1266946 .
?entity p:P921 ?prop .
OPTIONAL { ?prop ps:P921 ?value }
OPTIONAL { ?value wdt:P31 ?instance }
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;
v7("?count")
v2("?entity")
v5("?instance")
v6("?instanceLabel"):::projected
v3("?prop")
v4("?value")
a1((" "))
c2(["wd:Q111645234"]):::iri
c9(["bd:serviceParam"]):::iri
c5(["wd:Q1266946"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"p:direct/P5008"--> c2
v2 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c5
v2 --"p:P921"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:statement/P921".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."p:direct/P31".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind1[/"count(?instanceLabel)"/]
v6 --o bind1
bind1 --as--o v7