Can I create a new Blank node with a rdf:about property #172

hydrarulz opened this Issue Feb 27, 2014 · 3 comments


None yet
3 participants

Hello I am currently building an API that responds with an RDF.

I have multiple nodes of the same type so I am using newBNode so the properties I add to each of them don't get collected in the same resource.

The problem I face is that I am trying to create a new blank node but I can't specify the rdf:about property of the created node. I validated the RDF of what I am trying to achieve against the W3C validator and everything is ok.

This is what I get

     // Other resources here

This is what I need

<rdf:Description rdf:about="">
     // Other resources here

Is this a limitation of EasyRdf?


indeyets commented Feb 27, 2014

can you post some code here?


njh commented Feb 28, 2014

Hello @hydrarulz,

A Blank Node cannot have a URI associated with it in RDF. If it did, it wouldn't be 'blank' anymore.

I think this will do what you want:

    $node = $graph->resource('');
    $node->set('foaf:name', 'Foo');


Thanks, I did not understand the Blank node notion properly.

hydrarulz closed this Mar 2, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment