Matthieu Riou wrote:
> I think I really suck at RDF (I'm more a BPEL kind of guy) but here is my
> try at using it for the licenses descriptors format:
> 
> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"; xmlns:dis="
> http://labs.apache.org/discordia";>
>     <rdf:Description rdf:about="mvn://org.apache.velocity/velocity/1.4">
>         
>             
>         </doap:Project>
>         <dis:has_license rdf:about="
> http://www.apache.org/licenses/LICENSE-2.0.txt"/>
>     </rdf:Description>
> </rdf:RDF>
> 
> To the RDF experts, feel free to criticize, propose corrections or insult me
> :)

The above is invalid RDF.

Everything in RDF needs to be translated into triples and the above
cannot be (you have rdf:Description and doap:Project nested without a
relationship in between). Here is what you want to say

 <rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
    xmlns:doap="http://usefulinc.com/ns/doap#";
    xmlns:dis="http://labs.apache.org/discordia";>

   <doap:Project rdf:about="mvn://org.apache.velocity/velocity/1.4">
     <doap:name>Apache Velocity<doap:name>
     <dis:has_license
        rdf:resource="http://www.apache.org/licenses/LICENSE-2.0.txt"/>
   </doap:Project>
 </rdf:RDF>

A few things to note:

 1) rdf:Description is just a placeholder for when you don't know what
"type" of object you're using, so you can avoid using it alltogether if
you already know that doap:Project is the 'rdf:type' of
'mvn://org.apache.velocity/velocity/1.4'

[I know, this is confusing as hell, RDF/XML is a pain]

 2) you use "rdf:about" when you want to use the URL as 'subject' but
you use 'rdf:resource' when you want to use the URL as 'object'

[yes, another one of those things]

 3) I strongly advice *NOT* to use 'http://labs.apache.org/discordia' as
the namespace for this ontology. Something like
"http://apache.org/ns/2007/discordia#"; is much less likely to be able to
point to an RDF description of the ontology for machine discovery while
'http://labs.apache.org/discordia' might change (the lab might move) or
might simply have no way to differentiate between the ontology and the
home page of the lab itself.

 4) the use of "mvn:" URIs is a problem according to TimBL's notion of
'linked data'. He suggests the use of HTTP URIs so that machines could
use HTTP to self-discover more information about that entity. A possible
URI scheme that is both plausible and usefule is

 http://apache.org/ns/org.apache.velocity/velocity/1.4

                             - o -

BTW, I've learned to stay away from RDF/XML entirely and write stuff in
RDF/N3 instead, which is both more readable, more compact and it's way
harder to write invalid RDF by hand.

@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix doap:    <http://usefulinc.com/ns/doap#> .
@prefix dis:     <http://apache.org/ns/2007/discordia#> .

<http://apache.org/ns/org.apache.velocity/velocity/1.4>
    rdf:type         doap:Project ;
    doap:name        "Apache Velocity" ;
    dis:has_license  <http://www.apache.org/licenses/LICENSE-2.0.txt> .

HTH

-- 
Stefano.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to