The Lurker
Won't somebody please think of the model? Mixing vocabularies with and without RDF
RDF seems interesting to me. I try to read what I can from RDF proponents, because I've got this nagging feeling that I would like it if I understood a use for it. But the most common point I keep hearing is something like this from Bill de hÓra:
But, to their credit, what the RDF people have always understood and what the XML people of all walks who look to XML Namespaces to this day still do not appreciate, is that you can't mix and match with XML Namespaces without a underlying data model to unify the vocabularies. RDF has a model - it's the triple relation.
("Namespaces" are a red herring here. I'm going to stick with the word "vocabularies" here, because this is what the discussion is really about. As Tim Bray pointed out today in an attempt to demystify namespaces, markup and meaning, these issues exist whether you use XML Namespaces to avoid element name conflicts, or some other mechanism, or no mechanism other than wishful thinking.)
RDF's triple is one possible underlying model. But, as Bill de hÓra mentioned a few weeks ago regarding the use of XML Namespaces to guarantee unique names, it is possible to achieve this by other means.
Joe Gregorio wrote an example of how extending Pie is supposed to work (in the context of the proposed AtomAPI; I'm interested here in the <entry> document sent to the create-entry URI).
His example is the LiveJournal "mood". Each entry on LJ may have a mood (such as "happy" or "frustrated") attached to it. He adds the <lj:mood> element as a child of the <entry> element.
There is "an underlying model" at work here.
It seems to me that this model is so obvious to people who are comfortable working with it that they never explicitly acknowledge that it exists. Meanwhile, RDF fans see that the model they know and love isn't being used, don't see any model being documented, and assume that one should be introduced.
The underlying model, put crudely, is:
- Properties of an entry are expressed as child elements of an entry element.
- Properties of a feed are expressed as child elements of the feed element.
This is enough. Yes, it is an "ad hoc" model, but it is based on something that XML gives us anyway — a simple parent-child relationship between elements. I believe that you simply do not need a universal unifying model to support the kinds of vocabularies people want to mix into something like Pie.
Is this a reinvention of (an aspect of) RDF? I think an analogy with design patterns is more appropriate. You can't just write a piece of code, call it "the facade", and use that piece of code in every situation where a facade is appropriate. Instead, you are applying familiar principles to the code you write in that situation. In Pie, the principle is "use the parent-child relationship to express properties of the parent".
Another common principle in XML, as exemplified by the xml:lang attribute, is "a property may be specified as a child of an element, OR an element may inherit the value of this property of its nearest ancestor with that property defined". Pie uses this approach (using the xml:lang attribute) to indicate the content's language, and again with its author element. Each <entry> must have an <author> child element, unless the <feed> has an <author>. The author of an entry is specified by the entry's <author> child, if it has one; otherwise it the feed's author indicates the entry's author.
Related topics: Rants Web Mindless Link Propagation
All timestamps are Melbourne time.