public function testExpandWithoutDefault() { EasyRdf_Namespace::setDefault(null); $this->assertSame('unknown', EasyRdf_Namespace::expand('unknown')); }
<?php /** * Example of reading Open Graph Protocol properties * * @package EasyRdf * @copyright Copyright (c) 2012-2013 Nicholas J Humfrey * @license http://unlicense.org/ */ set_include_path(get_include_path() . PATH_SEPARATOR . '../lib/'); require_once "EasyRdf.php"; EasyRdf_Namespace::setDefault('dc11'); ?> <html> <head> <title>Open Graph Protocol example</title> </head> <body> <?php $doc = EasyRdf_Graph::newAndLoad('http://www.rottentomatoes.com/m/10011268-oceans/'); ?> <p> Title: <?php echo $doc->title; ?> <br /> Creator: <?php echo $doc->creator; ?>
public function testMagicUnset() { $this->setupTestGraph(); EasyRdf_Namespace::setDefault('rdf'); $this->resource->add('rdf:testMagicUnset', 'testMagicUnset'); unset($this->resource->testMagicUnset); $this->assertStringEquals(null, $this->resource->get('rdf:testMagicUnset')); }
public function testMagicUnset() { EasyRdf_Namespace::setDefault('rdf'); $this->graph->add($this->graph->getUri(), 'rdf:test', 'testMagicUnset'); unset($this->graph->test); $this->assertStringEquals(null, $this->graph->get($this->graph->getUri(), 'rdf:test')); }