EasyRdf

A PHP library designed to make it easy to consume and produce RDF.

Designed for use in mixed teams of experienced and inexperienced RDF developers. Written in PSR-12 compliant PHP and tested extensively using PHPUnit.

Getting Started »

The latest stable version of EasyRdf is version 1.0.0.

Example

$foaf = new EasyRdf\Graph("http://njh.me/foaf.rdf");
$foaf->load();
$me = $foaf->primaryTopic();
echo "My name is: ".$me->get('foaf:name')."\n";

Requirements

  • PHP 7.1 or newer
  • The pcre extension (enabled by default)
  • The mbstring extension (usually available)

Features

  • Extensive unit tests written using PHPUnit
  • Built-in parsers and serialisers: RDF/JSON, N-Triples, RDF/XML, Turtle
  • Optional parsing support for: ARC2 and rapper
  • Optional support for Zend\Http\Client
  • No required external dependancies upon other libraries (PEAR, Zend, etc...)
  • Complies with the PSR-12 coding style
  • Type mapper - resources of type foaf:Person can be mapped into PHP object of class Foaf\Person
  • Support for visualisation of graphs using GraphViz
  • Composer compatible
  • Comes with a number of examples