RE: RDF, again
Paul Prescod wrote: > The thing I find confusing about the RDF syntax is that the > element type > name can be either an RDF type name or an RDF property. XML makes no > distinction and that's why I think that it is difficult to use for > object oriented interchange. I got the impression from the spec that this is intentional, so that a straightforward XML document - that might not contain *any* RDF - can still be interpreted as a set of RDF statements. In other words, different XML layouts (elements for attributes, e.g.) of the same data would result in the same RDF statements. The XML would still need to be well thought out though. For example: <person name="Paul"> <food>trifle</food> </person> might mean trifle is your favourite food, the main food you're allergic to, or your pudding preference for the office Xmas party. All of these are acceptable in XML, but the RDF interpretation of this may well be incorrect - or at least not as rich in meaning as we would like: Person has a name "Paul" and a food "trifle" So, to make the first statement - trifle is Paul's favourite food - we could use the following RDF: <rdf:RDF> <rdf:Description ID="1"> <rdf:Type rdf:resource="person" /> <x:name>Paul</x:name> </rdf:Description> <rdf:Description ID="2"> <rdf:Type rdf:resource="food" /> <x:name>trifle</x:name> </rdf:Description> <rdf:Description about="#1"> <x:favourite rdf:resource="#2" /> </rdf:Description> </rdf:RDF> Using the abbreviated forms allowed to us, this is the same 'RDF': <x:person x:name="Paul"> <x:favourite> <x:food>trifle</food> </x:favourite> </x:person> or: <x:person> <x:name>Paul</x:name> <x:favourite> <x:food>trifle</x:food> </x:favourite> </x:person> or: <x:person> <x:name>Paul</x:name> <x:favourite x:food="trifle" /> </x:person> So - to turn this round - any of the previous three XML documents can be interpreted as the same set of RDF statements - a person with the name "Paul" has a favourite food, and that food is called trifle - even without any explicit RDF present. As to whether it is any good for object interchange, I think it is. Of course, if the relationships between elements contained within other elements can be inferred then straight XML is fine. But as soon as you need something more complex then RDF is very good (not to mention when the objects being referred to are outside of the XML document you're, and so you can't use ID/IDREF.) Best regards, Mark xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ and on CD-ROM/ISBN 981-02-3594-1 To unsubscribe, mailto:majordomo@i... the following message; unsubscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
PURCHASE STYLUS STUDIO ONLINE TODAY!
Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!
Download The World's Best XML IDE!
Accelerate XML development with our award-winning XML IDE - Download a free trial today!
Subscribe in XML format