diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-09-14 20:52:04 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-09-14 20:52:04 +0200 |
commit | 1178193e877fa6f1ee777943d5594a1bdfae5ff4 (patch) | |
tree | 0194b61ab6a112883237989d410e66af27ed05c8 /application.rb | |
parent | 57d792d260aec3e4220f5195ae3a7f1b108ab2fe (diff) | |
parent | 992dace31947a934788e3de11fd7fafb46685168 (diff) |
simplified version of OwlSerializer, RDF/XML for algorithm/lazar, RDF/XML for annotations,compounds, features in dataset
Diffstat (limited to 'application.rb')
-rwxr-xr-x | application.rb | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/application.rb b/application.rb index 2bdc716..139c867 100755 --- a/application.rb +++ b/application.rb @@ -15,13 +15,19 @@ class Dataset data = YAML.load(yaml) beginning = Time.now owl = OpenTox::OwlSerializer.create 'Dataset', uri - owl.annotate "title", data.title - owl.annotate "creator", data.creator if data.creator -# if data.compounds -# data.compounds.each do |compound| -# owl.add_data_entries compound,data.data[compound] -# end -# end + owl.annotation_property uri, DC.title, data.title, XSD.string + owl.annotation_property uri, DC.creator, data.creator, XSD.string if data.creator + if data.compounds + data.compounds.each do |compound| + owl.object_property uri, OT.compound, compound, XSD.anyUri + end + end + if data.features + data.features.each do |feature| + owl.object_property uri, OT.feature, feature, XSD.anyUri + end + end + #TODO: add data entries nt = owl.rdf LOGGER.debug "OWL creation took #{Time.now - beginning} seconds" nt @@ -64,7 +70,7 @@ def get_dataset( params, request, response, only_metadata=false ) raise e.message + e.backtrace halt 404, "Dataset #{params[:id]} not found." end - halt 404, "Dataset #{params[:id]} not found." if dataset.nil? # not sure how an empty cataset can be returned, but if this happens stale processes keep runing at 100% cpo + halt 404, "Dataset #{params[:id]} not found." if dataset.nil? # not sure how an empty dataset can be returned, but if this happens stale processes keep runing at 100% cpu if only_metadata # remove compounds and feature data from yaml d = YAML.load(dataset.yaml) |