query-cb3bfef3029d20f92ed69c4ea73a0de7
Fetch Category Members from enwiki that exist in ptwikiHi! I have the SPARQL query below, but it often times out (as it did in this example). I don't fully understand how it works to see what is wrong with it. I simply need it to list out the category members of a certain category in enwiki and their respective pages in ptwiki. Any helo would be immensely appreciated.
Use at
- https://query.wikidata.org/sparql
PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?_articleEN ?_articlePT ?_articleES
WHERE {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:endpoint "en.wikipedia.org" .
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam mwapi:gcmtitle "Category:Sheet music publishing companies" .
bd:serviceParam mwapi:generator "categorymembers" .
bd:serviceParam mwapi:gcmtype "page" .
bd:serviceParam mwapi:gcmlimit "max" .
?item wikibase:apiOutputItem mwapi:item .
?itemLabel wikibase:apiOutput mwapi:title .
}
OPTIONAL {
?_articleEN schema:about ?item;
schema:isPartOf <https://en.wikipedia.org/>.
}
OPTIONAL {
?_articlePT schema:about ?item;
schema:isPartOf <https://pt.wikipedia.org/>.
}
OPTIONAL {
?_articleES schema:about ?item;
schema:isPartOf <https://es.wikipedia.org/>.
}