Re: comparing XML and RDF data models

On 1 Jul 2008, at 11:21, Maciej Gawinecki wrote:

> In one of the article comparing two data models: XML and RDF I  
> found a statement stating that (I'm loosely citing from my memory):
>
>   Searching XML with XPath query expression is easy if you know the
>   schema of the document being quiried.

I don't think that knowing the schema is remotely necessary. XPath is  
not schema aware, for example. I'd hazard that most XPath is over  
merely well formed XML.

You do need to know something about the structure, but, for example,  
it's pretty easy to use ancestor and descendent queries to ignore  
quite a bit of structure.

> However, the same query will not
>   work any a document, which is differently structured, but contains
>   equivalent information.

If the structure is *far* enough away, then of course. If you renamed  
everything and leave the structure intact, this is true too. It's  
also true for RDF>

> This can be solved by usage of RDF model,
>   which can be then queried with RDQL or SPARQL query.
>
> Is that really true, that XPath-based XML search is limited due to  
> its structure?

In a restricted sense, yes.

> Yes, that's why there is a great research on keyword-based quering  
> of XML documents (not knowing schema in advance).

This won't help if names change (which is a kind of structural change).

> But is it RDF really better for this issue ?
[snip]

Not even a little bit.

Consider changing from a data valued property to an intermediate  
object. I.e.,

	s weighs "10".

to
	s weighs _:x.
	_x: weightvalue "10".
	_x: atTime "...".

You have to change the query in SPARQL. In XML it's pretty easy to  
maintain your xpath, e.g.,

	<Weight name="S" value="10"/>

vs

	<Weight name="S" value=10 timeRecorded="..."/>

The same xpath will get the name and value.

Of course if you shift from attributes to elements, you'll have made  
too big a structural change for that xpath. But so?

Bijan.

Received on Tuesday, 1 July 2008 10:51:16 UTC