forked from easyrdf/easyrdf
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.php
More file actions
33 lines (29 loc) · 763 Bytes
/
basic.php
File metadata and controls
33 lines (29 loc) · 763 Bytes
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
<?php
/**
* Basic "Hello World" type example
*
* A new EasyRdf\Graph object is created and then the contents
* of my FOAF profile is loaded from the web. An EasyRdf\Resource for
* the primary topic of the document (me, Nicholas Humfrey) is returned
* and then used to display my name.
*
* @package EasyRdf
* @copyright Copyright (c) Nicholas J Humfrey
* @license http://unlicense.org/
*/
require_once realpath(__DIR__.'/..')."/vendor/autoload.php";
?>
<html>
<head>
<title>Basic FOAF example</title>
</head>
<body>
<?php
$foaf = \EasyRdf\Graph::newAndLoad('http://njh.me/foaf.rdf');
$me = $foaf->primaryTopic();
?>
<p>
My name is: <?= $me->get('foaf:name') ?>
</p>
</body>
</html>