- From: David Decraene <David@landcglobal.com>
- Date: Tue, 1 Jul 2008 12:50:17 +0200
- To: "Maciej Gawinecki" <mgawinecki@gmail.com>, <semantic-web@w3.org>
In my opinion: If you wish to query, without knowing the content in advance, then you need a language like OWL (http://www.w3.org/TR/owl-guide/), where entries have the capability to explain themselves and how they relate to other entries. SPARQL & RDF will fail on that as you still need to know what the relations are by name (you must be aware of hasName and hasSensor in your example before being able to query). Cfr http://jowl.ontologyonline.org/ David Decraene. -----Original Message----- From: semantic-web-request@w3.org [mailto:semantic-web-request@w3.org] On Behalf Of Maciej Gawinecki Sent: dinsdag 1 juli 2008 12:21 To: semantic-web@w3.org Subject: comparing XML and RDF data models 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. However, the same query will not work any a document, which is differently structured, but contains equivalent information. 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? Yes, that's why there is a great research on keyword-based quering of XML documents (not knowing schema in advance). But is it RDF really better for this issue ? I will try to give a few example what I exactly mean. [Of course, I'm ommiting here the problem of knowning the name a tag/property/resource, only the structure can be different.] Let's see two XML documents: <Sensor> <name>Sensor220</name> <isLocatedNearBy> <Road> E330 </Road> <isLocatedNearBy> </Sensor> Here road value can be check through XPath expression: \\Sensor\isLocatedNearBy\Road And let's see differently structured document (road defined by name property) <Sensor> <name>Sensor220</name> <isLocatedNearBy> <Road> <name>E330</name> </Road> <isLocatedNearBy> </Sensor> With XPath expression: \\Sensor\isLocatedNearBy\Road\name Or yet another one (road is ancestor tag to the sensor tag, not the oposite) <Road> <name>E330</name> <hasSensor> <Sensor> <name>Sensor 220</name> </Sensor> </hasSensor> </Road> XPath: \\Road\name The same problem would be with RDF. Let see the first model :Sensor220 :isLocatedNearBy :Road_E330 . WHERE clause of SPARQL query would be then like a ?s :isLocatedNearBy :Road_E330 . For other version we define a road with a specific value of hasName property: :Sensor220 :isLocatedNearBy :RoadXXX . :RoadXXX :hasName "E330" . the SPARQL query part: ?s :isLocatedNearBy ?r . ?r :hasName "E330" . or by analogy to the third XML representation (road "has" a sensor, not the opposite): :RoadXXX :hasName "E330" . :RoadXXX :hasSensor :Sensor220 . the SPARQL query part: ?r :hasName "E330" . ?r :hasSensor ?s . Can someone comment it ? Thanks, Maciej
Received on Tuesday, 1 July 2008 10:51:24 UTC