Currently a request like the below throws an error: "java.lang.IllegalArgumentException: Endpoint name should be a constant"
SELECT * WITH { SELECT ?link ?title ?endpoint { VALUES ?link { wd:Q8523541 } [] schema:about ?link; schema:isPartOf ?ws; schema:name ?title . MINUS { ?ws wikibase:wikiGroup "wikiquote" } BIND( strbefore(strafter(str(?ws),"//"),"/") as ?endpoint) } } as %categories WHERE { INCLUDE %categories SERVICE wikibase:mwapi { bd:serviceParam wikibase:api "Generator" . bd:serviceParam wikibase:endpoint ?endpoint . # bd:serviceParam wikibase:endpoint "eo.wikipedia.org" . bd:serviceParam mwapi:gcmtitle ?title . bd:serviceParam mwapi:generator "categorymembers" . bd:serviceParam mwapi:gcmprop "ids|title|type" . bd:serviceParam mwapi:gcmlimit "max" . ?article wikibase:apiOutput mwapi:title . ?item wikibase:apiOutputItem mwapi:item . ?ns wikibase:apiOutput "@ns" . } }
To query several endpoints based on sitelinks on one or several items, it would be interesting if the endpoint name could be defined in a variable.
It would avoid to list specific endpoints in lines like:
bd:serviceParam wikibase:endpoint "eo.wikipedia.org" .