summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Maunz <andreas@maunz.de>2012-10-31 17:19:58 +0100
committerAndreas Maunz <andreas@maunz.de>2012-10-31 17:19:58 +0100
commit6b2f46353883f1882a84b9972926e69f0d56ae4a (patch)
tree39f96562790f25823ab3c653b804592e2886e3dd
parentb1cc6d277c8c631a7ab54c6b8b654f7a1e05a88c (diff)
Compounds removed from allnde target, fixed metadata
-rw-r--r--application.rb18
1 files changed, 16 insertions, 2 deletions
diff --git a/application.rb b/application.rb
index a54a443..9726f26 100644
--- a/application.rb
+++ b/application.rb
@@ -453,7 +453,13 @@ module OpenTox
get '/dataset/:id/metadata' do
case @accept
when "application/rdf+xml", "text/turtle", "text/plain"
- sparql = "CONSTRUCT {?s ?p ?o.} FROM <#{@uri}> WHERE { ?s ?p ?o. <#{@uri}> ?p ?o. }"
+ sparql = "CONSTRUCT {?s ?p ?o.} FROM <#{@uri}> WHERE {
+ { ?s ?p ?o. <#{@uri}> <#{RDF.type}> ?o. } UNION
+ { ?s ?p ?o. <#{@uri}> <#{RDF::DC.title}> ?o.} UNION
+ { ?s ?p ?o. <#{@uri}> <#{RDF::DC.creator}> ?o.} UNION
+ { ?s ?p ?o. <#{@uri}> <#{RDF::OT.Warnings}> ?o.} UNION
+ { ?s ?p ?o. <#{@uri}> <#{RDF::OT.hasSource}> ?o.}
+ } "
FourStore.query sparql, @accept
else
bad_request_error "'#{@accept}' is not a supported content type."
@@ -496,7 +502,15 @@ module OpenTox
get '/dataset/:id/allnde' do
case @accept
when "application/rdf+xml", "text/turtle", "text/plain"
- sparql = "CONSTRUCT {?s ?p ?o.} FROM <#{@uri}> WHERE { { ?s ?p ?o. <#{@uri}> ?p ?o. } UNION { ?s ?p ?o. ?s <#{RDF.type}> <#{RDF::OT.Feature}> } UNION { ?s ?p ?o. ?s <#{RDF.type}> <#{RDF::OT.Compound}> } UNION { ?s ?p ?o. ?s <#{RDF.type}> <#{RDF::OT.Parameter}> }}"
+ sparql = "CONSTRUCT {?s ?p ?o.} FROM <#{@uri}> WHERE {
+ { ?s ?p ?o. <#{@uri}> <#{RDF.type}> ?o. } UNION
+ { ?s ?p ?o. <#{@uri}> <#{RDF::DC.title}> ?o.} UNION
+ { ?s ?p ?o. <#{@uri}> <#{RDF::DC.creator}> ?o.} UNION
+ { ?s ?p ?o. <#{@uri}> <#{RDF::OT.Warnings}> ?o.} UNION
+ { ?s ?p ?o. <#{@uri}> <#{RDF::OT.hasSource}> ?o.} UNION
+ { ?s ?p ?o. ?s <#{RDF.type}> <#{RDF::OT.Feature}> } UNION
+ { ?s ?p ?o. ?s <#{RDF.type}> <#{RDF::OT.Parameter}> }
+ }"
else
bad_request_error "'#{@accept}' is not a supported content type."
end