W3C home > Mailing lists > Public > www-rdf-interest@w3.org > November 2003

Re: "valid" RDF in XML files

From: <jon@hackcraft.net>
Date: Fri, 28 Nov 2003 16:40:19 +0000
Message-ID: <1070037619.3fc77a73cb126@82.195.128.192>
To: elacazed <elacazed@actia.fr>
Cc: "www-rdf-interest@w3.org" <www-rdf-interest@w3.org>

> I managed to do that by adding the following line to the Schema : 
> 
> <xsd:any namespace="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
>     minOccurs="0" maxOccurs="1"  
>     processContents="skip"/>
> 
> which allows me to add a <rdf:RDF ....>....</rdf:RDF> tag in my XML file, at
> the
> location specified in the schema. An RDF parser finds the RDF information,
> and
> the XML validates correctly, I'm quite happy.
> 
> My questions are : 
> 
> - 1 : is this the good way to do such things?? Or do I need much more
> explanations about RDF and the way to use it?
> 
> - 2 : If I want the included RDF information to be checked against a model,
> how
> should I proceed? Do I need RDF Schema???

Well you could go a bit further and have a definition of the rdf:RDF element 
(which in general should allow any elements from any namespace as content) and 
then allow that rather than any element from the RDF namespace. This would 
allow you to catch <you:someElement><rdf:Gibberish /></you:someElement>.

Really though that refinement is just frosting, so I wouldn't worry about it.

What exactly do you want to allow in terms of RDF?

If you want to allow arbitrary RDF/XML contnent then you can't go much further 
than that in your schema.

However you could define a fixed format for a fixed range of possible values 
such that, for example, the content could only be 1 dc:title element followed 
by 0 or 1 dc:description elements followed by 0 or more elements for a 
predicate of your own invention that has some purpose in your own application.

In such case XML Schemata could very rigourously validate the document, and 
while you lose flexibility you also gain a guarantee of what metadata will be 
present and arguably make it easier to teach people who to prepare documents in 
the format (ironically the freer the system the harder it can be to teach).

--
Jon Hanna
<http://www.hackcraft.net/>
*Thought provoking quote goes here*
Received on Friday, 28 November 2003 11:40:34 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:52:03 GMT