Documentation

NQuads
in package
implements QuadSerializerInterface, QuadParserInterface

NQuads serializes quads to the NQuads format

Tags
author

Markus Lanthaler mail@markus-lanthaler.com

Table of Contents

Interfaces

QuadSerializerInterface
Quad serializer interface
QuadParserInterface
Quad parser interface

Methods

parse()  : array<string|int, Quad>
Parses quads
serialize()  : string
Serializes quads to a string.

Methods

parse()

Parses quads

public parse(mixed $input) : array<string|int, Quad>

This method is heavily based on DigitalBazaar's implementation used in their php-json-ld.

Parameters
$input : mixed

The serialized quads to parse.

Tags
throws
InvalidQuadException

If an invalid quad that can't be parsed is encountered.

Return values
array<string|int, Quad>

An array of extracted quads.

serialize()

Serializes quads to a string.

public serialize(array<string|int, mixed> $quads) : string
Parameters
$quads : array<string|int, mixed>

Array of quads to be serialized.

Return values
string

The serialized quads.


        
On this page

Search results