checkParseParams($graph, $data, $format, $baseUri); if ($format != 'php') { throw new EasyRdf_Exception( "EasyRdf_Parser_RdfPhp does not support: $format" ); } foreach ($data as $subject => $properties) { if (substr($subject, 0, 2) === '_:') { $subject = $this->remapBnode($subject); } elseif (preg_match('/^\w+$/', $subject)) { # Cope with invalid RDF/JSON serialisations that # put the node name in, without the _: prefix # (such as net.fortytwo.sesametools.rdfjson) $subject = $this->remapBnode($subject); } foreach ($properties as $property => $objects) { foreach ($objects as $object) { if ($object['type'] === 'bnode') { $object['value'] = $this->remapBnode($object['value']); } $this->addTriple($subject, $property, $object); } } } return $this->tripleCount; } }