- From: Mark Birbeck <mark.birbeck@webbackplane.com>
- Date: Mon, 15 Dec 2008 06:35:20 -0500
- To: "Ivan Herman" <ivan@w3.org>
- Cc: "Toby A Inkster" <tai@g5n.co.uk>, public-rdfa@w3.org, RDFa <public-rdf-in-xhtml-tf@w3.org>
- Message-ID: <ed77aa9f0812150335v4df340a7t2d44188348ed4d50@mail.gmail.com>
Hi Ivan, Toby is right here, that a shorthand for expressing XML literals (and consequently turning off recursion) is to have no @datatype value, and to have non-text child nodes. For example, the following generates only one triple: <div property="my:template"> <span property="foaf:name">${name}</span> </div> and is equivalent to: <div property="my:template" datatype="rdf:XMLLiteral"> <span property="foaf:name">${name}</span> </div> Note that the former doesn't require the RDF namespace to be declared. If we want the 'nested' predicates to be processed, we have a couple of choices. If the text nodes of all child elements will appear as part of the value of the predicate, then we can force a non-XMLLiteral datatype. In this example, we force the data to be a plain literal: <div property="foaf:name" datatype=""> <span property="foaf:givenname">Ivan</span> <span property="foaf:surname">Herman</span> </div> Which generates: <> foaf:name "Ivan Herman" . <> foaf:givenname "Ivan" . <> foaf:surname = "Herman" . Alternatively, if there is no relationship between the document hierarchy and the values, then we could use @content: <div property="foaf:name" content="Ivan Herman"> <span property="foaf:surname">Herman</span>, <span property="foaf:givenname">Ivan</span> </div> This allows recursion to continue, but also sets the value of foaf:name independently of any child elements. Regards, Mark On Mon, Dec 15, 2008 at 5:17 AM, Ivan Herman <ivan@w3.org> wrote: > > > Toby A Inkster wrote: > > > > Ivan Herman wrote: > > > >> Ben, Mark, Michael, others: what do you think? > > > > My understanding of the syntax specification is that conforming > > implementations must generate both triples in your example. > > > > I begin to yield to the fact that I have a bug in distiller on this... > But I would still want to have a formal confirmation before I change my > code! > > > > Another test which I think is missing from the suite is: > > > > <div property="ex:foo"> > > <span property="ex:bar">bar</span> > > </div> > > > > should generate an XMLLiteral for ex:foo, but there should be no ex:bar > > triple. > > Yes, you are right! That is another case to consider through a proper test. > > Thanks > > Ivan > > > > > Also, may I draw attention to this again: > > > http://lists.w3.org/Archives/Public/public-rdf-in-xhtml-tf/2008Dec/0012.html > > > > > > -- > > Ivan Herman, W3C Semantic Web Activity Lead > Home: http://www.w3.org/People/Ivan/ > PGP Key: http://www.ivan-herman.net/pgpkey.html > FOAF: http://www.ivan-herman.net/foaf.rdf > -- Mark Birbeck, webBackplane mark.birbeck@webBackplane.com http://webBackplane.com/mark-birbeck webBackplane is a trading name of Backplane Ltd. (company number 05972288, registered office: 2nd Floor, 69/85 Tabernacle Street, London, EC2A 4RR)
Received on Monday, 15 December 2008 11:35:58 UTC