Documentation

Dataset
in package
implements Dataset, DatasetMapReduce, DatasetCompare, DatasetListQuadParts

Description of Graph

Tags
author

zozlak

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

$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

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.

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

next()

public next() : void
Return values
void

offsetExists()

Checks if a given offset exists.

public offsetExists(QuadCompare|callable $offset) : bool
Parameters
$offset : QuadCompare|callable
Return values
bool

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
throws
OutOfBoundsException
Return values
void

findByIndices()

private findByIndices(QuadCompare $template[, bool $match = true ]) : Generator<string|int, Quad>
Parameters
$template : QuadCompare
$match : bool = true
Return values
Generator<string|int, Quad>

index()

private index(Quad $quad) : void
Parameters
$quad : Quad
Return values
void

unindex()

private unindex(Quad $quad) : void
Parameters
$quad : Quad
Return values
void

Search results