public function checkTestCase($filename, $successful = true) { $this->graphA->parseFile(fixturePath("isomorphic/{$filename}-a.nt")); $this->graphB->parseFile(fixturePath("isomorphic/{$filename}-b.nt")); if ($successful) { self::assertTrue(EasyRdf_Isomorphic::isomorphic($this->graphA, $this->graphB)); } else { self::assertFalse(EasyRdf_Isomorphic::isomorphic($this->graphA, $this->graphB)); } }
public function testParseWebId() { $graph = new EasyRdf_Graph(); $graph->parseFile(fixturePath('webid.ttl'), 'turtle'); $me = $graph->resource('http://www.example.com/myfoaf#me'); $modulus = $me->get('cert:key')->get('cert:modulus'); $this->assertStringEquals('CB24ED85D64D794B69C701C186ACC059501E856000F661C93204D8380E07191C' . '5C8B368D2AC32A428ACB970398664368DC2A867320220F755E99CA2EECDAE62E' . '8D15FB58E1B76AE59CB7ACE8838394D59E7250B449176E51A494951A1C366C62' . '17D8768D682DDE78DD4D55E613F8839CF275D4C8403743E7862601F3C49A6366' . 'E12BB8F498262C3C77DE19BCE40B32F89AE62C3780F5B6275BE337E2B3153AE2' . 'BA72A9975AE71AB724649497066B660FCF774B7543D980952D2E8586200EDA41' . '58B014E75465D91ECF93EFC7AC170C11FC7246FC6DED79C37780000AC4E079F6' . '71FD4F207AD770809E0E2D7B0EF5493BEFE73544D8E1BE3DDDB52455C61391A1', $modulus); $this->assertInternalType('string', $modulus->getValue()); $this->assertSame(NULL, $modulus->getLang()); $this->assertSame('xsd:hexBinary', $modulus->getDatatype()); }
/** * Helper function: read fixture data from file * * @param string $name fixture file name * @return string Fixture data */ function readFixture($name) { return file_get_contents(fixturePath($name)); }
function fixture($path) { return file_get_contents(fixturePath($path)); }
public function testParseFileRelativeUri() { $graph = new EasyRdf_Graph(); $count = $graph->parseFile(fixturePath('foaf.rdf')); $this->assertSame(14, $count); $doc = $graph->get('foaf:PersonalProfileDocument', '^rdf:type'); $this->assertClass('EasyRdf_Resource', $doc); $this->assertRegExp('|^file://.+/fixtures/foaf\\.rdf$|', $doc->getUri()); }