function test_add_json_appends_new_triples() { $g = new SimpleGraph(); $g->add_resource_triple('http://example.org/subj', 'http://example.org/pred1', 'http://example.org/obj1'); $g->add_json($this->_single_triple_json); $this->assertEquals(2, count($g->get_triples())); $index = $g->get_index(); $this->assertEquals("http://example.org/obj1", $index['http://example.org/subj']['http://example.org/pred1'][0]['value']); $this->assertEquals("foo", $index['http://example.org/subj']['http://example.org/pred'][0]['value']); $this->assertEquals("literal", $index['http://example.org/subj']['http://example.org/pred'][0]['type']); }