Home

Awesome

rdfInterface2easyRdf

Latest Stable Version Build status Coverage Status License

A library providing methods for converting between EasyRdf (original library, still maintained fork) and rdfInterface objects (in both directions).

Helpful especially when you have too much EasyRdf code to port it but you would like to develop new code using the rdfInterface ecosystem.

Installation

Usage

rdfInterface to EasyRdf

Conversion in this direction is straightforward:

EasyRdf to rdfInterface

Conversion in this direction might get tricky. Important remarks:

A sample EasyRdf graph and terms factory used in examples below:

$graph = new EasyRdf\Graph();
$blank = $graph->resource('_:blank');
$res1  = $graph->resource('http://foo');
$res2  = $graph->resource('http://baz');
$res1->add('http://resource', $res2);
$lit1  = new EasyRdf\Literal('literal', 'en');
$lit2  = new EasyRdf\Literal(1, null, 'http://www.w3.org/2001/XMLSchema#integer');
$res1->addLiteral('http://langLiteral', $lit1);
$res1->addLiteral('http://intLiteral', $lit2);
$res3  = $graph->resource('http://marry');
$res3->addLiteral('http://langLiteral', $lit1);

$df = new quickRdf\DataFactory();