Beispiel #1
0
 public function testToTripodViewArray()
 {
     $expected = array("_id" => array("r" => "http://example.com/things/1", "c" => "http://example.com/"), "value" => array("_impactIndex" => array("http://example.com/things/1", "http://example.com/things/2"), "_graphs" => array(array("_id" => array("r" => "http://example.com/things/1", "c" => "http://example.com/"), "dct:subject" => array("u" => "http://talisaspire.com/disciplines/physics"), "rdf:type" => array("u" => "bibo:Book"), "bibo:isbn13" => array("l" => "9211234567890")), array("_id" => array("r" => "http://example.com/things/2", "c" => "http://example.com/"), "dct:subject" => array("u" => "http://talisaspire.com/disciplines/maths"), "rdf:type" => array("u" => "acorn:Work")))));
     // create a graph adding properties to it
     $g = new \Tripod\Mongo\MongoGraph();
     $g->add_resource_triple("http://example.com/things/1", $g->qname_to_uri("dct:subject"), "http://talisaspire.com/disciplines/physics");
     $g->add_resource_triple("http://example.com/things/1", $g->qname_to_uri("rdf:type"), "http://purl.org/ontology/bibo/Book");
     $g->add_literal_triple("http://example.com/things/1", $g->qname_to_uri("bibo:isbn13"), "9211234567890");
     $g->add_resource_triple("http://example.com/things/2", $g->qname_to_uri("dct:subject"), "http://talisaspire.com/disciplines/maths");
     $g->add_resource_triple("http://example.com/things/2", $g->qname_to_uri("rdf:type"), "http://talisaspire.com/schema#Work");
     $actual = $g->to_tripod_view_array("http://example.com/things/1", "http://example.com/");
     $this->assertEquals($expected, $actual);
 }