0
@@ -2,6 +2,7 @@ require 'lib/uriref'
0
require 'lib/exceptions/uri_relative_exception'
0
+require 'lib/exceptions/about_each_exception'
0
require 'lib/rexml_hacks'
0
@@ -41,6 +42,12 @@ class RdfXmlParser
0
element.attributes.each_attribute { |att|
0
uri = att.namespace + att.name
0
+ if uri == "http://www.w3.org/1999/02/22-rdf-syntax-ns#aboutEach"
0
+ raise AboutEachException, "Failed as per RDFMS-AboutEach-Error001.rdf test from 2004 test suite"
0
+ if uri == "http://www.w3.org/1999/02/22-rdf-syntax-ns#aboutEachPrefix"
0
+ raise AboutEachException, "Failed as per RDFMS-AboutEach-Error002.rdf test from 2004 test suite"
0
if uri == resourceuri #specified resource
0
possible_subject = URIRef.new(value)
0
@@ -76,12 +83,17 @@ class RdfXmlParser
0
- # if uri == "http://www.w3.org/1999/02/22-rdf-syntax-ns#ID"
0
- # rescue UriRelativeException
0
+ if uri == "http://www.w3.org/1999/02/22-rdf-syntax-ns#ID"
0
+ subject = att.element.base.to_s + value
0
+ raise "Needs to have an ID"
0
+# rescue UriRelativeException
0
# add other subject detection subroutines here
0
@@ -118,37 +130,6 @@ class RdfXmlParser
0
element.each_element { |e|
0
- # uri = e.namespace + e.name
0
- # # if e.get_attribute_ns("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "parseType").to_s == "Literal"
0
- # if e.attributes.get_attribute_ns("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "parseType").to_s == "Literal"
0
- # @graph.add_triple(subject, URIRef.new(uri), TypedLiteral.new(e.children.to_s.strip, "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"))
0
- # elsif e.has_elements?
0
- # e.each_element { |se| #se = 'striped element'
0
- # if e.attributes.get_attribute_ns("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "parseType").to_s == "Resource"
0
- # object = self.get_uri_from_atts(se, true)
0
- # # @graph.add_triple(subject, URIRef.new(uri), object)
0
- # # self.parse_element(se, object)
0
- # @graph.add_triple(subject, URIRef.new(uri), object)
0
- # self.parse_element(se, object, true)
0
- # elsif e.has_attributes?
0
- # object = self.get_uri_from_atts(e)
0
- # @graph.add_triple(subject, URIRef.new(uri), object)
0
- # if e.attributes.get_attribute_ns("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "datatype")
0
- # @graph.add_triple(subject, URIRef.new(uri), TypedLiteral.new(e.text, e.attributes.get_attribute_ns("http://www.w3.org/1999/02/22-rdf-syntax-ns#", "datatype").to_s.strip))
0
- # @graph.add_triple(subject, URIRef.new(uri), Literal.new(e.text, e.lang))
0
- # @graph.add_triple(subject, URIRef.new(uri), Literal.new(e.text))
0
self.parse_resource_element e, subject
Comments
No one has commented yet.