Skip to content

Instantly share code, notes, and snippets.

@salgo60
Created March 9, 2023 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save salgo60/1cf4a0bbf05c926e90ffb57247856a1f to your computer and use it in GitHub Desktop.
Save salgo60/1cf4a0bbf05c926e90ffb57247856a1f to your computer and use it in GitHub Desktop.
Check P1260
# https://w.wiki/6RS9
SELECT ?item ?itemLabel ?shm (count(?id2) AS ?nr) (GROUP_CONCAT(DISTINCT ?id2; SEPARATOR=", ") AS ?x )WHERE {
?item wdt:P1260 ?id2.
?item wdt:P31 wd:Q5.
OPTIONAL {?item wdt:P9495 ?shm}
{
SELECT ?item ?id WHERE {
?item wdt:P1260 ?id.
FILTER(CONTAINS(?id, "LSH/agents"))
}
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en". }
FILTER(?id2 != ?id)
}
GROUP BY ?item ?itemLabel ?shm having(?nr > 1)
order by DESC(?nr)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment