EasyRdf API Documentation
Class

EasyRdf_Parser_JsonLd

class EasyRdf_Parser_JsonLd extends EasyRdf_Parser

Class to parse JSON-LD to an EasyRdf_Graph

Methods

integer parse(object $graph, string $data, string $format, string $baseUri)

Parse a JSON-LD document into an EasyRdf_Graph

Details

at line 61
public integer parse(object $graph, string $data, string $format, string $baseUri)

Parse a JSON-LD document into an EasyRdf_Graph

Attention: Since JSON-LD supports datasets, a document may contain multiple graphs and not just one. This parser returns only the default graph. An alternative would be to merge all graphs.

Parameters

object $graph EasyRdf_Graph $graph the graph to load the data into
string $data the RDF document data
string $format the format of the input data
string $baseUri the base URI of the data being parsed

Return Value

integer The number of triples added to the graph