[redland-dev] serializing

Pablo pandres at gmail.com
Tue Aug 2 00:07:20 BST 2005


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.


More information about the redland-dev mailing list