DatasetListQuadPartsInterface
extends
DatasetInterface
in
Set of methods for listing distinct Terms being used on a given position of dataset quads.
Tags
Table of Contents
- __construct() : mixed
- __toString() : string
- add() : void
- Adds quad(s) to the dataset.
- copy() : DatasetInterface
- Creates a copy of the dataset.
- copyExcept() : DatasetInterface
- Creates a copy of the dataset.
- delete() : DatasetInterface
- In-place removes quads from the dataset.
- deleteExcept() : DatasetInterface
- In-place removes quads from the dataset.
- equals() : bool
- forEach() : void
- Iterates trough all quads replacing them with a callback result.
- getIterator() : QuadIteratorInterface
- Returns QuadIteratorInterface iterating over dataset's quads.
- listGraphs() : TermIteratorInterface
- listObjects() : TermIteratorInterface
- listPredicates() : TermIteratorInterface
- listSubjects() : TermIteratorInterface
- offsetExists() : bool
- Checks if a given offset exists.
- offsetGet() : QuadInterface
- Returns a quad matching the $offset.
- offsetSet() : void
- Assigns a new value to the quad matching the $offset.
- offsetUnset() : void
- Removes a quad matching the $offset.
- union() : DatasetInterface
- Returns a new dataset being a union of the current one and the $other one.
- xor() : DatasetInterface
- Returns a dataset being a symmetric difference of the current dataset and the $other one.
Methods
__construct()
public
__construct() : mixed
Tags
Return values
mixed —__toString()
public
__toString() : string
Tags
Return values
string —add()
Adds quad(s) to the dataset.
public
add(QuadInterface|QuadIteratorInterface|QuadIteratorAggregateInterface $quads) : void
Parameters
Tags
Return values
void —copy()
Creates a copy of the dataset.
public
copy([QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null $filter = null ]) : DatasetInterface
If $filter is provided, the copy contains only quads matching the $filter.
$filter can be specified as:
- An object implementing the \rdfInterface\QuadCompareInterface (e.g. a single Quad)
- An object implementing the \rdfInterface\QuadIteratorInterface (e.g. another Dataset)
- A callable with signature
fn(\rdfInterface\QuadInterface, \rdfInterface\DatasetInterface): bool
All quads for which the callable returns true are copied.
An in-place equivalent of a call using the $filter is the deleteExcept() method.
Parameters
- $filter : QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null = null
Tags
Return values
DatasetInterface —copyExcept()
Creates a copy of the dataset.
public
copyExcept(QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null $filter) : DatasetInterface
If $filter is provided, the copy contains only quads not matching the $filter.
$filter can be specified as:
- An object implementing the \rdfInterface\QuadCompareInterface (e.g. a single Quad)
- An object implementing the \rdfInterface\QuadIteratorInterface (e.g. another Dataset)
- A callable with signature
fn(\rdfInterface\QuadInterface, \rdfInterface\DatasetInterface): bool
All quads for which the callable returns true are copied.
An in-place equivalent of a call using the $filter is the delete() method.
Parameters
- $filter : QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null
Tags
Return values
DatasetInterface —delete()
In-place removes quads from the dataset.
public
delete(QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable $filter) : DatasetInterface
All quads matching the $filter parameter are removed.
$filter can be specified as:
- An object implementing the \rdfInterface\QuadCompareInterface (e.g. a single Quad)
- An object implementing the \rdfInterface\QuadIteratorInterface (e.g. another Dataset)
- A callable with signature
fn(\rdfInterface\QuadInterface, \rdfInterface\DatasetInterface): bool
All quads for which the callable returns true are copied.
An immputable equivalent is the copyExcept($filter) method.
Parameters
- $filter : QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable
Tags
Return values
DatasetInterface —a dataset containing removed quads.
deleteExcept()
In-place removes quads from the dataset.
public
deleteExcept(QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable $filter) : DatasetInterface
All quads but ones matching the $filter parameter are removed.
$filter can be specified as:
- An object implementing the \rdfInterface\QuadCompareInterface (e.g. a single Quad)
- An object implementing the \rdfInterface\QuadIteratorInterface (e.g. another Dataset)
- A callable with signature
fn(\rdfInterface\QuadInterface, \rdfInterface\DatasetInterface): bool
All quads for which the callable returns true are copied.
An immputable equivalent is the copy($filter) method.
Parameters
- $filter : QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable
Tags
Return values
DatasetInterface —a dataset containing removed quads.
equals()
public
equals(DatasetInterface $other) : bool
Parameters
- $other : DatasetInterface
Tags
Return values
bool —forEach()
Iterates trough all quads replacing them with a callback result.
public
forEach(callable $fn[, QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable $filter = null ]) : void
If the callback returns null, the quad should be removed from the dataset.
Parameters
- $fn : callable
-
with signature
fn(Quad, Dataset): ?Quad
to be run an all quads - $filter : QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable = null
Tags
Return values
void —getIterator()
Returns QuadIteratorInterface iterating over dataset's quads.
public
getIterator([QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null $filter = null ]) : QuadIteratorInterface
If $filter is provided, the iterator includes only quads matching the filter.
$filter can be specified as:
- An object implementing the \rdfInterface\QuadCompareInterface (e.g. a single Quad)
- An object implementing the \rdfInterface\QuadIteratorInterface (e.g. another Dataset)
- A callable with signature
fn(\rdfInterface\QuadInterface, \rdfInterface\DatasetInterface): bool
All quads for which the callable returns true are copied.
Parameters
- $filter : QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null = null
Tags
Return values
QuadIteratorInterface —listGraphs()
public
listGraphs([QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null $filter = null ]) : TermIteratorInterface
Parameters
- $filter : QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null = null
Tags
Return values
TermIteratorInterface —listObjects()
public
listObjects([QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null $filter = null ]) : TermIteratorInterface
Parameters
- $filter : QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null = null
Tags
Return values
TermIteratorInterface —listPredicates()
public
listPredicates([QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null $filter = null ]) : TermIteratorInterface
Parameters
- $filter : QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null = null
Tags
Return values
TermIteratorInterface —listSubjects()
public
listSubjects([QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null $filter = null ]) : TermIteratorInterface
Parameters
- $filter : QuadCompareInterface|QuadIteratorInterface|QuadIteratorAggregateInterface|callable|null = null
Tags
Return values
TermIteratorInterface —offsetExists()
Checks if a given offset exists.
public
offsetExists(QuadCompareInterface|callable|int<0, 0> $offset) : bool
Offset can be specified as:
- An object implementing the \rdfInterface\QuadCompare interface. If more than one quad is matched \OutOfBoundsException must be thrown.
- A callable with the
fn(\rdfInterface\Quad, \rdfInterface\Dataset): bool
signature. Matching quads are the ones for which the callable returnstrue
. If more than one quad is matched \OutOfBoundsException must be thrown. -
- This is a shorthand syntax for checking if the dataset is empty.
The main use case is enabling the
$dataset[0] ?? $defaultQuad
syntax for "unpacking" a dataset containing one or zero quads. Passing any other integer value must throw an \OutOfBoundsException
- This is a shorthand syntax for checking if the dataset is empty.
The main use case is enabling the
Parameters
- $offset : QuadCompareInterface|callable|int<0, 0>
Tags
Return values
bool —offsetGet()
Returns a quad matching the $offset.
public
offsetGet(QuadCompareInterface|callable|int<0, 0> $offset) : QuadInterface
The $offset can be specified as:
- An object implementing the \rdfInterface\QuadCompare interface. If more than one quad is matched \OutOfBoundsException must be thrown.
- A callable with the
fn(\rdfInterface\Quad, \rdfInterface\Dataset): bool
signature. Matching quads are the ones for which the callable returnstrue
. If more than one quad is matched \OutOfBoundsException must be thrown. -
- Returns any quad (or throws \OutOfBoundsException it a dataset is
empty).
The main use case is enabling the
$dataset[0] ?? $defaultQuad
syntax for "unpacking" a dataset containing one or zero quads. As quads within a dataset don't have order, it makes no sense to access them using other integer offsets and an attempt of doing so must throw an \OutOfBoundsException.
- Returns any quad (or throws \OutOfBoundsException it a dataset is
empty).
The main use case is enabling the
Parameters
- $offset : QuadCompareInterface|callable|int<0, 0>
Tags
Return values
QuadInterface —offsetSet()
Assigns a new value to the quad matching the $offset.
public
offsetSet(QuadCompareInterface|callable $offset, QuadInterface $value) : void
Offset can be specified as:
- An object implementing the \rdfInterface\QuadCompare interface. If more than one quad is matched \OutOfBoundsException must be thrown.
- A callable with the
fn(\rdfInterface\Quad, \rdfInterface\Dataset): bool
signature. Matching quads are the ones for which the callable returnstrue
. If more than one quad is matched \OutOfBoundsException must be thrown.
Parameters
- $offset : QuadCompareInterface|callable
- $value : QuadInterface
Tags
Return values
void —offsetUnset()
Removes a quad matching the $offset.
public
offsetUnset(QuadCompareInterface|callable $offset) : void
Offset can be specified as:
- An object implementing the \rdfInterface\QuadCompare interface. If more than one quad is matched \OutOfBoundsException must be thrown.
- A callable with the
fn(\rdfInterface\Quad, \rdfInterface\Dataset): bool
signature. Matching quads are the ones for which the callable returnstrue
.If more than one quad is matched \OutOfBoundsException must be thrown.
Parameters
- $offset : QuadCompareInterface|callable
Tags
Return values
void —union()
Returns a new dataset being a union of the current one and the $other one.
public
union(QuadInterface|QuadIteratorInterface|QuadIteratorAggregateInterface $other) : DatasetInterface
For in-place union use add().
Parameters
Tags
Return values
DatasetInterface —xor()
Returns a dataset being a symmetric difference of the current dataset and the $other one.
public
xor(QuadInterface|QuadIteratorInterface|QuadIteratorAggregateInterface $other) : DatasetInterface
There is no in-place equivalent.