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

Re: "valid" RDF in XML files

From: Thomas B. Passin <tpassin@comcast.net>
Date: Fri, 28 Nov 2003 11:30:08 -0500
Message-ID: <3FC77810.505@comcast.net>
Cc: www-rdf-interest@w3.org

elacazed wrote:
> We have a lot of RDF files, describing software features, and validated by a
> schema.

I think you meant to write "XML files", did you not?

> We would like to add RDF/XML metadata to those files, but as there is a LOT of
> files, we would like to include the RDF data within the XML files.
> 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?

It is certainly acceptable, but there is a possible alternative.  It is 
possible to create a subset of full RDF/XML that can be validated by a 
W3C xml schema.  In your application, you probably do not have to 
provide for the full range of alternatives in RDF/XML (which cannot be 
validated by W3C xml schema).

If you did create such a subset, it would still be parsable by an RDF 
parser, but you could make sure the form of the structures, and probably 
the values of objects as well, were correct by xml schema validation. 
It would also be easier to manipulate the data with ordinary non-RDF tools.

This approach should also make it easier for "ordinary" - ie, 
non-rdf-aware - developers to create software.  It would not be the 
approach of choice if you had to deal with arbitrary RDF, but it seems 
that you will not be doing so.

See XPackage for an example of this approach -


The site includes a good discussion of why and how to develop an RDF 
subset this way.

> - 2 : If I want the included RDF information to be checked against a model, how
> should I proceed? Do I need RDF Schema???

With the alternative above, most if not all of such checking should not 
be needed, although of course it depends on what you mean by "checking 
against a model".  You might very well want to create an RDF Schema to 
use while you develop the xml schema.


Tom P
Received on Friday, 28 November 2003 11:27:46 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:07:48 UTC