query-cc7baf05db9e556a9a55095ef25c0c59
Search in category SELECT DISTINCT ?item ?itemLabel ?inst ?instLabel (GROUP_CONCAT(?endpoint; SEPARATOR=", ") AS ?found_in) { ?cat schema:about wd:Q8682545 . ?cat schema:isPartOf ?wikimedia_site. ?cat schema:name ?category_title. BIND (STRBEFORE(STRAFTER(STR(?wikimedia_site), "https://"), "/") AS ?endpoint) OPTIONAL { SERVICE wikibase:mwapi { bd:serviceParam wikibase:endpoint ?endpoint. bd:serviceParam wikibase:api "Generator". bd:serviceParam mwapi:generator "categorymembers". bd:serviceParam mwapi:gcmtitle ?category_title. bd:serviceParam mwapi:gcmlimit "max". ?item wikibase:apiOutputItem mwapi:item. ?title wikibase:apiOutput mwapi:title. } } OPTIONAL { ?item wdt:P31 ?inst } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it". } } GROUP BY ?item ?itemLabel ?inst ?instLabel
Use at
- https://query.wikidata.org/sparql
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#>
#Search in category
SELECT DISTINCT ?item ?itemLabel ?inst ?instLabel (GROUP_CONCAT(?endpoint; SEPARATOR=", ") AS ?found_in)
{
?cat schema:about wd:Q8682545 .
?cat schema:isPartOf ?wikimedia_site.
?cat schema:name ?category_title.
BIND (STRBEFORE(STRAFTER(STR(?wikimedia_site), "https://"), "/") AS ?endpoint)
OPTIONAL
{
SERVICE wikibase:mwapi
{
bd:serviceParam wikibase:endpoint ?endpoint.
bd:serviceParam wikibase:api "Generator".
bd:serviceParam mwapi:generator "categorymembers".
bd:serviceParam mwapi:gcmtitle ?category_title.
bd:serviceParam mwapi:gcmlimit "max".
?item wikibase:apiOutputItem mwapi:item.
?title wikibase:apiOutput mwapi:title.
}
}
OPTIONAL { ?item wdt:P31 ?inst }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],it". }
}
GROUP BY ?item ?itemLabel ?inst ?instLabel