diff options
author | Christoph Helma <helma@in-silico.de> | 2010-03-19 16:24:41 +0100 |
---|---|---|
committer | Christoph Helma <helma@in-silico.de> | 2010-03-19 16:24:41 +0100 |
commit | 2d58fd80281ddc6a9c061867f3e6930a71df0ffd (patch) | |
tree | 210b91657032072d50ee57e8b024ee91c0557ad7 | |
parent | 7821b0e7c7d97a60b881afff67e557426256eac6 (diff) |
owl parsing implemented
-rw-r--r-- | application.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/application.rb b/application.rb index 2e56233..bd0cea6 100644 --- a/application.rb +++ b/application.rb @@ -18,12 +18,14 @@ class Dataset def to_owl data = YAML.load(yaml) - owl = OpenTox::Owl.new 'Dataset', uri + owl = OpenTox::Owl.create 'Dataset', uri ['title', 'source'].each do |method| eval "owl.#{method} = data.#{method}" end - data.data.each do |compound,features| - owl.add_data_entries compound,features + if data.data + data.data.each do |compound,features| + owl.add_data_entries compound,features + end end owl.rdf end @@ -57,8 +59,7 @@ get '/:id' do begin dataset = Dataset.get(params[:id]) rescue => e - LOGGER.error e.message - LOGGER.warn e.backtrace + raise e.message + e.backtrace halt 404, "Dataset #{params[:id]} not found." end case accept |