[redland-dev] serializing

Victor Lindesay victor at schemaweb.info
Tue Aug 2 08:20:13 BST 2005


Why are you bothered what the RDF/XML looks like? Both serialisations
represent the same information and any RDF tool will happily consume
either version.

> -----Original Message-----
> From: redland-dev-bounces at lists.librdf.org 
> [mailto:redland-dev-bounces at lists.librdf.org] On Behalf Of Pablo
> Sent: 02 August 2005 00:07
> To: redland-dev at lists.librdf.org
> Subject: [redland-dev] serializing
> 
> 
> Hello.
> I'm reading and modifying a file that looks like this:
> 
> <?xml version="1.0"?>
> <RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
> 	xmlns:SEARCH="http://www.search.net/rdf#">
> 
> <RDF:Description RDF:about="http://www.search.net/mammals">
> 	<SEARCH:name>Mammals</SEARCH:name>
> </RDF:Description>
> <RDF:Description RDF:about="http://www.search.net/mammals/lion" >
> 	<SEARCH:name>Lion</SEARCH:name>
> </RDF:Description>
> <RDF:Description 
> RDF:about="http://www.search.net/mammals/hippopotamus" >
> 	<SEARCH:name>Hippopotamus</SEARCH:name>
> </RDF:Description>
> 
> <RDF:Seq RDF:about="http://www.search.net/main-search">
> 	<RDF:li>
> 		<RDF:Seq RDF:about="http://www.search.net/mammals">
> 
> 	<RDF:li>http://www.search.net/mammals/lion</RDF:li>
> 	<RDF:li>http://www.search.net/mammals/hippopotamus</RDF:li>
> 
> 		</RDF:Seq>
> 	</RDF:li>
> </RDF:Seq>
> 
> After modifying and serializing I get something like this:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
>   <rdf:Description rdf:about="http://www.search.net/mammals">
>     <ns0:name 
> xmlns:ns0="http://www.search.net/rdf#">Mammals</ns0:name>
>   </rdf:Description>
>   <rdf:Description rdf:about="http://www.search.net/mammals/lion">
>     <ns0:name xmlns:ns0="http://www.search.net/rdf#">Lion</ns0:name>
>   </rdf:Description>
>   <rdf:Description 
> rdf:about="http://www.search.net/mammals/hippopotamus">
>     <ns0:name 
> xmlns:ns0="http://www.search.net/rdf#">Hippopotamus</ns0:name>
>   </rdf:Description>
>   <rdf:Description rdf:about="http://www.search.net/main-search">
>     <rdf:type 
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq"/>
>   </rdf:Description>
>   <rdf:Description rdf:about="http://www.search.net/mammals">
>     <rdf:type 
> rdf:resource="http://www.w3.org/1999/02/22-rdf-syntax-ns#Seq"/>
>   </rdf:Description>
>   <rdf:Description rdf:about="http://www.search.net/mammals">
>     <rdf:_1>http://www.search.net/mammals/lion</rdf:_1>
>   </rdf:Description>
>   <rdf:Description rdf:about="http://www.search.net/mammals">
>     <rdf:_2>http://www.search.net/mammals/hippopotamus</rdf:_2>
>   </rdf:Description>
>   <rdf:Description rdf:about="http://www.search.net/main-search">
>     <rdf:_1 rdf:resource="http://www.search.net/mammals"/>
>   </rdf:Description>
>   <rdf:Description rdf:about="http://www.search.net/mammals/horse">
>     <ns0:name xmlns:ns0="http://www.search.net/rdf#">horse</ns0:name>
>   </rdf:Description>
>   <rdf:Description rdf:about="http://www.search.net/mammals">
>     <rdf:_9>http://www.search.net/mammals/horse</rdf:_9>
>   </rdf:Description>
> </rdf:RDF>
> 
> The question is, can I get something more like the first file, or
> choose the serialization syntax in some way?
> 
> Thanks.
> pablo.
> _______________________________________________
> redland-dev mailing list
> redland-dev at lists.librdf.org
> http://lists.gnomehack.com/mailman/listinfo/redland-dev
> 
> 



More information about the redland-dev mailing list