Example #1
0
 /**
  * Tests the serialization of nodes
  */
 public function testSerializeNode()
 {
     $expected = Processor::loadDocument('{
             "@id": "http://example.com/node/1",
             "@type": [ "http://vocab.com/type/node" ],
             "http://vocab.com/name": [ { "@value": "1" } ],
             "http://vocab.com/link": [ { "@id": "http://example.com/node/2" } ],
             "http://vocab.com/contains": [ { "@id": "_:b0" } ]
         }');
     $node1 = $this->graph->getNode('http://example.com/node/1');
     $this->assertEquals($expected, $node1->toJsonLd(), 'Serialize node 1');
 }