Skip to content

Commit b525150

Browse files
committed
Finish 2.0.0.beta1
2 parents e767c33 + 4f2eb55 commit b525150

3 files changed

Lines changed: 33 additions & 10 deletions

File tree

README

Lines changed: 0 additions & 1 deletion
This file was deleted.

lib/rdf/repository.rb

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ module RDF
5151
# above those declared by the RDF data model, should advertise this fact in
5252
# their documentation.
5353
#
54-
# Isolation may be supported at various levels, indicated by `#supports?`:
55-
# - `:read_uncommitted`: inserts & deletes in an uncommitted transaction
54+
# Isolation may be supported at various levels, indicated by
55+
# `#isolation_level`:
56+
# - `:read_uncommitted`: Inserts & deletes in an uncommitted transaction
5657
# scope may be visible to other transactions (or via `#each`, etc...)
57-
# - `:read_committed`: inserts & deletes may be visible to other
58+
# - `:read_committed`: Inserts & deletes may be visible to other
5859
# transactions once committed
5960
# - `:repeatable_read`: Phantom reads may be possible
6061
# - `:snapshot`: A transaction reads a consistent snapshot of the data.
@@ -509,22 +510,32 @@ def delete_from(data, statement)
509510
##
510511
# A transaction for the Hamster-based `RDF::Repository::Implementation`
511512
# with full serializability.
512-
#
513+
#
513514
# @todo refactor me!
514515
# @see RDF::Transaction
515516
class SerializedTransaction < Transaction
517+
##
518+
# @see Transaction#initialize
516519
def initialize(*)
517520
super
518521
@base_snapshot = @snapshot
519522
end
520523

524+
##
525+
# Inserts the statement to the transaction's working snapshot.
526+
#
527+
# @see Transaction#insert_statement
521528
def insert_statement(statement)
522529
@snapshot = @snapshot.class
523530
.new(data: @snapshot.send(:insert_to,
524531
@snapshot.send(:data),
525532
process_statement(statement)))
526533
end
527534

535+
##
536+
# Deletes the statement from the transaction's working snapshot.
537+
#
538+
# @see Transaction#insert_statement
528539
def delete_statement(statement)
529540
@snapshot = @snapshot.class
530541
.new(data: @snapshot.send(:delete_from,
@@ -537,7 +548,20 @@ def delete_statement(statement)
537548
def isolation_level
538549
:serializable
539550
end
540-
551+
552+
##
553+
# Replaces repository data with the transaction's snapshot in a safely
554+
# serializable fashion.
555+
#
556+
# @note this transaction uses a pessimistic merge strategy which
557+
# fails the transaction if any data has changed in the repository
558+
# since transaction start time. However, the specific guarantee is
559+
# softer: multiple concurrent conflicting transactions will not
560+
# succeed. We may choose to implement a less pessimistic merge
561+
# strategy as a non-breaking change.
562+
#
563+
# @raise [TransactionError] when the transaction can't be merged.
564+
# @see Transaction#execute
541565
def execute
542566
raise TransactionError, 'Cannot execute a rolled back transaction. ' \
543567
'Open a new one instead.' if @rolledback

rdf.gemspec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Gem::Specification.new do |gem|
77

88
gem.name = 'rdf'
99
gem.homepage = 'http://ruby-rdf.github.com/'
10-
gem.license = 'Public Domain' if gem.respond_to?(:license=)
10+
gem.license = 'Unlicense'
1111
gem.summary = 'A Ruby library for working with Resource Description Framework (RDF) data.'
1212
gem.description = 'RDF.rb is a pure-Ruby library for working with Resource Description Framework (RDF) data.'
1313
gem.rubyforge_project = 'rdf'
@@ -16,7 +16,7 @@ Gem::Specification.new do |gem|
1616
gem.email = 'public-rdf-ruby@w3.org'
1717

1818
gem.platform = Gem::Platform::RUBY
19-
gem.files = %w(AUTHORS CREDITS README UNLICENSE VERSION bin/rdf etc/doap.nt) + Dir.glob('lib/**/*.rb')
19+
gem.files = %w(AUTHORS CREDITS README.md UNLICENSE VERSION bin/rdf etc/doap.nt) + Dir.glob('lib/**/*.rb')
2020
gem.bindir = %q(bin)
2121
gem.executables = %w(rdf)
2222
gem.default_executable = gem.executables.first
@@ -30,8 +30,8 @@ Gem::Specification.new do |gem|
3030
gem.add_runtime_dependency 'link_header', '~> 0.0', '>= 0.0.8'
3131
gem.add_runtime_dependency 'hamster', '~> 2.0'
3232
gem.add_development_dependency 'rdf-spec', '>= 2.0.0.beta', '< 3'
33-
gem.add_development_dependency 'rdf-vocab', '>= 0.8'
34-
gem.add_development_dependency 'rdf-xsd', '>= 1.1'
33+
gem.add_development_dependency 'rdf-vocab', '>= 2.0.0.beta', '< 3'
34+
gem.add_development_dependency 'rdf-xsd', '>= 2.0.0.beta', '< 3'
3535
gem.add_development_dependency 'rest-client', '~> 1.7'
3636
gem.add_development_dependency 'rspec', '~> 3.0'
3737
gem.add_development_dependency 'rspec-its', '~> 1.0'

0 commit comments

Comments
 (0)