query-ce1bfb66bb4a271f15965271f8c9b86b
Verify categories across languages 09:45, 6 February 2020 (UTC)) talk (Luckyz in italian wikipedia. Thanks --w:it:Categoria:Vincitori di medaglia d'oro olimpica per l'Austria is not in the corresponding category it:w:Julia Dujmovits on english wikipedia and the corresponding page en:w:Category:Olympic gold medalists for Austria has category en:w:Julia DujmovitsI'm wondering if there's a way to verify if a page in a category and the corresponding page on a different wikipedia is in the corresponding category. Example given: If 01:33, 7 February 2020 (UTC)) talk (Dipsacus fullonum on enwiki but not itwiki, or inverse. It is a first attempt, and I am sure it can be done better. --(Q7893678)Category:Olympic gold medalists for Austria : Here is code that lists items in the category Luckyz@ 21:45, 6 February 2020 (UTC)) talk (Dipsacus fullonum. I will have to study this more before trying to do this, but maybe others can help. --mw:Wikidata Query Service/User Manual/MWAPIUpdate: My answer may be wrong as you can in fact call the MediaWiki API of all Wikipedias as a service from the Wikidata Query Service. See 11:40, 6 February 2020 (UTC)) talk (Dipsacus fullonumYes, but not with SPARQL queries. I have done checks like that using database dumps from the Wikipedias and Wikidata, but I don't have the setup to do this at the momonet. --
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel (SUM(?in_en) AS ?Enlish_category) (SUM(?in_it) AS ?Italian_category)
WHERE
{
VALUES ?category { wd:Q7893678 }
[] schema:about ?category; schema:isPartOf <https://en.wikipedia.org/>; schema:name ?cat_title_en.
[] schema:about ?category; schema:isPartOf <https://it.wikipedia.org/>; schema:name ?cat_title_it.
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:api "Generator".
bd:serviceParam wikibase:endpoint "en.wikipedia.org".
bd:serviceParam mwapi:gcmtitle ?cat_title_en.
bd:serviceParam mwapi:generator "categorymembers".
bd:serviceParam mwapi:gcmprop "ids".
bd:serviceParam mwapi:gcmlimit "max".
?item wikibase:apiOutputItem mwapi:item.
}
VALUES ?in_en { 1 }
}
UNION
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:api "Generator".
bd:serviceParam wikibase:endpoint "it.wikipedia.org".
bd:serviceParam mwapi:gcmtitle ?cat_title_it.
bd:serviceParam mwapi:generator "categorymembers".
bd:serviceParam mwapi:gcmprop "ids".
bd:serviceParam mwapi:gcmlimit "max".
?item wikibase:apiOutputItem mwapi:item.
}
VALUES ?in_it { 1 }
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?item ?itemLabel
HAVING (?Enlish_category = 0 || ?Italian_category = 0)