Hi now that https://wcqs-beta.wmflabs.org is up and running I was experimenting with how to combine SDC SPARQL queries with information stored in SQL database like category membership, presence of specific templates, etc. I could not fine any way with exception of wikibase:mwapi service, I tried
SELECT ?file ?wd ?fileStr {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
bd:serviceParam mwapi:gcmtitle "Category:Artworks with mismatching structured data P6243 property" .
bd:serviceParam mwapi:generator "categorymembers" .
bd:serviceParam mwapi:gcmtype "page" .
bd:serviceParam mwapi:gcmlimit "max" .
bd:serviceParam mwapi:gcmsort "timestamp" .
?pageid wikibase:apiOutputItem mwapi:pageid.
?ns wikibase:apiOutput "@ns".
}
#?file schema:contentUrl ?url .
FILTER (?ns = "6") # files only
BIND (replace(str(?pageid),'http://www.wikidata.org/entity/','https://commons.wikimedia.org/entity/M') as ?fileStr)
BIND (str(?file) as ?fileStr)
?file wdt:P6243 ?wd .
<nowiki>}</nowiki>
but so far I did not managed to get it to work. I was thinking that since
SELECT ?file ?wd ?fileStr {
BIND (str(?file) as ?fileStr)
?file wdt:P6243 ?wd .
} limit 10
and
SELECT ?fileStr {
SERVICE wikibase:mwapi {
bd:serviceParam wikibase:api "Generator" .
bd:serviceParam wikibase:endpoint "commons.wikimedia.org" .
bd:serviceParam mwapi:gcmtitle "Category:Artworks with mismatching structured data P6243 property" .
bd:serviceParam mwapi:generator "categorymembers" .
bd:serviceParam mwapi:gcmtype "page" .
bd:serviceParam mwapi:gcmlimit "max" .
bd:serviceParam mwapi:gcmsort "timestamp" .
?pageid wikibase:apiOutputItem mwapi:pageid.
?ns wikibase:apiOutput "@ns".
}
#?file schema:contentUrl ?url .
FILTER (?ns = "6") # files only
BIND (replace(str(?pageid),'http://www.wikidata.org/entity/','https://commons.wikimedia.org/entity/M') as ?fileStr)
} limit 10
both create ?fileStr like "https://commons.wikimedia.org/entity/M9094174" than I can combine them in order to query SDC statements within a category. Any idea how to get this to work?