[oslc-core] Bug in the core spec
Martin Nally
nally at us.ibm.com
Sun Dec 5 00:46:05 EST 2010
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
More information about the Oslc-Core
mailing list