JsonLdParser
in package
implements
ParserInterface, QuadIteratorInterface
uses
CreateBlankNodeTrait
Thin wrapper providing RdfInterface\Parser API for JSON-LD the parser provided by the ml/json-ld library.
Doesn't provide stream parsing because the ml/json-ld library doesn't so be carefull when parsing large inputs.
Tags
Table of Contents
Interfaces
Properties
- $baseUri : string
- $blankMap : mixed
- $curQuad : QuadInterface|null
- $dataFactory : DataFactoryInterface
- $quads : array<int, Quad>
Methods
- __construct() : mixed
- createBlankNode() : BlankNodeInterface
- current() : QuadInterface|null
- key() : int|null
- next() : void
- parse() : QuadIteratorInterface
- parseStream() : QuadIteratorInterface
- rewind() : void
- setBaseUri() : void
- valid() : bool
Properties
$baseUri
private
string
$baseUri
= ''
$blankMap
private
static mixed
$blankMap
= []
$curQuad
private
QuadInterface|null
$curQuad
= null
$dataFactory
private
DataFactoryInterface
$dataFactory
$quads
private
array<int, Quad>
$quads
Methods
__construct()
public
__construct(DataFactoryInterface $dataFactory[, string|null $baseUri = null ]) : mixed
Parameters
- $dataFactory : DataFactoryInterface
-
factory to be used to generate RDF terms.
- $baseUri : string|null = null
createBlankNode()
public
createBlankNode(string $iri) : BlankNodeInterface
Parameters
- $iri : string
Return values
BlankNodeInterfacecurrent()
public
current() : QuadInterface|null
Return values
QuadInterface|nullkey()
public
key() : int|null
Return values
int|nullnext()
public
next() : void
parse()
public
parse(string $input[, string $baseUri = '' ]) : QuadIteratorInterface
Parameters
- $input : string
- $baseUri : string = ''
-
allows to specify the base URI of the parsed document so a parser can correctly determine which blank nodes belong to the same document (see also the
BLANK_NODES_PRESERVE
constant)
Return values
QuadIteratorInterfaceparseStream()
public
parseStream(resource|StreamInterface $input[, string $baseUri = '' ]) : QuadIteratorInterface
Parameters
- $input : resource|StreamInterface
- $baseUri : string = ''
-
allows to specify the base URI of the parsed document so a parser can correctly determine which blank nodes belong to the same document (see also the
BLANK_NODES_PRESERVE
constant)
Return values
QuadIteratorInterfacerewind()
public
rewind() : void
setBaseUri()
public
setBaseUri(string|null $baseUri) : void
Parameters
- $baseUri : string|null
valid()
public
valid() : bool