[oslc-core] Bug in the core spec

Arthur Ryman ryman at ca.ibm.com
Mon Dec 6 12:18:15 EST 2010


Martin/Dave,

FYI, RDF.XML also has an abbreviation for reifying statements. You put 
rdf:ID on the predicate of the Statement and this expands to the usual 
four triples (Statement, subject, predicate, object). You can then 
explicitly add more triples about the Statement. 

I think that this use of rdf:ID makes the document more readable since it 
identifies the Statement at its point of definition. The alternate of 
explicity reifying the Statement is more verbose. Also, it's easier to 
find the unreified Statement if you want to understand its context.

The example becomes the following which produces exactly the same set of 
triples as Martin's corrected example:

<rdf:RDF xmlns:terms="http://example.com/terms/"
        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

        <terms:Customer rdf:about="http://example.com/customers/4321">
                <terms:subscribesTo rdf:ID="n1"
                        rdf:resource="
http://example.com/magazines/Field_and_Stream" />
        </terms:Customer>

        <terms:Customer rdf:about="http://example.com/customers/4321">
                <terms:subscribesTo rdf:ID="n2"
                        rdf:resource="
http://example.com/magazines/Cat_Fancy" />
        </terms:Customer>

        <rdf:Description rdf:about="#n1">
                <terms:expirationDate>2010-06-03</terms:expirationDate>
                <terms:annualPriceUSD>23.95</terms:annualPriceUSD>
                <terms:delivery rdf:resource="
http://example.com/terms/online" />
        </rdf:Description>

        <rdf:Description rdf:about="#n2">
                <terms:expirationDate>2010-01-22</terms:expirationDate>
                <terms:annualPriceUSD>15.95</terms:annualPriceUSD>
                <terms:delivery rdf:resource="
http://example.com/terms/mail" />
        </rdf:Description>

</rdf:RDF>

Regards, 
___________________________________________________________________________ 

Arthur Ryman, PhD, DE

Chief Architect, Project and Portfolio Management
IBM Software, Rational
Markham, ON, Canada | Office: 905-413-3077, Cell: 416-939-5063





From:
Martin Nally <nally at us.ibm.com>
To:
oslc-core at open-services.net
Date:
12/05/2010 01:43 AM
Subject:
[oslc-core] Bug in the core spec
Sent by:
oslc-core-bounces at open-services.net




I noticed a bug in the core spec
(http://open-services.net/bin/view/Main/OslcCoreSpecAppendixLinks). It
contains the following XML

<rdf:RDF
     xmlns:terms="http://example.com/terms/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

    <terms:Customer rdf:about="http://example.com/customers/4321">
         <terms:subscribesTo
rdf:resource="http://example.com/magazines/Field_and_Stream" />
    </terms:Customer>

    <terms:Customer rdf:about="http://example.com/customers/4321">
         <terms:subscribesTo
rdf:resource="http://example.com/magazines/Cat_Fancy" />
    </terms:Customer>

    <rdf:Statement rdf:about="">
        <terms:expirationDate>2010-06-03</terms:expirationDate>
        <terms:annualPriceUSD>23.95</terms:annualPriceUSD>
        <terms:delivery rdf:resource="http://example.com/terms/online" />
        <rdf:subject rdf:resource="http://example.com/customers/4321"/>
        <rdf:object
rdf:resource="http://example.com/magazines/Field_and_Stream"/>
        <rdf:predicate
rdf:resource="http://example.com/terms/subscribesTo" />
   </rdf:Statement>

    <rdf:Statement rdf:about="">
        <terms:expirationDate>2010-01-22</terms:expirationDate>
        <terms:annualPriceUSD>15.95</terms:annualPriceUSD>
        <terms:delivery rdf:resource="http://example.com/terms/mail" />
        <rdf:subject rdf:resource="http://example.com/customers/4321"/>
        <rdf:object rdf:resource="http://example.com/magazines/Cat_Fancy
"/>
        <rdf:predicate
rdf:resource="http://example.com/terms/subscribesTo" />
   </rdf:Statement>

</rdf:RDF>

I believe the lines that begin with <rdf:Statement about=""  are wrong.
About is used to specify the subject of a group of triples. The empty
string is a relative URL, relative to the base. Since no explicit base has
been provided, this means the implicit base provided by the enclosing
document. Both of the Statement XML elements are thus providing RDF
information about the document this RDF is found in. This XML asserts that
the enclosing document is an RDF Statement (twice), and also specifies two
different subjects, two different objects and two different predicates for
it, along with some other properties. I believe the intention was that the
statements be blank nodes, or possibly resources with fragment identifiers
in their URLs. Since the next example, using rdf:id, creates URLs with
fragment identifiers, the better fix might be the following:

 <rdf:RDF
     xmlns:terms="http://example.com/terms/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">

    <terms:Customer rdf:about="http://example.com/customers/4321">
         <terms:subscribesTo
rdf:resource="http://example.com/magazines/Field_and_Stream" />
    </terms:Customer>

    <terms:Customer rdf:about="http://example.com/customers/4321">
         <terms:subscribesTo
rdf:resource="http://example.com/magazines/Cat_Fancy" />
    </terms:Customer>

    <rdf:Statement rdf:about="#n1">
        <terms:expirationDate>2010-06-03</terms:expirationDate>
        <terms:annualPriceUSD>23.95</terms:annualPriceUSD>
        <terms:delivery rdf:resource="http://example.com/terms/online" />
        <rdf:subject rdf:resource="http://example.com/customers/4321"/>
        <rdf:object
rdf:resource="http://example.com/magazines/Field_and_Stream"/>
        <rdf:predicate
rdf:resource="http://example.com/terms/subscribesTo" />
   </rdf:Statement>

    <rdf:Statement rdf:about="#n2">
        <terms:expirationDate>2010-01-22</terms:expirationDate>
        <terms:annualPriceUSD>15.95</terms:annualPriceUSD>
        <terms:delivery rdf:resource="http://example.com/terms/mail" />
        <rdf:subject rdf:resource="http://example.com/customers/4321"/>
        <rdf:object rdf:resource="http://example.com/magazines/Cat_Fancy
"/>
        <rdf:predicate
rdf:resource="http://example.com/terms/subscribesTo" />
   </rdf:Statement>

</rdf:RDF>

These are still relative URLs, so the URLs of the new statements are
<enclosing document URL>#ns1 and <enclosing document URL>#ns2.

Best regards, Martin

Martin Nally, IBM Fellow
CTO and VP, IBM Rational
tel: +1 (714)472-2690


_______________________________________________
Oslc-Core mailing list
Oslc-Core at open-services.net
http://open-services.net/mailman/listinfo/oslc-core_open-services.net








More information about the Oslc-Core mailing list