Rx -- A Prescription for RDF in XML =================================== RX defines an XML representation for RDF graphs which has a low impedance-match between both commonly-created RDF graphs and common XML data formats in use on the web. Specifically, this format differs from the Recommended RDF/XML syntax in the following ways: 1. XML elements correspond to RDF Properties. 2. ``parseType="Resource"`` is the default; elements generally relate blank nodes to other blank nodes. 3. Resource typing is optional and not expected; striping is eliminated. 4. Options for serialization are explicitly minimized to encourage consistency for consumers. + Specifically: property values in attributes are explicitly disallowed. The desire is to have an XML serialization for RDF that's more immediately intuitive for potential users approaching from an XML-only perspective. As well, (with implementation) it would provide a viable option for structured-data formats which wish to be dually-interpreted as XML and RDF. Example ------- This is an example of RX showing most of it's syntactic features: .. include:: examples/list.rx :literal: Spec ---- + `As of 2005.01.17`_. .. _`As of 2005.01.17`: spec.html Resources --------- + `rx2nt.py`_ is a RX to NTriples converter. + `examples/`_ contains example RX files and their NTriples conversions. .. _`rx2nt.py`: rx2nt.py .. _`examples/`: examples/ Why? ---- `RDF Triples in XML`_ and `A retrospective on the development of the RDF/XML Revised Syntax`_ are both illuminating descriptions of various means and challenges with encoding RDF in XML. As well, `A Brief History of RDF Serialization Formats`_ is exactly as it claims. .. _`RDF Triples in XML`: http://www.mulberrytech.com/Extreme/Proceedings/html/2004/Stickler01/EML2004Stickler01.html .. _`A retrospective on the development of the RDF/XML Revised Syntax`: http://www.ilrt.bris.ac.uk/publications/researchreport/rr1017/report_html?ilrtyear=2003 .. _`A Brief History of RDF Serialization Formats`: http://www.fakeroot.net/sw/rdf-formats-20040717/ As well, these documents generally outline the other "unstriped" approaches to representing RDF in XML. None of these approaches appeal to me presently, and they definitely do not appeal to a hypothetical data-format designer familiar with XML and contemplating taking on the excess constraints and capabilities associated with RDF. `RDF/XML`_ has well-known problems. Specifically, striping can be a mental encumbrance, especially when data-typing is not always present or obvious. The various properties used for subject-, object- and intra-[blank-]node identification can be confusing. `TriX`_ and `RXR`_ are too focused on triples, thus becoming even more verbose and harder to manually develop with than RDF/XML. `RPV`_, while novel and curious, also distracts the writer from the domain of the data representation. BSWL_ is similar to RPV, in that it is a primarily-triples-focused syntax, with abbreviations for properties as XML element names. It also forces the user to switch between RDF and domain models. `N3-in-XML`_ is similar to RX, while being different. It's very focused on N3, forces labeling of bnodes and uses whitespace in attribute values to seperate various concepts. XENT_ is simply too divorced from the `XML Infoset`_ to be usable by pure-XML processing tools, including XML-only developers. RX is very close to the `strawman [RDF in XML syntax] by TimBL`_, which does not appear to have been developed further. RX is nearly *identical* to strawman response `Simplified Syntax for RDF`_ by `Sergey Melnik`_. In fact, the description of the algorithm is very close to that implemented in `rx2nt.py`_, though I had not seen this proposal until after implementation. Both RX and Melnik's Simplified Syntax are close to Jon Borden's `Simplified XML Syntax for RDF`_, which isn't well-specified. The `XHTML Metainformation Module`_ is another take on representing relatively constrained data-structures in XHTML2 documents, but shares some features in common with RX. .. _`RDF/XML`: http://www.w3.org/TR/rdf-syntax-grammar/ .. _`TriX`: http://www.hpl.hp.com/techreports/2004/HPL-2004-56 .. _`RXR`: http://www.idealliance.org/papers/dx_xmle04/papers/03-08-03/03-08-03.html .. _`RPV`: http://www.textuality.com/xml/RPV.html .. _BSWL: http://infomesh.net/2001/07/bswl/ .. _`N3-in-XML`: http://lists.w3.org/Archives/Public/www-rdf-interest/2002Mar/0128 .. _XENT: http://lists.w3.org/Archives/Public/www-rdf-interest/2003Jun/0076 .. _`XML Infoset`: http://www.w3.org/TR/xml-infoset/ .. _`strawman [RDF in XML syntax] by TimBL`: http://www.w3.org/DesignIssues/Syntax .. _`Simplified Syntax for RDF`: http://www-db.stanford.edu/~melnik/rdf/syntax.html .. _`Sergey Melnik`: http://www-db.stanford.edu/~melnik/ .. _`Simplified XML Syntax for RDF`: http://www.openhealth.org/RDF/RDFSurfaceSyntax.html .. _`XHTML Metainformation Module`: http://www.w3.org/TR/2004/WD-xhtml2-20040722/mod-meta.html Why Not? -------- RX offers a very limited incremental benefit over RDF/XML, especially in machine-to-machine scenarios. I do believe, however, that it well addresses human-factors issues around development, debugging and adoption which should not be ignored. The list syntax is still pretty onerous, and will put people off; the prohibition against data in attributes will put people off. RDF exchanges some constraints (as well as liberties), for benefits. The primary issue with RDF adoption is that people don't like (the perception of) being constrained; another XML serialization won't change that. One of the most important properties of an XML-focused RDF-in-XML syntax is predictability, especially with respect to non-RDF consumers (e.g. XSLT) that index content structurally. Because of the fundamental graph-vs-tree model mismatch, this predictability is both hard to specify, and even harder to guarantee. I've stopped short of attempting to do so in the RX spec -- though that was my original intent. N3_ and Turtle_ both offer compelling syntaxes for RDF which are extremely friendly to both reading and writing, as well as being easily machine parsable and having excellent representational capability. .. _N3: http://www.w3.org/DesignIssues/Notation3.html .. _Turtle: http://www.ilrt.bris.ac.uk/discovery/2004/01/turtle/ ------------------------------------------------------------ authored: `jsled`_, 2005.01.17 .. _`jsled`: http://asynchronous.org/jsled/