2.0 Beta Release
Pre-release
Pre-release
Updates for RDF.rb 2.0 Beta
- Specs for
Queryable#query
tested internal implementation rather than behavior, this caused issues for classes mixing inQueryable
, but delegating#query
to some collaborator. See, e.g. ActiveTriples/ActiveTriples#169. This tests the contract directly, instead. - Add tests for Transaction, Changeset, and Dataset
- Refactor
Queryable
specs- #33 created some duplicate tests; this refactors by moving them into a shared example set.
- Additionally, it skips specs for
#query_pattern
and#query_execute
if they are not defined by theQueryable
. This allows implementations to fulfill the#query
interface directly, if desired.
- Disable an enumerable test unless the subject supports named graphs. (Moved some other checks inside the spec, where it's defined).
- In Mutable, when doing deletes with patterns, make sure to not use BNodes, which might not be supported by repository implementation.
- Add
RDF::Spec.logger
, which creates a Logger instance using a StringIO. Also implements#clear
and#to_s
instance methods. - Added
be_equivalent_graph
andproduce
matchers. - Simplify
Enumerable#has_statement?
spec as both Repositories and Graphs should have a statement, either matching on graph_name, or ignoring it. Previously, if a Graph had a boundgraph_name
it would need to match that in the statement, but this is inconsistent with the notion that a graph has only triples. - Change Queryable#first_* specs to not depend on query result ordering.
- Add a round-trip check for Writers also having a Reader to ensure that different BNodes having the same identifier get written out with unique identifiers (see ruby-rdf/rdf/issues/262).
- Soften RDF::Transaction buffering requirements
- Not every
Transaction
needs to keep an up-to-dateChangeset
in buffer. This change loosens the requirements. some of the tests are removed to therdf
test suite inspec/transaction_spec.rb
. - Introduce
RDF::Dataset
as a distinct conceptDataset
is introduced as a base class ofRDF::Repository
. It represents a (default read only) set of graphs. Some of the specs are removed from the repository specs, but are re-included indirectly through dataset's tests.
- Test atomic/transactional #delete_insert application
- When a Mutable
#supports?(:transactions)
,#delete_insert
is guaranteed to update atomically. Repository#delete_insert
always applies within a transaction scope and conforms to the individual Repository`s transaction semantics.
- When a Mutable
- Check durability by re-creating the repository using
uri
and verifying that when subject is updated, the new instance is also updated. Fixes #52. - Skip mutable and writable tests unless resource is mutable or writable. This is better than testing separately in each test.
- Avoid changing Repository while tx is in progress
- Adding or deleting statements in the Repository causes serializable transactions to break (correctly). Instead, prepare the repository state before beginning the test transaction.
- Test isolation semantics for transactions.