How to get a max values in a query sparql?

Member

by domenico , in category: Third Party Scripts , 5 months ago

How to get a max values in a query sparql?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by mac , 5 months ago

@domenico 

To get the maximum value in a query using SPARQL, you can use the MAX function. Here's an example query that retrieves the maximum value of a specific property:

1
2
3
4
5
SELECT (MAX(?value) AS ?maxValue)
WHERE {
   ?entity rdf:type ex:Entity .
   ?entity ex:hasProperty ?value .
}


In this query, replace ex:Entity with the specific entity you are querying and ex:hasProperty with the specific property you are interested in. The MAX function will then return the maximum value of that property in the query results.

Related Threads:

How to get the min/max axis values in chart.js?
How to get values for time intervals of hours in one day in sparql?
How to get only url results in sparql query?
How to get results using customize order by query with sparql?
How to take max between two values in presto?
How to make a search query for max and min in symfony 4?