sweetrdf/rdf-interface
A common RDF interface for PHP RDF libraries.
3.2.0
1.4M downloads/mo
#3116 most downloaded on Packagist
sweetrdf/rdfInterface
What this package is like to depend on
Last release 1 years ago
28 Apr 2025
Release timing varies
gaps range from 8 days to 12 months
Rarely documented
notes for 1 of 26 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
34 releases · first in 2021
0 releases in the last 12 months
see the full history below
Release timeline
33 releases · Jan 2021 to Apr 2025Releases
latest 34-
3.2.028 Apr 2025Nothing published for this version
-
3.1.024 Apr 2025Nothing published for this version
-
3.0.022 Apr 2025Nothing published for this version
-
2.1.022 Nov 2024Nothing published for this version
-
2.0.009 Feb 2024Release notes
Open source →Backward-incompatible changes
rdfInterface\DatasetCompareInterface,rdfInterface\DatasetMapReduceInterfaceandrdfInterface\DatasetQuadPartsInterfacemerged intordfInterface\DatasetInterface.rdfInterface\DatasetInterfacecopyExcept($filter)does not acceptnullas the$filter. If you want to copy all quads, use thecopy()method.delete($filter)does not acceptnullas the$filter. If you want an empty dataset, just create a new one.offsetExists($offset),offsetGet($offset),offsetSet($offset, $value)andoffsetUnset($offset)method now must throw a newly introducedrdfInterface\MultipleQuadsMatchedExceptionif the offset matches multiple quads.
New features
rdfInterface\DatasetNodeInterfaceinterface added for a node-oriented RDF graph operations.
It extends therdfInterface\DatasetInterface, just methods are (generally) applied only to quads with a subject matching a givenrdfInterface\TermInterfaceterm.rdfInterface\TermIteratorInterfaceextendedcontains(rdfInterface\TermCompareInterface $term): boolmethod added allowing to performin_array-like check.getValues(): array<string>method added.intersect($terms): rdfInterface\TermIteratorInterfacemethod added.skip($terms): rdfInterface\TermIteratorInterfacemethod added.
rdfInterface\DatasetNode- Static method
factory()added as a replacement for therdfInterface\DatasetNode::__construct(). This follows the convention not to enforce constructor signatures. - Getter shorthands added (a reference implementation is provided by the
rdfHelpers\DatasetGettersTraitclass of the sweetrdf/rdf-helpers package):getSubject(),getPredicate(),getObject(),getGraph()returning anrdfInterface\TermInterface | nullgetSubjectValue(),getPredicateValue(),getObjectValue(),getGraphValue()returningmixed | null
- Static method
rdfInterface\QuadNoSubjectInterfaceadded for convenient adding quads to therdfInterface\DatasetNode.rdfInterface\DataFactoryquadNoSubject($predicate, $object, $graph): rdfInterface\QuadNoSubjectInterfacemethod added.
rdfInterface\MultipleQuadsMatchedExceptionexception added to make it possible to easily distinguish between standard PHP array access errors (the\UnexpectedValueExceptionwhen an offset does not exist) and rdfInterface-specific "multiple quads matched" error.rdfInterface\QuadInterface::getValue()must throw the\BadMethodCallexception.
Relaxed definitions
rdfInterface\BlankNodeInterface,rdfInterface\NamedNodeInterface,rdfInterface\LiteralInterfaceandrdfInterface\QuadInterfaceconstructor definition dropped. These constructors are anyway not meant to be called directly as terms should be instantiated trough therdfInterface\DataFactoryInterfaceclass so it makes no sense to enforce their signatures.rdfInterface\DatasetNode:__construct()method dropped. This follows the convention not to enforce constructor signatures. A staticfactory()method signature is defined instead.add()acceptsQuadInterface|\Traversable<rdfInterface\QuadInterface>|array<rdfInterface\QuadInterface>(instead ofrdfInterface\QuadInterface|rdfInterface\QuadIteratorInterface|rdfInterface\QuadIteratorAggregateInterface).forEach($filter)acceptsnullas a$filter.
rdfInterface\SerializerInterfaceserialize()andserializeStream()accept\Traversable<QuadInterface>|array<QuadInterface>(instead ofrdfInterface\QuadIteratorInterface|rdfInterface\QuadIteratorAggregateInterface).
Minor changes
rdfInterface\TermInterfacenow extendsrdfInterface\TermCompareInterfaceinstead of definingequals()and__toString()methods explicitly.rdfInterface\TermCompareInterface,rdfInterface\QuadCompareInterfaceandrdfInterface\DatasetInterfaceextendStringableinstead of declaring__toString()explicitly.rdfInterface\QuadCompareInterfacemethods:getSubject(),getPredicate(),getObject()andgetGraph()return type isrdfInterface\TermCompareInterface | null(instead ofrdfInterface\TermInterface | rdfInterface\TermCompareInterface | null).
-
2.0.0-RC7no date pre-release -
2.0.0-RC601 Sep 2023 pre-releaseRelease notes
Open source →- add description of the __toString() behavior
- equals() must take TermInterface as a parameter because without the
getValue() method being available it's impossible to check the terms
equality
-
2.0.0-RC531 Aug 2023 pre-release -
2.0.0-RC431 Aug 2023 pre-release -
2.0.0-RC329 Aug 2023 pre-release -
2.0.0-RC227 Jul 2023 pre-releaseNothing published for this version
-
2.0.0-RC126 Jul 2023 pre-releaseNothing published for this version
-
1.0.121 Jul 2023Nothing published for this version
-
1.0.001 Nov 2022Nothing published for this version
-
1.0.0-RC124 Oct 2022 pre-releaseNothing published for this version
-
0.11.025 May 2022Nothing published for this version
-
0.10.126 May 2021Nothing published for this version
-
0.10.013 Apr 2021Nothing published for this version
-
0.9.003 Apr 2021Nothing published for this version
-
0.8.123 Mar 2021Nothing published for this version
-
0.8.023 Mar 2021Nothing published for this version
-
0.7.121 Mar 2021Nothing published for this version
-
0.7.021 Mar 2021Nothing published for this version
-
0.6.019 Mar 2021Nothing published for this version
-
0.5.116 Mar 2021Nothing published for this version
-
0.5.016 Mar 2021Nothing published for this version
-
0.4.516 Mar 2021Nothing published for this version
-
0.4.416 Mar 2021Nothing published for this version
-
0.4.316 Mar 2021Nothing published for this version
-
0.4.216 Mar 2021Nothing published for this version
-
0.3.114 Mar 2021Nothing published for this version
-
0.3.014 Mar 2021Nothing published for this version
-
0.2.028 Jan 2021Nothing published for this version
-
0.1.016 Jan 2021Nothing published for this version