From 0d91dcbdb333c89e636d2df85420c5183706036b Mon Sep 17 00:00:00 2001 From: Christoph Helma Date: Sun, 20 Dec 2009 19:12:40 +0100 Subject: Version bump to 0.0.0 --- bin/yaml2owl.rb | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 bin/yaml2owl.rb (limited to 'bin') 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} -- cgit v1.2.3