diff options
Diffstat (limited to 'lib/parser.rb')
-rw-r--r-- | lib/parser.rb | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/lib/parser.rb b/lib/parser.rb index 580f6f7..7475d6d 100644 --- a/lib/parser.rb +++ b/lib/parser.rb @@ -1,6 +1,35 @@ #require 'spreadsheet' #require 'roo' +# OWL Namespaces +class OwlNamespace + + attr_accessor :uri + def initialize(uri) + @uri = uri + end + + def [](property) + @uri+property.to_s + end + + def type # for RDF.type + "#{@uri}type" + end + + def method_missing(property) + @uri+property.to_s + end + +end + +RDF = OwlNamespace.new 'http://www.w3.org/1999/02/22-rdf-syntax-ns#' +OWL = OwlNamespace.new 'http://www.w3.org/2002/07/owl#' +DC = OwlNamespace.new 'http://purl.org/dc/elements/1.1/' +OT = OwlNamespace.new 'http://www.opentox.org/api/1.1#' +OTA = OwlNamespace.new 'http://www.opentox.org/algorithmTypes.owl#' +XSD = OwlNamespace.new 'http://www.w3.org/2001/XMLSchema#' + class String # Split RDF statement into triples |