DALI examples and mixed content
Markus Demleitner
msdemlei at ari.uni-heidelberg.de
Mon May 23 10:53:32 CEST 2016
Hi Mark,
On Fri, May 20, 2016 at 11:08:30AM +0100, Mark Taylor wrote:
> Labelling an example is typically done by adding the @property="name"
> attribute to the relevant element:
>
> <h2 property="name">Calculate sum</h2>
>
> All the examples of examples in the DALI and TAP documents look
> like that; plain text content of elements that have @property
> attributes.
>
> But you could imagine wanting to label an example in HTML something
> like this:
>
> <h2 property="name">Calculate chi<sup>2</sup></h2>
>
> which is not forbidden by the current DALI-examples text.
It is not for name, but it is for generic-parameter:
Within this element, the document must include a pair of elements
with \xmlel{property} attributes valued key and value, where the
plain-text content are the parameter name and value respectively.
Similarly, the TAP implementation note had:
* query -- each example MUST have a unique child element with *simple
text content* having a property attribute valued query. [...]
* table -- examples MAY also have descendants with property
attributes having the value table. These must have *pure text
content* [...]
(emphasis mine)
While for property="name" a case could be made that allowing markup
could help the presentation, I believe the implications are deep
enough to make it a non-deal: Essentially, clients would have to be
able to display a good subset of HTML in their native UI elements,
and that certainly is difficult in a sizeable number of toolkits.
Incidentally, the \chi^2 is easily displayed as unicode (and yes, the
implicit requirement that clients need to support unicode in their
labels is a bit tough already).
Here's a proposed change to DALI:
--- DALI.tex (revision 3402)
+++ DALI.tex (working copy)
@@ -363,7 +363,9 @@
\subsubsection{name property}
-The content of this element should be suitable for display within a
+The content of this element must be plain text (i.e., no child
+elements) and
+should be suitable for display within a
space-limited label in user interface and still give some idea about the meaning
of the example. In XHTML, a head element (\xmlel{h2}, say) would usually be a good
choice for the example name, for example:
I've already put this in in rev. 3403 on volute, but of course you're
welcome to back it out again.
> I came across something like this in Markus's examples last year
> (private email exchange 12 May 2015), and we ended up by using
> the RDFa @content attribute, which enables you to provide an
> explicit override for the element content in an attribute, like
> this:
>
> <h2 property="name"
> content="Calculate chi-squared">Calculate chi<sup>2</sup></h2>
Ah well, @content. In the interest of keeping this thing simple, I'd
vote for forgetting about it in the VO, and perhaps I should never
have dug it out.
But to give you an idea what this is about, here's a brief rundown of
the problem: I'm currently using RDFa @content in table references.
If you check http://dc.g-vo.org/tap/examples, you'll see things like
<div typeof="example" id="Qfc" resource="#Qfc">
<p>This example shows how to combine the
<a href="/tableinfo/califadr1.objects" property="table"
content="califadr1.objects">califadr1.objects</a>
table of properties...
Essentially, I'm re-using the table names as anchors to link to table
description. @content is, in strict RDFa interpretation, necessary
*here*. Essentially, what this thing is supposed to mean
califadr1.objects is a table used in the-example-Qfc (1)
Now, RDFa says that when there's an @href attribute on an element
that has @property, the object in (1) isn't actually the element
content (as usual) but rather what the @href points to (in this case,
my custom-format table description). That's wrong in a strict sense,
and hence I'm using content to override the @href overriding the
element content.
While I don't want to belittle this aspect, I still propose not to
mention it in DALI, since it'd be an unnecessary reason for people to
panic. Without the @content here, examples clients would still do
the right thing according to the TAP implementation notes (and
probably future TAP 1.1) language. RDFa strict would use a web page
rather than the table name, but that would still do for interesting
use cases ("group examples by table used"). And it would be easy for
people to make this strictly correct once they notice there's a
problem.
One might discourage the use of links (which is the root of the
problem here) in elements carrying examples properties, though. I'm
just not sure how to write this.
> That works nicely, and it's sitting in topcat's client code.
> However, it is actually illegal content as far as DALI-examples
> goes, since DALI-examples mandates RDFa Lite, and @content is a feature
> from RDFa (not-Lite). RDFa Lite forbids use of non-Lite RDFa features.
Oh my, I hadn't noticed that. I think I'll punt the links, then,
when taplint starts to complain about them...
Cheers,
Markus
More information about the dal
mailing list