Getting Started

The preferred method of downloading and installing EasyRdf, is to use Composer, a dependency manager that tracks all dependencies of your project.

First, install composer in your project:

curl -s | php

Create a composer.json file in your project root:

    "require": {
        "easyrdf/easyrdf": "*"

Install EasyRdf (and any other dependencies) using:

php composer.phar install

Then to start using EasyRdf in your project, add this to the top of your file:

require 'vendor/autoload.php';

This will load composer's autoloader and make the EasyRdf classes available to your programme.

A full basic example looks like this:

require 'vendor/autoload.php';

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