diff options
author | Christoph Helma <helma@in-silico.ch> | 2010-09-08 16:21:19 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2010-09-08 16:21:19 +0200 |
commit | 0e69de27fca7c1a13e3f38dd52d625e6b6e31758 (patch) | |
tree | b47d324211ffb16e63c527f19e03c51c8e27428c /lib | |
parent | 5bb39ea69d1875306c640ad17f515f21edc1cda4 (diff) |
initial attempts to switch to rdfxml
Diffstat (limited to 'lib')
-rw-r--r-- | lib/owl.rb | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -1,8 +1,9 @@ require 'rdf' +require 'rdf/ntriples' require 'rdf/raptor' include RDF # RDF namespaces -RDF = Redland::Namespace.new 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' +#RDF = Redland::Namespace.new 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' OWL = Redland::Namespace.new 'http://www.w3.org/2002/07/owl#' DC = Redland::Namespace.new 'http://purl.org/dc/elements/1.1/' OT = Redland::Namespace.new 'http://www.opentox.org/api/1.1#' @@ -268,7 +269,7 @@ module OpenTox #`rapper -i ntriples -o rdfxml /tmp/d` #@triples #output = RDF::Writer.for(:rdfxml).buffer do |writer| - RDF::Writer.for(:ntriples).buffer do |writer| + RDF::Writer.for(:rdfxml).buffer do |writer| @triples.each do |statement| writer << statement end @@ -391,7 +392,7 @@ module OpenTox def add(s,p,o) #@triples << "#{s} #{p} #{o}.\n".gsub(/\[/,'<').gsub(/\]/,'>') - @triples << [s,p,o] + @triples << [s.to_s.sub(/\[/,'').sub(/\]/,''),p.to_s.sub(/\[/,'').sub(/\]/,''),o.to_s.sub(/\[/,'').sub(/\]/,'')] #@model.add s,p,o end |