summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChristoph Helma <helma@in-silico.ch>2010-09-08 16:21:19 +0200
committerChristoph Helma <helma@in-silico.ch>2010-09-08 16:21:19 +0200
commit0e69de27fca7c1a13e3f38dd52d625e6b6e31758 (patch)
treeb47d324211ffb16e63c527f19e03c51c8e27428c /lib
parent5bb39ea69d1875306c640ad17f515f21edc1cda4 (diff)
initial attempts to switch to rdfxml
Diffstat (limited to 'lib')
-rw-r--r--lib/owl.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/owl.rb b/lib/owl.rb
index 6fb457a..08041b6 100644
--- a/lib/owl.rb
+++ b/lib/owl.rb
@@ -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