I have an RDF graph that I create with EasyRDF:
<?xml version="1.0" encoding="utf-8" ?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" <rdf:Description rdf:about="http://the-query-url"> <dc:creator>me</dc:creator> <foaf:primaryTopic rdf:resource="genid1"> </rdf:Description> <rdf:Description rdf:nodeID="genid1"> <!-- stuff --> </rdf:Description> </rdf:RDF>
The above is not correct - the reference to the blank node in foaf:primaryTopic
should be _:genid1
.
When I change that line to
$meta_block->add('foaf:primaryTopic', $graph->resource('_:' . $symbol_block->getBNodeId()));
EasyRdf nests the resources, like this:
<?xml version="1.0" encoding="utf-8" ?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/terms/" xmlns:foaf="http://xmlns.com/foaf/0.1/" <rdf:Description rdf:about="http://the-query-url"> <dc:creator>me</dc:creator> <foaf:primaryTopic> <rdf:Description> <!-- stuff --> </rdf:Description> </foaf:primaryTopic> </rdf:Description> </rdf:RDF>
How do I stop EasyRdf from nesting the nodes?
I want the output to be just like the first example, only with _:genid1
as resource for the foaf:primaryTopic
.