query-fae81cc058f570a423adf845c990303b
15:06, 27 June 2017 (UTC) Jura--- . mw:Wikidata_query_service/User_Manual/MWAPI#Find_articles_in_WIkipediaAny idea how I could get this to work ? I tried to adapt the sample from ). So it should be XPath, but I'm not sure actually how to make search produce page IDs. Generator though does it easily:https://github.com/wikimedia/wikidata-query-deploy/blob/master/mwservices.jsonThere's no "item" in Search service definition (see
Use at
- https://query.wikidata.org/sparql
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 "Generator" .
bd:serviceParam wikibase:endpoint "en.wikipedia.org" .
bd:serviceParam mwapi:generator "search" .
bd:serviceParam mwapi:gsrsearch "cheese" .
bd:serviceParam mwapi:gsrlimit "max" .
?item wikibase:apiOutputItem mwapi:item .
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
c14(["mwapi:item"]):::iri
c12(["max"]):::literal
c10(["cheese"]):::literal
c6(["en.wikipedia.org"]):::literal
c8(["search"]):::literal
c2(["bd:serviceParam"]):::iri
c4(["Generator"]):::literal
subgraph s1["http://wikiba.se/ontology#mwapi"]
style s1 stroke-width:4px;
c2 --"mwapi:api"--> c4
c2 --"mwapi:endpoint"--> c6
c2 --"mwapi:generator"--> c8
c2 --"mwapi:gsrsearch"--> c10
c2 --"mwapi:gsrlimit"--> c12
v1 --"mwapi:apiOutputItem"--> c14
end