SPARQL
Posts  1 - 1  of  1
zDeveloper
Hi!

I'm new in Semantics and using SPARQL as a query language.

I'm trying to execute a SELECT query into my sesame repository.
The simple version of my SELECT is working fine. The problem is adding the FILTER clause.

I want to get the most recent value of a set of Measures. This is a brief specification of my ontology...

Measure -hasValue- float
-hasDateTime- dateTime

Here is the query I'm trying to run:

.........
Prefixes
..........

" SELECT ?value"+
" WHERE {"+
" ?measure rdf:type ismed:Measure;"+
" ismed:hasValue ?value;"+
" ismed:hasDateTime ?dateTime ."+
" OPTIONAL {"+
" ?measure2 rdf:type ismed:Measure;"+
" ismed:hasDateTime ?dateTime2 ."+
" FILTER (?dateTime2 > ?dateTime) ."+
" }."+
" FILTER (!BOUND(?dateTime2)) ."+
" }";

Every time I execute this query get all the measure values stored in the repository, not just the most recent one.
Someone may help me with this??

Thank you so much!
Save
Cancel
Reply
 
x
OK