query-a8538cb30cdb38c684f593d2664c96a1

rq turtle/ttl

Integration of MWAPI to parse categories runs into timeout only by de.wikipedia and look for the Categories of their Wikipedia-Pages. (Q40)Austria in (Q728937)railway line I tried to create a query to fetch the categories of the corresponding wikipedia-pages from a set of filtered items via SPARQL. I query all If i used en.wikipedia.org it works pretty fine (also for different other endpoints: nl.wikipedia, jp.wikipedia, fr.wikipedia)

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?cat ?title WHERE {
   ?Eisenbahn wdt:P31 wd:Q728937.
   ?Eisenbahn wdt:P17 wd:Q40.
   ?wikiLink schema:isPartOf <https://fr.wikipedia.org/>;
                      schema:name ?title ;
                      schema:about ?Eisenbahn.
   SERVICE wikibase:mwapi {
     bd:serviceParam wikibase:api "Categories" .
     bd:serviceParam wikibase:endpoint "fr.wikipedia.org" .
     bd:serviceParam mwapi:titles ?title .
     ?cat wikibase:apiOutput mwapi:category .
  }
}
LIMIT 300

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?Eisenbahn") v4("?cat"):::projected v3("?title"):::projected v2("?wikiLink") c12(["Categories"]):::literal c4(["wd:Q40"]):::iri c6([https://fr.wikipedia.org/]):::iri c2(["wd:Q728937"]):::iri c14(["fr.wikipedia.org"]):::literal c10(["bd:serviceParam"]):::iri c17(["mwapi:category"]):::iri v1 --"wdt:P31"--> c2 v1 --"wdt:P17"--> c4 v2 --"schema:isPartOf"--> c6 v2 --"schema:name"--> v3 v2 --"schema:about"--> v1 subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c10 --"mwapi:api"--> c12 c10 --"mwapi:endpoint"--> c14 c10 --"mwapi:titles"--> v3 v4 --"mwapi:apiOutput"--> c17 end