Dataset
in package
implements
Dataset, DatasetMapReduce, DatasetCompare, DatasetListQuadParts
Description of Graph
Tags
Interfaces, Classes, Traits and Enums
- Dataset
- Main, edge(quad) and Dataset-oriented Dataset API
- DatasetMapReduce
- Immutable edge processing methods
- DatasetCompare
- Main, edge(quad) and Dataset-oriented Dataset API
- DatasetListQuadParts
- Set of methods for listing distinct Terms being used on a given position of dataset quads.
Table of Contents
- $graphIdx : SplObjectStorage
- $indexed : bool
- $objectIdx : SplObjectStorage
- $predicateIdx : SplObjectStorage
- $quads : SplObjectStorage
- $subjectIdx : SplObjectStorage
- __construct() : mixed
- __toString() : string
- add() : void
- Adds quad(s) to the dataset.
- any() : bool
- copy() : Dataset
- Creates a copy of the dataset.
- copyExcept() : Dataset
- Creates a copy of the dataset.
- count() : int
- current() : Quad
- Returns the current quad.
- delete() : Dataset
- In-place removes quads from the dataset.
- deleteExcept() : Dataset
- In-place removes quads from the dataset.
- equals() : bool
- every() : bool
- forEach() : void
- Iterates trough all quads replacing them with a callback result.
- key() : mixed
- listGraphs() : TermIterator
- listObjects() : TermIterator
- listPredicates() : TermIterator
- listSubjects() : TermIterator
- map() : Dataset
- next() : void
- none() : bool
- offsetExists() : bool
- Checks if a given offset exists.
- offsetGet() : Quad
- 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.
- reduce() : mixed
- rewind() : void
- union() : Dataset
- Returns a new dataset being a union of the current one and the $other one.
- valid() : bool
- xor() : Dataset
- Returns a dataset being a symmetric difference of the current dataset and the $other one.
- checkIteratorEnd() : void
- exists() : bool
- findByIndices() : Generator<string|int, Quad>
- findMatchingQuads() : Generator<string|int, Quad>
- findNotMatchingQuads() : Generator<string|int, Quad>
- get() : Quad
- index() : void
- listQuadElement() : TermIterator
- set() : void
- unindex() : void
- unset() : void
Properties
$graphIdx
private
SplObjectStorage
$graphIdx
$indexed
private
bool
$indexed
$objectIdx
private
SplObjectStorage
$objectIdx
$predicateIdx
private
SplObjectStorage
$predicateIdx
$quads
private
SplObjectStorage
$quads
$subjectIdx
private
SplObjectStorage
$subjectIdx
Methods
__construct()
public
__construct([bool $indexed = true ]) : mixed
Parameters
- $indexed : bool = true
Return values
mixed —__toString()
public
__toString() : string
Return values
string —add()
Adds quad(s) to the dataset.
public
add(Quad|QuadIterator $quads) : void
Parameters
- $quads : Quad|QuadIterator
Return values
void —any()
public
any(QuadCompare|QuadIterator|callable $filter) : bool
Parameters
- $filter : QuadCompare|QuadIterator|callable
Return values
bool —copy()
Creates a copy of the dataset.
public
copy([QuadCompare|QuadIterator|callable|null $filter = null ][, bool $indexed = false ]) : Dataset
If $filter is provided, the copy contains only quads matching the $filter.
$filter can be specified as:
- An object implementing the \rdfInterface\QuadCompare interface (e.g. a single Quad)
- An object implementing the \rdfInterface\QuadIterator interface (e.g. another Dataset)
- A callable with signature
fn(\rdfInterface\Quad, \rdfInterface\Dataset): 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 : QuadCompare|QuadIterator|callable|null = null
- $indexed : bool = false
Return values
Dataset —copyExcept()
Creates a copy of the dataset.
public
copyExcept(QuadCompare|QuadIterator|callable|null $filter[, bool $indexed = false ]) : Dataset
If $filter is provided, the copy contains only quads not matching the $filter.
$filter can be specified as:
- An object implementing the \rdfInterface\QuadCompare interface (e.g. a single Quad)
- An object implementing the \rdfInterface\QuadIterator interface (e.g. another Dataset)
- A callable with signature
fn(\rdfInterface\Quad, \rdfInterface\Dataset): bool
All quads for which the callable returns false are copied.
An in-place equivalent of a call using the $filter is the delete() method.
Parameters
- $filter : QuadCompare|QuadIterator|callable|null
- $indexed : bool = false
Return values
Dataset —count()
public
count() : int
Return values
int —current()
Returns the current quad.
public
current() : Quad
No particular order of quad traversal is guaranteed.
It must not require calling rewind() for a call to current() to return a quad after the dataset has been created and at least one quad has been added to it.
If valid() returns false, this method must return null (it must not throw an exception).
Return values
Quad —| null
delete()
In-place removes quads from the dataset.
public
delete(QuadCompare|QuadIterator|callable $filter[, bool $indexed = false ]) : Dataset
All quads matching the $filter parameter are removed.
$filter can be specified as:
- An object implementing the \rdfInterface\QuadCompare interface (e.g. a single Quad)
- An object implementing the \rdfInterface\QuadIterator interface (e.g. another Dataset)
- A callable with signature
fn(\rdfInterface\Quad, \rdfInterface\Dataset): bool
All quads for which the callable returns true are removed.
An immputable equivalent is the copyExcept($filter) method.
Parameters
- $filter : QuadCompare|QuadIterator|callable
- $indexed : bool = false
Return values
Dataset —a dataset containing removed quads.
deleteExcept()
In-place removes quads from the dataset.
public
deleteExcept(QuadCompare|QuadIterator|callable $filter[, bool $indexed = false ]) : Dataset
All quads but ones matching the $filter parameter are removed.
$filter can be specified as:
- An object implementing the \rdfInterface\QuadCompare interface (e.g. a single Quad)
- An object implementing the \rdfInterface\QuadIterator interface (e.g. another Dataset)
- A callable with signature
fn(\rdfInterface\Quad, \rdfInterface\Dataset): bool
All quads for which the callable returns false are removed.
An immputable equivalent is the copy($filter) method.
Parameters
- $filter : QuadCompare|QuadIterator|callable
- $indexed : bool = false
Return values
Dataset —a dataset containing removed quads.
equals()
public
equals(Dataset $other) : bool
Parameters
- $other : Dataset
Return values
bool —every()
public
every(QuadCompare|QuadIterator|callable $filter) : bool
Parameters
- $filter : QuadCompare|QuadIterator|callable
Return values
bool —forEach()
Iterates trough all quads replacing them with a callback result.
public
forEach(callable $fn[, QuadCompare|QuadIterator|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 : QuadCompare|QuadIterator|callable = null
Return values
void —key()
public
key() : mixed
Return values
mixed —listGraphs()
public
listGraphs([QuadCompare|QuadIterator|callable|null $filter = null ]) : TermIterator
Parameters
- $filter : QuadCompare|QuadIterator|callable|null = null
Return values
TermIterator —listObjects()
public
listObjects([QuadCompare|QuadIterator|callable|null $filter = null ]) : TermIterator
Parameters
- $filter : QuadCompare|QuadIterator|callable|null = null
Return values
TermIterator —listPredicates()
public
listPredicates([QuadCompare|QuadIterator|callable|null $filter = null ]) : TermIterator
Parameters
- $filter : QuadCompare|QuadIterator|callable|null = null
Return values
TermIterator —listSubjects()
public
listSubjects([QuadCompare|QuadIterator|callable|null $filter = null ]) : TermIterator
Parameters
- $filter : QuadCompare|QuadIterator|callable|null = null
Return values
TermIterator —map()
public
map(callable $fn[, QuadCompare|QuadIterator|callable $filter = null ][, bool $indexed = false ]) : Dataset
Parameters
- $fn : callable
-
function applied to every quad with signature
fn(quad, dataset)
- $filter : QuadCompare|QuadIterator|callable = null
- $indexed : bool = false
Return values
Dataset —next()
public
next() : void
Return values
void —none()
public
none(QuadCompare|QuadIterator|callable $filter) : bool
Parameters
- $filter : QuadCompare|QuadIterator|callable
Return values
bool —offsetExists()
Checks if a given offset exists.
public
offsetExists(QuadCompare|callable $offset) : bool
Parameters
- $offset : QuadCompare|callable
Return values
bool —offsetGet()
Returns a quad matching the $offset.
public
offsetGet(QuadCompare|callable $offset) : Quad
Parameters
- $offset : QuadCompare|callable
Return values
Quad —offsetSet()
Assigns a new value to the quad matching the $offset.
public
offsetSet(QuadCompare|callable|null $offset, Quad $value) : void
Parameters
- $offset : QuadCompare|callable|null
- $value : Quad
Return values
void —offsetUnset()
Removes a quad matching the $offset.
public
offsetUnset(QuadCompare|callable $offset) : void
Parameters
- $offset : QuadCompare|callable
Return values
void —reduce()
public
reduce(callable $fn[, mixed $initialValue = null ][, QuadCompare|QuadIterator|callable $filter = null ]) : mixed
Parameters
- $fn : callable
-
aggregate function with signature
fn(accumulator, quad, dataset)
applied on each quad and returns last callback result - $initialValue : mixed = null
- $filter : QuadCompare|QuadIterator|callable = null
Return values
mixed —rewind()
public
rewind() : void
Return values
void —union()
Returns a new dataset being a union of the current one and the $other one.
public
union(Quad|QuadIterator $other[, bool $indexed = false ]) : Dataset
For in-place union use add().
Parameters
- $other : Quad|QuadIterator
- $indexed : bool = false
Return values
Dataset —valid()
public
valid() : bool
Return values
bool —xor()
Returns a dataset being a symmetric difference of the current dataset and the $other one.
public
xor(Quad|QuadIterator $other[, bool $indexed = false ]) : Dataset
There is no in-place equivalent.
Parameters
- $other : Quad|QuadIterator
- $indexed : bool = false
Return values
Dataset —checkIteratorEnd()
private
checkIteratorEnd(Iterator<string|int, Quad> $i) : void
Parameters
- $i : Iterator<string|int, Quad>
Tags
Return values
void —exists()
private
exists(QuadCompare|callable $offset) : bool
Parameters
- $offset : QuadCompare|callable
Return values
bool —findByIndices()
private
findByIndices(QuadCompare $template[, bool $match = true ]) : Generator<string|int, Quad>
Parameters
- $template : QuadCompare
- $match : bool = true
Return values
Generator<string|int, Quad> —findMatchingQuads()
private
findMatchingQuads(QuadCompare|QuadIterator|callable|null $offset) : Generator<string|int, Quad>
Parameters
- $offset : QuadCompare|QuadIterator|callable|null
Tags
Return values
Generator<string|int, Quad> —findNotMatchingQuads()
private
findNotMatchingQuads(QuadCompare|QuadIterator|callable|null $offset) : Generator<string|int, Quad>
Parameters
- $offset : QuadCompare|QuadIterator|callable|null
Return values
Generator<string|int, Quad> —get()
private
get(QuadCompare|callable $offset) : Quad
Parameters
- $offset : QuadCompare|callable
Return values
Quad —index()
private
index(Quad $quad) : void
Parameters
- $quad : Quad
Return values
void —listQuadElement()
private
listQuadElement(QuadCompare|QuadIterator|callable|null $filter, string $elementFn) : TermIterator
Parameters
- $filter : QuadCompare|QuadIterator|callable|null
- $elementFn : string
Return values
TermIterator —set()
private
set(QuadCompare|callable $offset, Quad $value) : void
Parameters
- $offset : QuadCompare|callable
- $value : Quad
Return values
void —unindex()
private
unindex(Quad $quad) : void
Parameters
- $quad : Quad
Return values
void —unset()
private
unset(QuadCompare|callable $offset) : void
Parameters
- $offset : QuadCompare|callable