Bruger:Amjaabc/WikidataQueryService-OL
Udseende
SELECT ?item ?article ?title ?found_in WITH {
SELECT ?item (GROUP_CONCAT(?endpoint; SEPARATOR=", ") AS ?found_in) (MAX(?in_category) AS ?already_in_category) WHERE { ?category schema:name "Kategori:Olympiske sølvmedaljevindere fra Spanien"@da . ?category schema:isPartOf <https://da.wikipedia.org/> . ?category schema:about ?category_item . ?other_cat schema:about ?category_item . ?other_cat schema:isPartOf ?wikimedia_site . ?other_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 . } } FILTER BOUND (?item) BIND (IF(?wikimedia_site = <https://da.wikipedia.org/>, 1, 0) AS ?in_category) } GROUP BY ?item HAVING (?already_in_category = 0)
} AS %get_items WHERE {
hint:Query hint:optimizer "None" . INCLUDE %get_items ?article schema:about ?item . ?article schema:isPartOf <https://da.wikipedia.org/> . ?article schema:name ?title .
}