Module: RDF::Repository::Implementation

Defined in:
vendor/bundler/ruby/2.4.0/bundler/gems/rdf-da525ad24ff7/lib/rdf/repository.rb

Overview

A default Repository implementation supporting atomic writes and serializable transactions.

See Also:

Defined Under Namespace

Classes: SerializedTransaction

Constant Summary

DEFAULT_GRAPH =
false

Instance Method Summary collapse

Instance Method Details

#apply_changeset(changeset) ⇒ Object



340
341
342
343
344
345
# File 'vendor/bundler/ruby/2.4.0/bundler/gems/rdf-da525ad24ff7/lib/rdf/repository.rb', line 340

def apply_changeset(changeset)
  data = @data
  changeset.deletes.each { |del| data = delete_from(data, del) }
  changeset.inserts.each { |ins| data = insert_to(data, ins) }
  @data = data
end

#isolation_levelObject



349
350
351
# File 'vendor/bundler/ruby/2.4.0/bundler/gems/rdf-da525ad24ff7/lib/rdf/repository.rb', line 349

def isolation_level
  :serializable
end

#snapshotDataset

A readable & queryable snapshot of the repository for isolated reads.

Returns:

  • (Dataset)

    an immutable Dataset containing a current snapshot of the Repository contents.

See Also:



360
361
362
# File 'vendor/bundler/ruby/2.4.0/bundler/gems/rdf-da525ad24ff7/lib/rdf/repository.rb', line 360

def snapshot
  self.class.new(data: @data).freeze
end