diff options
author | gebele <gebele@in-silico.ch> | 2013-06-12 19:13:00 +0200 |
---|---|---|
committer | gebele <gebele@in-silico.ch> | 2013-06-12 19:13:00 +0200 |
commit | 1313f579dd1ca8bad2c8a0d717ad24ecb7939400 (patch) | |
tree | 4c33756864c54430551d655d7de3aa4bde747248 | |
parent | 93b90b0800f8c339eb1a495c23634921abce321f (diff) |
removed sparql LIMIT; changed internal route /last/:limit to /ordered
-rw-r--r-- | lib/opentox.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/opentox.rb b/lib/opentox.rb index 80339b4..3adca81 100644 --- a/lib/opentox.rb +++ b/lib/opentox.rb @@ -134,12 +134,11 @@ module OpenTox # internal route not in API # example: /SERVICE/last/0 returns last 10 modified uris (default) # example: /SERVICE/last/5 returns last 5 modified uris - get "/#{SERVICE}/last/:limit/?" do - limit = params[:limit].to_i > 0 ? params[:limit].to_i : 10 - FourStore.query("SELECT DISTINCT ?g WHERE + get "/#{SERVICE}/ordered/?" do + FourStore.query("SELECT DISTINCT ?s WHERE {GRAPH ?g - {?s <#{RDF::DC.modified}> ?o.} - } ORDER BY ?o LIMIT #{limit}", @accept) + {?s <#{RDF.type}> <#{RDF::OT}#{SERVICE.capitalize}>; <#{RDF::DC.date}> ?o. } + } ORDER BY ?o ", @accept) end # Create a new resource |