Module: RDF::Repository::Implementation

Defined in:
vendor/bundler/ruby/2.6.0/bundler/gems/rdf-7506695c9b4f/lib/rdf/repository.rb

Overview

A default Repository implementation supporting atomic writes and serializable transactions.

See Also:

Defined Under Namespace

Classes: SerializedTransaction

Constant Summary collapse

DEFAULT_GRAPH =
false

Instance Method Summary collapse

Instance Method Details

#apply_changeset(changeset) ⇒ Object



341
342
343
344
345
346
# File 'vendor/bundler/ruby/2.6.0/bundler/gems/rdf-7506695c9b4f/lib/rdf/repository.rb', line 341

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



350
351
352
# File 'vendor/bundler/ruby/2.6.0/bundler/gems/rdf-7506695c9b4f/lib/rdf/repository.rb', line 350

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:



361
362
363
# File 'vendor/bundler/ruby/2.6.0/bundler/gems/rdf-7506695c9b4f/lib/rdf/repository.rb', line 361

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