示例#1
0
 function testIsEqualToIgnoresNamespaceDifferences()
 {
     $s = 'http://example.com/people/bloggs-joe';
     $rdfType = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type';
     $graph1 = new ExtendedGraph();
     $graph1->add_resource_triple($s, $rdfType, 'http://xmlns.com/foaf/0.1/Person');
     $graph2 = new ExtendedGraph();
     $graph2->set_namespace_mapping('foaf', self::ONT_foaf);
     $graph2->add_resource_triple($s, $rdfType, 'http://xmlns.com/foaf/0.1/Person');
     $graph3 = new ExtendedGraph();
     $graph3->set_namespace_mapping('FAF', self::ONT_foaf);
     $graph3->add_resource_triple($s, $rdfType, 'http://xmlns.com/foaf/0.1/Person');
     $this->assertTrue($graph1->is_equal_to($graph2), 'graph1 should equal graph2');
     $this->assertTrue($graph2->is_equal_to($graph1), 'graph2 should equal graph1');
     $this->assertTrue($graph2->is_equal_to($graph3), 'graph2 should equal graph3');
     $this->assertTrue($graph3->is_equal_to($graph2), 'graph3 should equal graph2');
 }