Some (OWL) Test Cases

rdf:XMLLiteral

This document shows two tests where the implementation freedom granted RDF parsers under the RDF Syntax last call in their treatment of rdf:parseType="Literal" may cause problems for OWL.

The tests have been converted into triples using ARP. The strings produced in the triples are in Canonical XML, and hence do not get significantly further modified by the lexical to value mapping of the rdf:XMLLiteral datatype.

In particular, an implementation built with ARP will pass these consistency tests if and only if the two strings in the last two triples in each case are identical.

Thus, with ARP, the first document is inconsistent and the second is consistent.

A different parser would be free to ignore the XML Comment in the first document. This would result in the two strings in the N3 version being identical, and the document would then be found as consistent.

In the second test, an XSLT aware parser may well choose to preserve the namespace bindings for the eg:prefix. The two strings to be compared would then be:

"<xsl:template xmlns:eg=\"eg:a\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" match=\"eg:foo\"></xsl:template>"^^rdf:XMLLiteral  .
and
"<xsl:template xmlns:eg=\"eg:b\" xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" match=\"eg:foo\"></xsl:template>"^^rdf:XMLLiteral  .

With such a parser, the test would be found as inconsistent.

Options are:

Live with it
My preference, there are different scenarios where the various behaviour is useful; making a call one way or the other involves eliminating some of the scenarios.
Require RDF/XML readers used in OWL to have a specific behaviour
I could suggest such a behaviour, which would work for our I18N related requirements (e.g. xhtml and friends). This would prevent using OWL with embedded XSLT for example, but then that won't work anyway.
Make a last call comment to RDF Core, and get them to fix it
Hmmm,
LiteConsistent document.001
Description: <I5.4/Manifest001#test> Jeremy J. Carroll
This test depends on parser behaviour under 7.2.17 of RDF Syntax.
Namespaces:
@prefix : <http://www.w3.org/1999/xhtml> .
LiteConsistent: <I5.4/consistent001>

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:first="http://www.w3.org/2002/03owlt/I5.4/consistent001#"
    xmlns='http://www.w3.org/1999/xhtml'
    xml:base="http://www.w3.org/2002/03owlt/I5.4/consistent001" >
    <owl:DatatypeProperty rdf:ID="p"/>
    <owl:FunctionalProperty rdf:about="#p"/>
    <owl:Thing rdf:ID="i">
       <first:p rdf:parseType="Literal"><b>In Bold</b></first:p>
       <first:p rdf:parseType="Literal"><b><!--
I copied this-->In Bold</b></first:p>
    </owl:Thing>
</rdf:RDF>
first:p rdf:type owl:DatatypeProperty .
first:p rdf:type owl:FunctionalProperty .
first:i rdf:type owl:Thing .
first:i first:p "<b xmlns=\"http://www.w3.org/1999/xhtml\">In Bold</b>"^^rdf:XMLLiteral  .
first:i first:p "<b xmlns=\"http://www.w3.org/1999/xhtml\"><!--\nI copied this-->In Bold</b>"^^rdf:XMLLiteral  .
Errors:
Third and subsequent comments ignored in consistent001.

LiteConsistent document.002
Description: <I5.4/Manifest002#test> Jeremy J. Carroll
This test depends on parser behaviour under 7.2.17 of RDF Syntax.
Namespaces:
@prefix eg: <eg:b> .
@prefix xsl: <http://www.w3.org/1999/XSL/Transform> .
LiteConsistent: <I5.4/consistent002>

<rdf:RDF
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:owl="http://www.w3.org/2002/07/owl#"
    xmlns:first="http://www.w3.org/2002/03owlt/I5.4/consistent002#"
    xml:base="http://www.w3.org/2002/03owlt/I5.4/consistent002" >
    <owl:DatatypeProperty rdf:ID="p"/>
    <owl:FunctionalProperty rdf:about="#p"/>
    <owl:Thing rdf:ID="i">
       <first:p rdf:parseType="Literal" 
        xmlns:eg="eg:a"><xsl:template match="eg:foo"/></first:p>
       <first:p rdf:parseType="Literal" 
        xmlns:eg="eg:b"><xsl:template match="eg:foo"/></first:p>
    </owl:Thing>
</rdf:RDF>
first:p rdf:type owl:DatatypeProperty .
first:p rdf:type owl:FunctionalProperty .
first:i rdf:type owl:Thing .
first:i first:p "<xsl:template xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" match=\"eg:foo\"></xsl:template>"^^rdf:XMLLiteral  .
first:i first:p "<xsl:template xmlns:xsl=\"http://www.w3.org/1999/XSL/Transform\" match=\"eg:foo\"></xsl:template>"^^rdf:XMLLiteral  .
Errors:
Preifx eg: represents both uri <eg:b> and <eg:a>.