Am 05.12.2006 um 01:39 schrieb Reed Hedges:

>
> Hi Karsten, the HTTP "hypervos" extension in s4 has a mode where it  
> can
> emit a description of the Vobjects in RDF (instead of a simple HTML
> listing) for objects that aren't actually meant to be served as an XML
> document by hypervos.
>
> I don't know if it's correct or not (probably not, I bascially guessed
> at stuff, and I think I see some XML sytax errors even), I added it  
> as a
> starting point  for someone who knows much more about RDF than I  
> do.  We
> should probebly improve it and perhaps make it compatible with your
> software (since your use of RDF is, I assume, much richer and  
> generally
> better than mine!).
>
Now that you mention it, I remember seeing this in the source code.
I'll have another look at it, maybe I get the time to tinker with it  
a bit.

> The code is at libs/vos/extensions/http/httpserver.cc in the
> describeVobject_RDF() function.  It only describes one Vobject, not a
> whole tree of them. Like this:
>
> <rdf:RDF xmlns:rdf="..." xmlns:rdfs="..." xmlns:vos="..fake schema..."
> xmlns:xsd="...." xml:base="http://interreality.org/otd/";>
>    <rdf:Description rdf:about="vip://host/obj">
>        <rdf:type>http://interreality.org/otd/objectType</rdf:type>
>           <!-- I  guess the idea was that all object types would  
> define
>                their required children in the
> http://interreality.org/otd/objectType or the
> http://interreality.org/otd/ namespace -->
>        <childContextualName1 rdf:resource="vip://host/childObj" />
>        <childContextualName2 rdfs:datatype="string">property object
> value</childContextualName2>
>     </rdf:Description>
> </rdf:RDF>
>

This basically looks good, though you should not use xml:base this  
way in RDF. Typically, you have qnames for all RDF properties, and  
only use the base to resolve rdf:ID names and relative URIs in  
rdf:about.

Also, I don't use a single xmlns:vos, but several namespaces  
corresponding to the "package names" you have in VOS. For example,  
I'd use xmlns:a3dl="http://interreality.org/otd/a3dl/"; as a sort of  
"include", and then write the a3dl:position contextual name as  
<a3dl:position rdf:resource="..."/> element.

I like the concise way you handle VOS properties, but since  
property:Property is just another metatype, it could well be mixed  
with other metatypes that require children; you cannot do that with  
RDF labels, unfortunately. So instead of

<childContextualName2 rdfs:datatype="string">property object value</ 
childContextualName2>

I model property Vobjects as RDF resources of their own, which also  
preserves their VOS URI.
Serializing this in a nested way, you get for example:

<rdf:Description rdf:about="vip://host/obj">
        <rdf:type rdf:resource="http://interreality.org/otd/a3dl/Cone"/>
        <a3dl:position>
                <rdf:Description rdf:about="vip://host/childProperty">
                        <rdf:value>1 2 3</rdf:value>
                        <vos:datatype>list: float</vos:datatype>
                        <vos:length>5</vos:length>
                </rdf:Description>
        <a3dl:position>
</rdf:Description>

Of course, you can abbreviate this even more in RDF/XML if you want:

<rdf:Description rdf:about="vip://host/obj">
        <rdf:type rdf:resource="http://interreality.org/otd/a3dl/Cone"/>
        <a3dl:position>
                <rdf:Description rdf:about="vip://host/childProperty"
                        rdf:value="1 2 3" vos:datatype="list: float" 
vos:length="5"/>
        </a3dl:position>
</rdf:Description>

Means the same :-)

Actually, to preserve ordering, I use two RDF properties with the  
same rdf:about target:

<rdf:Description rdf:about="vip://host/obj">
        <rdf:type rdf:resource="http://interreality.org/otd/a3dl/Cone"/>
        <a3dl:position rdf:resource="vip://host/childProperty"/>
        <rdf:_1 rdf:resource="vip://host/childProperty"/>
</rdf:Description>

and describe vip://host/childProperty separately, instead of  
embedding it as above.

Regards,
Karsten


_______________________________________________
vos-d mailing list
vos-d@interreality.org
http://www.interreality.org/cgi-bin/mailman/listinfo/vos-d

Reply via email to