File: doap.php

package info (click to toggle)
php-easyrdf 1.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, sid
  • size: 740 kB
  • sloc: php: 7,831; sh: 30; makefile: 8
file content (44 lines) | stat: -rw-r--r-- 2,442 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
    require_once __DIR__."/vendor/autoload.php";

    // Load some properties from the composer file
    $composer = json_decode(file_get_contents(__DIR__."/composer.json"));

    // Start building up a RDF graph
    $doap = new \EasyRdf\Graph($composer->homepage.'doap.rdf');
    $easyrdf = $doap->resource('#easyrdf', 'doap:Project', 'foaf:Project');
    $easyrdf->addLiteral('doap:name',  'EasyRDF');
    $easyrdf->addLiteral('doap:shortname', 'easyrdf');
    $easyrdf->addLiteral('doap:revision', $composer->version);
    $easyrdf->addLiteral('doap:shortdesc', $composer->description, 'en');
    $easyrdf->addResource('doap:homepage', $composer->homepage);

    $easyrdf->addLiteral('doap:programming-language', 'PHP');
    $easyrdf->addLiteral(
        'doap:description', 'EasyRdf is a PHP library designed to make it easy to consume and produce RDF. '.
        'It was designed for use in mixed teams of experienced and inexperienced RDF developers. '.
        'It is written in Object Oriented PHP and has been tested extensively using PHPUnit.', 'en'
    );
    $easyrdf->addResource('doap:license', 'http://usefulinc.com/doap/licenses/bsd');
    $easyrdf->addResource('doap:download-page', 'http://github.com/easyrdf/easyrdf/downloads');
    $easyrdf->addResource('doap:bug-database', 'http://github.com/easyrdf/easyrdf/issues');
    $easyrdf->addResource('doap:mailing-list', 'http://groups.google.com/group/easyrdf');

    $easyrdf->addResource('doap:category', 'http://dbpedia.org/resource/Resource_Description_Framework');
    $easyrdf->addResource('doap:category', 'http://dbpedia.org/resource/PHP');
    $easyrdf->addResource('doap:category', 'http://www.dbpedialite.org/things/24131#id');
    $easyrdf->addResource('doap:category', 'http://www.dbpedialite.org/things/53847#id');

    $repository = $doap->newBNode('doap:GitRepository');
    $repository->addResource('doap:browse', 'http://github.com/easyrdf/easyrdf');
    $repository->addResource('doap:location', 'git://github.com/easyrdf/easyrdf.git');
    $easyrdf->addResource('doap:repository', $repository);

    $njh = $doap->resource('http://njh.me/', 'foaf:Person');
    $njh->addLiteral('foaf:name', 'Nicholas J Humfrey');
    $njh->addResource('foaf:homepage', 'http://www.aelius.com/njh/');
    $easyrdf->add('doap:maintainer', $njh);
    $easyrdf->add('doap:developer', $njh);
    $easyrdf->add('foaf:maker', $njh);

    print $doap->serialise('rdfxml');