diff options
-rw-r--r-- | lib/dataset.rb | 8 | ||||
-rw-r--r-- | lib/opentox-client.rb | 3 |
2 files changed, 8 insertions, 3 deletions
diff --git a/lib/dataset.rb b/lib/dataset.rb index 402d2a1..ec0abdb 100644 --- a/lib/dataset.rb +++ b/lib/dataset.rb @@ -220,8 +220,8 @@ module OpenTox end -=begin # TODO: fix bug that affects data_entry positions +=begin def to_ntriples # redefined string version for better performance ntriples = "" @@ -248,13 +248,15 @@ module OpenTox end ntriples << "<#{compound.uri}> <#{RDF::OLO.index}> '#{i}' .\n" - data_entry_node = RDF::Node.new + #data_entry_node = RDF::Node.new + data_entry_node = "_:dataentry"+ i.to_s ntriples << "<#{@uri}> <#{RDF::OT.dataEntry}> #{data_entry_node} .\n" ntriples << "#{data_entry_node} <#{RDF.type}> <#{RDF::OT.DataEntry}> .\n" ntriples << "#{data_entry_node} <#{RDF::OLO.index}> '#{i}' .\n" ntriples << "#{data_entry_node} <#{RDF::OT.compound}> <#{compound.uri}> .\n" @data_entries[i].each_with_index do |value,j| - value_node = RDF::Node.new + value_node = data_entry_node+ "_value"+ j.to_s + #value_node = RDF::Node.new ntriples << "#{data_entry_node} <#{RDF::OT.values}> #{value_node} .\n" ntriples << "#{value_node} <#{RDF::OT.feature}> <#{@features[j].uri}> .\n" ntriples << "#{value_node} <#{RDF::OT.value}> '#{value}' .\n" diff --git a/lib/opentox-client.rb b/lib/opentox-client.rb index ae377bd..16b8552 100644 --- a/lib/opentox-client.rb +++ b/lib/opentox-client.rb @@ -15,6 +15,9 @@ RDF::OT = RDF::Vocabulary.new 'http://www.opentox.org/api/1.2#' RDF::OT1 = RDF::Vocabulary.new 'http://www.opentox.org/api/1.1#' RDF::OTA = RDF::Vocabulary.new 'http://www.opentox.org/algorithmTypes.owl#' RDF::OLO = RDF::Vocabulary.new 'http://purl.org/ontology/olo/core#' +RDF::TB = RDF::Vocabulary.new "http://onto.toxbank.net/api/" +RDF::ISA = RDF::Vocabulary.new "http://onto.toxbank.net/isa/" +RDF::OWL = RDF::Vocabulary.new "http://www.w3.org/2002/07/owl#" CLASSES = ["Generic", "Compound", "Feature", "Dataset", "Algorithm", "Model", "Validation", "Task", "Investigation"] RDF_FORMATS = [:rdfxml,:ntriples,:turtle] |