TrigSerializer
in package
implements
SerializerInterface
uses
TmpStreamSerializerTrait
Serializes to TriG and Turtle formats
Tags
Table of Contents
Interfaces
Constants
- MODE_TRIG = 2
- MODE_TURTLE = 1
Properties
Methods
- __construct() : mixed
- serialize() : string
- serializeStream() : void
Constants
MODE_TRIG
public
mixed
MODE_TRIG
= 2
MODE_TURTLE
public
mixed
MODE_TURTLE
= 1
Properties
$mode
private
int
$mode
$strict
private
bool
$strict
Methods
__construct()
public
__construct([int $mode = self::MODE_TRIG ][, bool $strict = false ]) : mixed
Parameters
- $mode : int = self::MODE_TRIG
-
serialization mode
TrigSerializer::MODE_TRIG
orTrigSerializer::MODE_TURTLE
. The exact behavior depends on the$strict
parameter. - $strict : bool = false
-
if
$mode
equalTrigSerializer::MODE_TURTLE
and a triple with graph not being a default graph is encountered and$strict
equalsfalse
, then the graph URI is just skipped. Otherwise an exception is rised.
serialize()
public
serialize(Traversable<string|int, QuadInterface>|array<string|int, QuadInterface> $graph[, RdfNamespaceInterface|null $nmsp = null ]) : string
Parameters
- $graph : Traversable<string|int, QuadInterface>|array<string|int, QuadInterface>
- $nmsp : RdfNamespaceInterface|null = null
Tags
Return values
stringserializeStream()
public
serializeStream(resource|StreamInterface $output, Traversable<string|int, QuadInterface>|array<string|int, QuadInterface> $graph[, RdfNamespaceInterface|null $nmsp = null ]) : void
Parameters
- $output : resource|StreamInterface
- $graph : Traversable<string|int, QuadInterface>|array<string|int, QuadInterface>
- $nmsp : RdfNamespaceInterface|null = null