query-7f4a3378e0fdc0b4741773bca8b2344c
Most frequently variants of given names Nikola
# 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 WHERE { hint:Query hint:optimizer "None" . { SELECT distinct ?name ?string (COUNT(DISTINCT ?a) AS ?count) WHERE { { SELECT DISTINCT ?name ?string WHERE { {?name wdt:P460 wd:Q15501913 } UNION { wd:Q15501913 wdt:P460 ?name} . ?name wdt:P31 wd:Q12308941 . ?name wdt:P1705 ?string. } } . ?a wdt:P735 ?name . ?a wdt:P31 wd:Q5 . } GROUP BY ?name ?string } . SERVICE wikibase:label { bd:serviceParam wikibase:language "bg,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 Nikola
# 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 WHERE {
{
SELECT distinct ?name ?string (COUNT(DISTINCT ?a) AS ?count) WHERE {
{
SELECT DISTINCT ?name ?string WHERE {
{?name wdt:P460* wd:Q15501913 } UNION { wd:Q15501913 wdt:P460* ?name} .
?name wdt:P31 wd:Q12308941 .
?name wdt:P1705 ?string.
}
} .
?a wdt:P735 ?name .
?a wdt:P31 wd:Q5 .
} GROUP BY ?name ?string
} .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "bg,en" .
}
}
# HAVING (?count > 1)
ORDER BY DESC(?count) ?itemLabel