query-b0d89a0140a3de14fc8aedb36b45c54d

rq turtle/ttl

Sitelinks to Commons outside of the Gallery/Category namespaces 17:36, 18 July 2020 (UTC)) talk (Mike Peel which links to the 'Institution' namespace. Is there a query that can find these cases? Even better if it can exclude sitelinks that are in the same namespace across wikis (e.g., "Help:"), and equivalent namespaces (e.g., "Wikipedia:" vs. "Commons:"). Thanks. [1]Normally, Commons sitelinks should be to galleries (mainspace) or categories, but occasionally I find sitelinks to other namespaces, e.g.,

Use at

PREFIX schema: <http://schema.org/>
SELECT ?item ?url
WHERE
{

    {
      ?url schema:isPartOf <https://commons.wikimedia.org/> .
      FILTER( REGEX(str(?url), "^https://commons\\.wikimedia\\.org/wiki/Institution:") )
    }
    ?url schema:about ?item .
}
LIMIT 100

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?item"):::projected v1("?url"):::projected c3([https://commons.wikimedia.org/]):::iri f0[["regex(str(?url),'^https://commons\.wikimedia\.org/wiki/Institution:')"]] f0 --> v1 v1 --"schema:isPartOf"--> c3 v1 --"schema:about"--> v2