lib/rdf/isomorphic.rb in rdf-isomorphic-0.1.2 vs lib/rdf/isomorphic.rb in rdf-isomorphic-0.2.0

- old
+ new

@@ -30,11 +30,11 @@ # repository_a.bijection_to repository_b # @param other [RDF::Enumerable] # @return [Hash, nil] def bijection_to(other) - grounded_stmts_match = (size == other.size) + grounded_stmts_match = (count == other.count) grounded_stmts_match &&= each_statement.all? do | stmt | stmt.has_blank_nodes? || other.has_statement?(stmt) end @@ -134,12 +134,12 @@ # @private # @return [RDF::Node] def self.blank_nodes_in(blank_stmt_list) nodes = [] blank_stmt_list.each do | statement | - nodes << statement.object if statement.object.anonymous? - nodes << statement.subject if statement.subject.anonymous? + nodes << statement.object if statement.object.node? + nodes << statement.subject if statement.subject.node? end nodes.uniq end # Given a set of statements, create a mapping of node => SHA1 for a given @@ -227,11 +227,11 @@ # A node is groundd if it is not a blank node or it is included # in the given mapping of grounded nodes. # @return [Boolean] # @private def self.grounded(node, hashes) - (!(node.anonymous?)) || (hashes.member? node) + (!(node.node?)) || (hashes.member? node) end # Provides a string for the given node for use in a string signature # Non-anonymous nodes will return their string form. Grounded anonymous # nodes will return their hashed form. @@ -239,13 +239,13 @@ # @private def self.string_for_node(node, hashes,target) case when node == target "itself" - when node.anonymous? && hashes.member?(node) + when node.node? && hashes.member?(node) hashes[node] - when node.anonymous? + when node.node? "a blank node" else node.to_s end end @@ -254,7 +254,9 @@ # Extend RDF::Enumerables with these functions. module Enumerable include RDF::Isomorphic end + + autoload :VERSION, 'rdf/isomorphic/version' end