query-ef3ef866a0ffae584dfc80487b7be0e1

rq turtle/ttl

Configured templateEach API request should have a configured template that describes inputs and outputs. This is required (at least for now) because of the difference of how Mediawiki API and Query service sees the data - for the former, the input is and URL and the output is a tree-like data structure, for the latter, the data is either triples or tabular. Currently the template must be pre-configured, but if that model works, we may allow to create dynamic definitions right in the query. Example service configuration: } ] "www.wikidata.org" ,"www.mediawiki.org" ,".wikipedia.org" [ :"endpoints" }, } } } "/api/query/pages/page/@title" :"title" ,"@title" :"category" { :"vars" ,"/api/query/pages/page/categories/cl" :"items" { :"output" }, } 500 :"default" ,"int" :"type" { :"cllimit" }, "list" :"type" { :"titles" ,"categories" :"prop" ,"query" :"action" { :"params" { :"Categories" { :"services" {. Categories API, implementing CategoriesThis defines one service, named Example API query:

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT * WHERE {
     SERVICE wikibase:mwapi {
          bd:serviceParam wikibase:api "Categories" .
          bd:serviceParam wikibase:endpoint "en.wikipedia.org" .
          bd:serviceParam mwapi:titles "Albert Einstein" .
          bd:serviceParam mwapi:category ?category .
          bd:serviceParam mwapi:title ?title .
      }
 }

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?category"):::projected v2("?title"):::projected c6(["en.wikipedia.org"]):::literal c2(["bd:serviceParam"]):::iri c4(["Categories"]):::literal c8(["Albert Einstein"]):::literal subgraph s1["http://wikiba.se/ontology#mwapi"] style s1 stroke-width:4px; c2 --"mwapi:api"--> c4 c2 --"mwapi:endpoint"--> c6 c2 --"mwapi:titles"--> c8 c2 --"mwapi:category"--> v1 c2 --"mwapi:title"--> v2 end