Re: [whatwg] A Selector-based metadata proposal (was: Annotating structured data that HTML has no semantics for)

On Mon, May 18, 2009 at 2:31 AM, Simon Pieters <simonp@opera.com> wrote:
> -whatwg
> +www-archive
>
> On Sat, 16 May 2009 17:50:37 +0200, Tab Atkins Jr. <jackalmage@gmail.com>
> wrote:
>
>> Actually, I believe it would generate:
>> <rdf:Description rdf:about="http://example.net/">
>>  <ex:property1>Quux</ex:property1>
>>  <ex:property2>http://example.org/"</ex:property2>
>> </rdf:Description>
>>
>> In other words, it completely ignores the resource part of RDF.  This
>> is easy to fix, though.  Frex, change the example CRDF to:
>>
>> <script type="text/crdf">
>> @namespace ex "http://example.com/"
>> a.foo {
>>  ex|property1: attr(title);
>>  ex|property2: attr(href) resource;
>> }
>> </script>
>
> I think the CSS attr() syntax is:
>
>  attr(href, url);
>
> http://www.w3.org/TR/css3-values/#attribute

Well, this proposal only officially uses Selectors, and superficially
resembles the more complete CSS syntax only for ease-of-use, so it's
not strictly necessary to copy CSS's attr() syntax.  After all, it
already allows empty properties (which specify that the content of the
element is the value of the property), which aren't valid in CSS.

Specifically, CSS uses that extra parameter to aid in parsing (I
guess?).  This isn't necessary in CRDF, which just produces triples
out of it.

Now, this *would* be a nice way to slide datatype into the syntax, but
it has the weakness that it isn't compatible with the more common case
of using the contents as the value.  My suggestion was an additional
type() value that could be given in the property value, similar to how
"resource" can just be slid into there.

~TJ

Received on Tuesday, 19 May 2009 22:43:26 UTC