Documentation

Util
in package

Provides static factory methods for plug&play parsers/serializers creation.

Tags
author

zozlak

Table of Contents

Methods

getParser()  : ParserInterface
Returns a parser object for a given format or file name (in the latter case the match is based on the file name extension).
getSerializer()  : SerializerInterface
Returns a serializer object for a given format or file name (in the latter case the match is based on the file name extenstion).
parse()  : QuadIteratorInterface
serialize()  : string

Methods

getParser()

Returns a parser object for a given format or file name (in the latter case the match is based on the file name extension).

public static getParser(string $formatOrFilename, DataFactoryInterface $dataFactory[, string|null $baseUri = null ]) : ParserInterface
Parameters
$formatOrFilename : string
$dataFactory : DataFactoryInterface
$baseUri : string|null = null
Return values
ParserInterface

getSerializer()

Returns a serializer object for a given format or file name (in the latter case the match is based on the file name extenstion).

public static getSerializer(string $formatOrFilename) : SerializerInterface

Use a special value of jsonld-stream to get the JsonLdStreamSerializer serializer.

Parameters
$formatOrFilename : string
Return values
SerializerInterface

parse()

public static parse(mixed $input, DataFactoryInterface $dataFactory[, string $format = null ][, string $baseUri = null ]) : QuadIteratorInterface
Parameters
$input : mixed
$dataFactory : DataFactoryInterface
$format : string = null

Allows to explicitly specify format. Required if the $input is a non-seekable stream.

$baseUri : string = null

Allows to explicitly specify the baseUri if it's needed and can't be guesed from the $input.

Tags
throws
RdfIoException
Return values
QuadIteratorInterface

serialize()

public static serialize(Traversable<string|int, QuadInterface>|array<string|int, QuadInterface$data, string $format[, mixed $output = null ][, RdfNamespaceInterface|null $nmsp = null ]) : string
Parameters
$data : Traversable<string|int, QuadInterface>|array<string|int, QuadInterface>
$format : string

A mime type, file extension HTTP Accept header value or file name indicating the output format.

$output : mixed = null
$nmsp : RdfNamespaceInterface|null = null
Tags
throws
RdfIoException
Return values
string

| null


        
On this page

Search results