def read_data
      @statements_by_subject = {}

      @edges_by_subject = {}

      RDF::NTriples::Reader.new(@data) do |reader|
        reader.each_statement do |statement|
          subject = statement.subject.to_s

          Grom::Helper.lazy_array_insert(@statements_by_subject, subject, statement)

          predicate = statement.predicate.to_s

          object_is_possible_link = statement.object.uri? || statement.object.is_a?(RDF::Node)
          predicate_is_not_a_type_definition = predicate != RDF.type.to_s

          if object_is_possible_link && predicate_is_not_a_type_definition
            predicate = Grom::Helper.get_id(predicate)
            @edges_by_subject[subject] ||= {}
            @edges_by_subject[subject][predicate] ||= []
            @edges_by_subject[subject][predicate] << statement.object.to_s
          end
        end
      end

      self
    end
def read_data
      @statements_by_subject = {}

      @edges_by_subject = {}

      RDF::NTriples::Reader.new(@data) do |reader|
        reader.each_statement do |statement|
          subject = statement.subject.to_s

          Grom::Helper.lazy_array_insert(@statements_by_subject, subject, statement)

          predicate = statement.predicate.to_s

          object_is_possible_link = statement.object.uri? || statement.object.is_a?(RDF::Node)
          predicate_is_not_a_type_definition = predicate != RDF.type.to_s

          if object_is_possible_link && predicate_is_not_a_type_definition
            predicate = Grom::Helper.get_id(predicate)
            @edges_by_subject[subject] ||= {}
            @edges_by_subject[subject][predicate] ||= []
            @edges_by_subject[subject][predicate] << statement.object.to_s
          end
        end
      end

      self
    end
@param [String] data n-triple data.
 @param [Module] decorators decorators to use when building Grom::Node objects.
 Reads the n-triple data and separates the statements by subject.

 @return [Grom::Reader] an instance of self.