summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--VERSION2
-rwxr-xr-xbin/yaml2owl.rb18
2 files changed, 19 insertions, 1 deletions
diff --git a/VERSION b/VERSION
index 6085e94..77d6f4c 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.2.1
+0.0.0
diff --git a/bin/yaml2owl.rb b/bin/yaml2owl.rb
new file mode 100755
index 0000000..b259ad1
--- /dev/null
+++ b/bin/yaml2owl.rb
@@ -0,0 +1,18 @@
+#!/usr/bin/env ruby
+require 'rubygems'
+require 'opentox-ruby-api-wrapper'
+
+input = YAML.load_file(ARGV[0])
+dataset = OpenTox::Dataset.new
+dataset.title = input[:title]
+dataset.source = input[:source]
+input[:data].each do |c,f|
+ f.each do |k,v|
+ v.each do |value|
+ dataset.add c,k,value
+ end
+ end
+end
+outfile = File.expand_path(File.join(File.dirname(__FILE__),ARGV[0].sub(/yaml/,'owl')))
+dataset.uri = outfile
+File.open(outfile,'w+'){|f| f.puts dataset.rdf}