Re: Validation issue with the xsi namespace

On 27 Jan 2009, at 17:09, Stephane Corlosquet wrote:

> So far I understand that the xsd and xsi namespaces should be  
> defined as
> follows:
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

Indeed.

> How about the following elements using expanded URIs, are they wrong?
> <size rdf:datatype="http://www.w3.org/2001/XMLSchema#integer">10</ 
> size>
> "System Infrastructure"^^<http://www.w3.org/2001/XMLSchema#string>

These are correct. See http://www.w3.org/TR/xmlschema-2/#built-in- 
datatypes where it says that each datatype "foo" has a URI of <http:// 
www.w3.org/2001/XMLSchema#foo>.

> To put the question differently, is there any situation where it makes
> sense to define
>  xmlns:xsd="http://www.w3.org/2001/XMLSchema#"


Yes, RDF.

What you've got to remember is that when people are using XML  
schemas, they are specifically trying to use certain elements and  
attributes defined by the XML schema specs. Thus they have to use the  
XML schema namespaces.

When XSD is used in RDF, people are not trying to do that. They are  
not trying to use the elements or attributes defined in the XML  
schema specs at all. They don't want to use XML schema. They just  
want to reference the URIs for the datatypes. The hash is needed to  
reference them in RDF.

In RDFa, it is proper to use:

   <span property="dc:title" datatype="xsd:string"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema#">...</span>

However, it is equally proper to use:

   <span property="dc:title" datatype="xsd:ring"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema#st">...</span>

Or:

   <span property="dc:title" datatype="xsd:LSchema#string"
   xmlns:xsd="http://www.w3.org/2001/XM">...</span>

All three are considered equivalent.

 > Or are these 'mistakes' due to semweb bad habits?

They are not mistakes in the sense of accidentally using the wrong  
URI. It was arguably a mistake for RDFa and RDF/XML to use XML  
namespaces for prefix binding in the first place though, as it causes  
this kind of confusion. In XML, namespace URIs are opaque identifying  
strings, so have to match the published string character-by- 
character; in RDF, they're not opaque identifiers and can point to  
any partial URI which the author wishes to use as a prefix. In XML, a  
namespace URI is the full URL of a particular resource; in RDF it is  
not.

It helps if you stop thinking of RDF/XML as a type of XML and instead  
think of it as an entirely different format which just happens to  
make some level of sense to XML parsers. Thus while xmlns in RDF  
might look like it should act the same as xmlns in XML, it does not.

-- 
Toby A Inkster
<mailto:mail@tobyinkster.co.uk>
<http://tobyinkster.co.uk>

Received on Wednesday, 28 January 2009 00:18:59 UTC