class Rapper extends Json

Class to parse RDF using the 'rapper' command line tool.

Constants

MINIMUM_RAPPER_VERSION

Properties

protected Graph $graph from Parser
protected $format The format of the document currently being parsed from Parser
protected $baseUri The base URI for the document currently being parsed from Parser
protected $tripleCount from Parser

Methods

remapBnode($name)

Create a new, unique bnode identifier from a source identifier.

from Parser
resetBnodeMap()

Delete the bnode mapping - to be called at the start of a new parse

from Parser
checkParseParams($graph, $data, $format, $baseUri)

Check, cleanup parameters and prepare for parsing

from Parser
parse($graph, $data, $format, $baseUri)

Parse an RDF document into an EasyRdf\Graph

addTriple($resource, $property, $value)

Add a triple to the current graph, and keep count of the number of triples

from Parser
__construct(string $rapperCmd = 'rapper')

Constructor

jsonLastErrorString()

Return the last JSON parser error as a string

from Json
parseJsonTriples($data, $baseUri)

Parse the triple-centric JSON format, as output by libraptor

from Json

Details

in Parser at line 70
protected remapBnode($name)

Create a new, unique bnode identifier from a source identifier.

If the source identifier has previously been seen, the same new bnode identifier is returned.

Parameters

$name

in Parser at line 82
protected resetBnodeMap()

Delete the bnode mapping - to be called at the start of a new parse

in Parser at line 91
protected checkParseParams($graph, $data, $format, $baseUri)

Check, cleanup parameters and prepare for parsing

Parameters

$graph
$data
$format
$baseUri

at line 87
parse($graph, $data, $format, $baseUri)

Parse an RDF document into an EasyRdf\Graph

Parameters

$graph
$data
$format
$baseUri

in Parser at line 148
protected addTriple($resource, $property, $value)

Add a triple to the current graph, and keep count of the number of triples

Parameters

$resource
$property
$value

at line 61
__construct(string $rapperCmd = 'rapper')

Constructor

Parameters

string $rapperCmd Optional path to the rapper command to use.

Exceptions

Exception

in Json at line 67
protected jsonLastErrorString()

Return the last JSON parser error as a string

If json_last_error() is not available a generic message will be returned.

in Json at line 97
protected parseJsonTriples($data, $baseUri)

Parse the triple-centric JSON format, as output by libraptor

http://librdf.org/raptor/api/serializer-json.html

Parameters

$data
$baseUri