File: test.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 (17 lines) | stat: -rw-r--r-- 472 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

$options = getopt('l');
if (isset($options['l'])) {
  // l: Local loading, for build testing.
  include_once __DIR__ . '/../../lib/autoload.php';
}
else {
  // Usual loading, e.g. at autopkgtest run.
  include_once 'EasyRdf/autoload.php';
}
$url = 'http://localhost:10101/foaf.rdf';
#$url = 'http://njh.me/foaf.rdf';
$foaf = new \EasyRdf\Graph($url);
$foaf->load();
$author = $foaf->primaryTopic();
echo 'Main author name is: ', $author->get('foaf:name'), PHP_EOL;