summaryrefslogtreecommitdiff
path: root/lib/serializer.rb
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2010-11-24 13:13:40 +0100
committerChristoph Helma <helma@in-silico.ch>2010-11-24 13:13:40 +0100
commit7067bd44d5c97618ec6a968bbdfe6d6bda12a1cd (patch)
tree8d10b0b82ca124c1f2a99ec97658a89218c2b9b3 /lib/serializer.rb
parent7c743456c42ffa85e81db6d975ebd7ed260f81f0 (diff)
opentox-ruby-api-wrapper renamed to opentox-ruby
Diffstat (limited to 'lib/serializer.rb')
-rw-r--r--lib/serializer.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/serializer.rb b/lib/serializer.rb
index 9b3af39..495702a 100644
--- a/lib/serializer.rb
+++ b/lib/serializer.rb
@@ -40,11 +40,13 @@ module OpenTox
DC.contributor => { RDF["type"] => [{ "type" => "uri", "value" => OWL.AnnotationProperty }] } ,
DC.creator => { RDF["type"] => [{ "type" => "uri", "value" => OWL.AnnotationProperty }] } ,
DC.description => { RDF["type"] => [{ "type" => "uri", "value" => OWL.AnnotationProperty }] } ,
+ DC.date => { RDF["type"] => [{ "type" => "uri", "value" => OWL.AnnotationProperty }] } ,
OT.isA => { RDF["type"] => [{ "type" => "uri", "value" => OWL.AnnotationProperty }] } ,
OT.Warnings => { RDF["type"] => [{ "type" => "uri", "value" => OWL.AnnotationProperty }] } ,
XSD.anyURI => { RDF["type"] => [{ "type" => "uri", "value" => OWL.AnnotationProperty }] } ,
OT.hasStatus => { RDF["type"] => [{ "type" => "uri", "value" => OWL.AnnotationProperty }] } ,
OT.resultURI => { RDF["type"] => [{ "type" => "uri", "value" => OWL.AnnotationProperty }] } ,
+ OT.percentageCompleted => { RDF["type"] => [{ "type" => "uri", "value" => OWL.AnnotationProperty }] } ,
OT.hasSource => { RDF["type"] => [{ "type" => "uri", "value" => OWL.DatatypeProperty }] } ,
OT.value => { RDF["type"] => [{ "type" => "uri", "value" => OWL.DatatypeProperty }] } ,
@@ -125,10 +127,7 @@ module OpenTox
def add_metadata(uri,metadata)
id = 0
metadata.each do |u,v|
- if v.is_a? String
- @object[uri] = {} unless @object[uri]
- @object[uri][u] = [{"type" => type(v), "value" => v }]
- elsif v.is_a? Array and u == OT.parameters
+ if v.is_a? Array and u == OT.parameters
@object[uri][u] = [] unless @object[uri][u]
v.each do |value|
id+=1
@@ -139,6 +138,9 @@ module OpenTox
@object[genid][name] = [{"type" => type(entry), "value" => entry }]
end
end
+ else # v.is_a? String
+ @object[uri] = {} unless @object[uri]
+ @object[uri][u] = [{"type" => type(v), "value" => v }]
end
end
end