I need an help with a SPARQL query. In my ontology I have the entity item, wich design an article, it has a property called "keyWord" used to store the main arguments treated in a article. In the Triple Store there is a triple (article, keyWord, argument) for each argument of the article. I want to know with a query what are the articles that have the maximum number of triples with the same value of the property keyWord, how can i do? I've tried something like this, but it's wrong because I want to know only the articles that have the maximum number of common arguments:
SELECT ?item (COUNT(?argument) as ?maxArgument)
WHERE{
?item keyWord ?argument
}
ORDER BY DESC(?maxArgument)
group bythe argument then. Your current query does something different, it returns the number of arguments per each item. That's for sure not what you want. - UninformedUser