Using Restlet 2.0.0 Enterprise edition.

Hi,

I am trying to build a RDF-XML with a single subject and multiple predicates 
attached to
the subject. The code below seems to add each predicate to a smiliar XML node.

Example code:

{
      Graph     graph   = new Graph();

      String    nsURI      = "http://www.example.com/test/object";;

      Reference subject    = new Reference(nsURI);

      Reference name       = new Reference(nsURI+"#name");
      Literal   nameValue  = new Literal("John");


      Link      srcLink   = graph.add(subject, name, nameValue);

      graph.setDefaultLink(srcLink);

      Reference address          = new Reference(nsURI+"#address");
      Literal   addressValue     = new Literal("123 Any Street");

      graph.add((Reference)null, address, addressValue);

      
      return graph.getRdfXmlRepresentation();

}

The code converts it to

<?xml version="1.0" standalone='yes'?>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:__NS1="ht
tp://www.example.com/test/object#">
   <rdf:Description rdf:about="http://www.example.com/test/object";>
      <__NS1:name>John</__NS1:name>
   </rdf:Description>
   <rdf:Description rdf:about="http://www.example.com/test/object";>
      <__NS1:address>123 Any Street</__NS1:address>
   </rdf:Description>
</rdf:RDF>



I want it to look like.

<?xml version="1.0" standalone='yes'?>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; 
xmlns:__NS1="http://www.example.com/test/object#";>
   <rdf:Description rdf:about="http://www.example.com/test/object";>
      <__NS1:name>John</__NS1:name>
      <__NS1:address>123 Any Street</__NS1:address>
   </rdf:Description>
</rdf:RDF>

Thanks
MK

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2647539

Reply via email to