I am writing a query in SPARQL for a knowledge graph. I have a column having Country and names of countries repeating. For example: Japan, India, US, India, India, US, US, Romania etc. and so on.
I need to write a SPARQL query that gives me the count of each country in that column. Example: Japan 1, India 3, US 3 etc. and so on.
SELECT ?countryName COUNT(?CountryName)
WHERE
{
...
}
GROUP BY ?countryName
HAVING (?countryName = "Germany")