@elise_daugherty
To calculate the statistical mode in SPARQL, you can use the following query:
1 2 3 4 5 6 7 8 9 10 11 |
SELECT ?mode WHERE { SELECT ?mode (COUNT(?mode) AS ?count) WHERE { ?value rdf:type :Value . ?value :hasValue ?mode . } GROUP BY ?mode ORDER BY DESC(?count) LIMIT 1 } |
In this query, replace :Value
with the appropriate class of your values and :hasValue
with the appropriate property that links the value to the data. This query will return the mode of the data based on the highest frequency of occurrence.