示例#1
0
 public function testReplaceLiteralTriples()
 {
     $graph = new ExtendedGraph();
     $graph->add_literal_triple("http://test/1", 'http://www.w3.org/2000/01/rdf-schema#label', "value1");
     $graph->add_literal_triple("http://test/1", 'http://www.w3.org/2000/01/rdf-schema#label', "value2");
     $graph->replace_literal_triples("http://test/1", 'http://www.w3.org/2000/01/rdf-schema#label', "value3");
     $this->assertTrue($graph->has_literal_triple("http://test/1", 'http://www.w3.org/2000/01/rdf-schema#label', "value3"));
     $this->assertFalse($graph->has_literal_triple("http://test/1", 'http://www.w3.org/2000/01/rdf-schema#label', "value1"));
     $this->assertFalse($graph->has_literal_triple("http://test/1", 'http://www.w3.org/2000/01/rdf-schema#label', "value2"));
 }
示例#2
0
 /**
  * @param \Tripod\ExtendedGraph $graph
  * @param string $s
  * @param string $p
  * @param string $o
  */
 protected function assertDoesNotHaveLiteralTriple(\Tripod\ExtendedGraph $graph, $s, $p, $o)
 {
     $this->assertFalse($graph->has_literal_triple($s, $p, $o), "Graph should not contain the literal triple: <{$s}> <{$p}> \"{$o}\"");
 }