diff --git a/lib/rdf/n3.rb b/lib/rdf/n3.rb index a64dfab..ccbb1d0 100644 --- a/lib/rdf/n3.rb +++ b/lib/rdf/n3.rb @@ -23,7 +23,6 @@ module N3 require 'rdf/n3/format' require 'rdf/n3/vocab' require 'rdf/n3/patches/array_hacks' - require 'rdf/n3/patches/list' autoload :Meta, 'rdf/n3/reader/meta' autoload :Parser, 'rdf/n3/reader/parser' autoload :Reader, 'rdf/n3/reader' diff --git a/lib/rdf/n3/patches/list.rb b/lib/rdf/n3/patches/list.rb deleted file mode 100644 index 72dde2a..0000000 --- a/lib/rdf/n3/patches/list.rb +++ /dev/null @@ -1,36 +0,0 @@ -module RDF - class List - ## - # Validate the list ensuring that - # * rdf:rest values are all BNodes are nil - # * rdf:type, if it exists, is rdf:List - # * each subject has no properties other than single-valued rdf:first, rdf:rest - # other than for the first node in the list - # @return [Boolean] - def valid? - li = subject - while li != RDF.nil do - rest = nil - firsts = rests = 0 - @graph.query(:subject => li) do |st| - case st.predicate - when RDF.type - # Be tollerant about rdf:type entries, as some OWL vocabularies use it excessively - when RDF.first - firsts += 1 - when RDF.rest - rest = st.object - return false unless rest.node? || rest == RDF.nil - rests += 1 - else - # First node may have other properties - return false unless li == subject - end - end - return false unless firsts == 1 && rests == 1 - li = rest - end - true - end - end -end \ No newline at end of file