query-4e236e932cda9fba04d641a21cf389de
Most frequently variants of given names Anton
# Query to find the most-frequently represented # variants of the male given name ?tgt_name # when ?tgt_name = Q2958359 # Query generated by [[Template:NameVariantStatsM]]
SELECT distinct ?name ?nameLabel ?nameDescription ?string ?count ?example ?exampleLabel WHERE { hint:Query hint:optimizer "None" . { SELECT distinct ?name ?string (COUNT(DISTINCT ?a) AS ?count) (SAMPLE(?a) AS ?example) WHERE { { SELECT DISTINCT ?name ?string WHERE { {?name wdt:P460 wd:Q35663473 } UNION { wd:Q35663473 wdt:P460 ?name} . ?name wdt:P31 wd:Q12308941 . ?name wdt:P1705 ?string. } } . ?a wdt:P735 ?name . ?a wdt:P31 wd:Q5 .
?a wdt:P27 wd:болгария.
} GROUP BY ?name ?string
} . SERVICE wikibase:label { bd:serviceParam wikibase:language "ru,en" . } }
HAVING (?count > 1)
ORDER BY DESC(?count) ?itemLabel
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Most frequently variants of given names Anton
# Query to find the most-frequently represented
# variants of the male given name ?tgt_name
# when ?tgt_name = Q2958359
# Query generated by [[Template:NameVariantStatsM]]
SELECT distinct ?name ?nameLabel ?nameDescription ?string ?count ?example ?exampleLabel WHERE {
{
SELECT distinct ?name ?string (COUNT(DISTINCT ?a) AS ?count) (SAMPLE(?a) AS ?example) WHERE {
{
SELECT DISTINCT ?name ?string WHERE {
{?name wdt:P460* wd:Q35663473 } UNION { wd:Q35663473 wdt:P460* ?name} .
?name wdt:P31 wd:Q12308941 .
?name wdt:P1705 ?string.
}
} .
?a wdt:P735 ?name .
?a wdt:P31 wd:Q5 .
# ?a wdt:P27 wd:болгария.
} GROUP BY ?name ?string
} .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "ru,en" .
}
}
# HAVING (?count > 1)
ORDER BY DESC(?count) ?itemLabel