示例#1
0
 public function testGetSubjectsWithPropertyValue()
 {
     $graph = new ExtendedGraph();
     $graph->add_resource_triple('http://some/subject/1', 'http://some/predicate', 'http://value/1');
     $graph->add_resource_triple('http://some/subject/2', 'http://some/predicate', 'http://value/2');
     $graph->add_resource_triple('http://some/subject/3', 'http://some/predicate', 'http://value/3');
     $graph->add_literal_triple('http://some/subject/2-with-literal', 'http://some/predicate', 'http://value/2');
     $subjects = $graph->get_subjects_with_property_value('http://some/predicate', 'http://value/2');
     $this->assertEquals($subjects, array('http://some/subject/2', 'http://some/subject/2-with-literal'), 'should have returned correct subject');
 }