Releases: sweetrdf/rdfInterface
Releases · sweetrdf/rdfInterface
Important changes in Literal, Dataset and QuadTemplate
QuadIterator::current()
andDataset::current()
allowed to returnnull
making it possible to use constructs like$dataset->copy(filterMatchingUnknownNumberOfQuads)->current() ?? $defaultValue
to get any quad in the dataset (coupled with the??
for handling an empty dataset scenario when needed). Specification now explicitely requiresDataset::current()
to returnnull
for empty dataset and a quad on non-empty dataset which hasn't been traversed with the\Iterable
interface yet.TermCompare
andQuadCompare extends TermCompare
interfaces replaced theQuadTemplate
interface. This allows flexible implementation of "term template" (especially "quad template") classes as the only thing the rdfInterface enforces on them is to implementequals()
and__toString()
for term template classes and subject/predicate/object/graph getters for quad template classes. Constructor is no longer enforced (as it was with theQuadTemplate
). As a consequence of this change:DataFactory::quadTemplate()
method has been dropped.- All
Dataset
methods used to acceptQuadTemplate
now acceptQuadCompare
. NamedNode
,BlankNode
andDefaultGraph
interfaces extendTermCompare
now.Quad
interface extendsQuadCompare
now.
- In-code documentation describing expected implementations behavior greatly extended for
Literal
andDataset
.- The
Literal
constructor is now required to automatically assign a datatype if a value is bool/int/float and the datatype hasn't been specified. This allows to keep the original PHP type of the value byLiteral::getValue()
(if an implementation supports such a behavior) while avoiding the problem of having many instances of literals which are equal to each other according to the RDF specification.
- The
- Compliance tests extracted to a separate repository (and composer package).
Minor tests extensions
0.7.1 Minor tests extensions
Interopetability tests for Dataset added
0.7.0 Interoperability tests for Dataset added
Literal interface tuning
Yet another approach to the \rdfInterface\Literal
. Still shouldn't be considered stable.
Minor fixes
0.5.1 @param removed from QuadInterface not to confuse phpstan
DefaultGraph made in line with RDF Dataset specification
This affects rdfInterface\DefaultGraph
, rdfInterface\Quad
, rdfInterface\QuadInterface
and rdfInterface\DataFactory
APIs.
RdfNamespace tests added
0.4.5 RdfNamespace tests added
Tests extension and small fixes
- Tests for terms added.
rdfInterface\RdfNamespace
documentation provided.- Default values of
rdfInterface\DataFactory::literal
andrdfInterface\Literal
constructor made in line. - Comments on
rdfInterface\Literal::getDatatype()
andrdfInterface\Literal::getLang()
return type design decisions added. DataFactory
tests split into separate methods to allow easier overriding (e.g. if a given library doesn't implement a given kind of term).- README updated with an example of test class reuse.
Internal tests code structure improvements
0.4.3 Common tests code extracted to the TestBaseTrait
Test classes added
A set of test classes to be used by implementations added.