Hello,

 

Thanks for the report, I finally fixed this issue in 2.0 branch and 2.1
trunk!

 

Best regards,
Jerome
--
 <http://www.restlet.org/> http://www.restlet.org

 <http://twitter.com/#!/jlouvel> http://twitter.com/#!/jlouvel

 

 

-----Message d'origine-----
De : KMN [mailto:[email protected]] 
Envoyé : lundi 16 août 2010 21:05
À : [email protected]
Objet : Hot to add multiple Links (Triple) to a single RDF subject

 

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>
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#>
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>
http://www.example.com/test/object";>

      <__NS1:name>John</__NS1:name>

   </rdf:Description>

   <rdf:Description rdf:about=" <http://www.example.com/test/object>
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#>
http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:__NS1="
<http://www.example.com/test/object#> http://www.example.com/test/object#";>

   <rdf:Description rdf:about=" <http://www.example.com/test/object>
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=2647
539>
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=26475
39

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

Reply via email to