Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
33 lines (29 sloc)
773 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) 2009-2014 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> |