Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 997 Bytes

File metadata and controls

51 lines (33 loc) · 997 Bytes

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 https://getcomposer.org/installer | php

Create a composer.json file in your project root:

{
    "require": {
        "sweetrdf/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:

<?php
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:

<?php
require 'vendor/autoload.php';

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