W3C home > Mailing lists > Public > public-rdfa-wg@w3.org > March 2010

Re: Another way other than @profile, @vocab or @map

From: Martin McEvoy <martin@weborganics.co.uk>
Date: Fri, 19 Mar 2010 12:21:56 +0000
Message-ID: <4BA36C64.8070500@weborganics.co.uk>
To: Ivan Herman <ivan@w3.org>
CC: Toby Inkster <tai@g5n.co.uk>, RDFa WG <public-rdfa-wg@w3.org>
Hello Ivan, all

Sorry about the delay in replying.

On 17/03/2010 13:03, Ivan Herman wrote:
> Interesting.
>
> I think, as Mark said, the distinction whether we have a URI or a CURIE
> in typeof becomes moot, because we can have both. In other words, I
> think what you say is that we use the type URI's trimmed back version as
> a URI for a default namespace, so to say.
>    

Yes, correct.

> Personally, if we go that route, I would prefer not to mix the typeof
> with that solution, and keep it a separate attribute as Martin proposed
> originally.

perhaps overloading @typof may not be a good Idea...

> I believe it is cleaner that way. I am not against hacking
> in general but this looks like a bit too much of a hack:-(

And RDFa is not a hack...

> Let alone the
> fact that for some vocabularies I may want to have number of typeof-s in
> a subtree with different values, and there is a real danger of
> inadvertently changing the default namespace, ie, leading to a bunch of
> invalid or unwanted triples...
>    

  Of course changing the default namespace mid parse would be just too 
easy, the only real way to avoid this is to allow only one vocabulary to 
be expressed in non prefixed keywords .

> The problem I see that while this indeed may be used to define a bunch
> of keywords it does not answer the case when one want to mix
> vocabularies. Ie, the user will have to choose one default uri for
> keywords and then use @xmlns (or equivalents) for the other
> vocabularies. Maybe that is acceptable...
>    

Indeed it is, the purpose is only to limit xmlns: use to an acceptable 
level.

> I wonder whether the two mechanisms (this and the @profile discussion we
> have) exclude one another. Maybe we can restrict the @profiles to prefix
> mappings only and keyword mapping going this route...
>    

Although I like the @profile proposal I don't like the extra parsing 
that may have to occur at profile level to determine a list of valid 
keywords, it seems too intensive, and far to reliant on the profiles 
actually being available for parsing.

I have a thought about profiles, why go down the road of creating 
profile documents when its already possible to dereference RDF namespace 
documents, for all intents and purposes they have the same behaviour as 
the desired RDFa profile proposal  ( so it seems ).

If you take all that I have said into account, and what you have said 
about "keep it a separate attribute" and not overloading typeof  I dont 
see why (for now) its not possible then re-use the @profile attribute to 
set a default namespace for the document.
like so:

<body profile="http://www.w3.org/2006/vcard/ns#">
<div typeof="VCard" about="#BusinessEntity">
<div property="fn">L'Amourita Pizza</div>
<div rel="adr">
<div typeof="Address">
<span property="street-address">2040 Any Street</span>,
<span property="locality">Springfield</span>,
<span property="postal-code">98102</span>.
</div>
</div>
         Tel: <span property="tel">206-555-7242</span>.
<span rel="url" resource="http://pizza.example.com/"></span>
</div>
</body>

@profile in this way is behaving just the same as html4 profiles..

"As a globally unique name. User agents may be able to recognize the 
name (without actually retrieving the profile) and perform some activity 
based on known conventions for that profile"

http://www.w3.org/TR/html401/struct/global.html#profiles

In the case of RDFa the "known conventions" would be setting the default 
namespace for the document.


Best wishes

Martin.

> Ivan
>
> On 2010-3-16 20:17 , Toby Inkster wrote:
>    
>> On Tue, 2010-03-16 at 14:38 +0000, Martin McEvoy wrote:
>>      
>>> With all the above in mind,  RDFa could I think re-use an attribute
>>> name that already exists in htm5, microdata to be more precise
>>> "itemtype"[1]. RDFa could be used pretty much like microdata eg:
>>>
>>> <div itemtype="http://www.w3.org/2006/vcard/ns#" about="#BusinessEntity"
>>> typeof="VCard">
>>> <div property="fn">L'Amourita Pizza</div>
>>> <div rel="adr">
>>> <div typeof="Address">
>>> <span property="street-address">2040 Any Street</span>,
>>> <span property="locality">Springfield</span>,
>>> <span property="postal-code">98102</span>.
>>>                Tel:<span property="tel">206-555-7242</span>.
>>> <span rel="url" resource="http://pizza.example.com/"></span>
>>> </div>
>>> </div>
>>> </div>
>>>        
>> I like the general idea, but how about reusing typeof instead:
>>
>> <div typeof="http://www.w3.org/2006/vcard/ns#VCard" about="#BusinessEntity">
>>    <div property="fn">L'Amourita Pizza</div>
>>    <div rel="adr">
>>      <div typeof="Address">
>>        <span property="street-address">2040 Any Street</span>,
>>        <span property="locality">Springfield</span>,
>>        <span property="postal-code">98102</span>.
>>      </div>
>>    </div>
>>    Tel:<span property="tel">206-555-7242</span>.
>>    <span rel="url" resource="http://pizza.example.com/"></span>
>> </div>
>>
>> This should be pretty easy to make workable: whenever typeof contains a
>> full URI (CURIE versus URI can be determined by checking whether
>> xmlns:http has been declared yet), then it sets the default prefix (by
>> trimming back to the last non-QName character - in the example above
>> '#') for unprefixed tokens. In the case where typeof contains multiple
>> tokens (space-separated), then the first one wins.
>>
>> This may well be more author-friendly than external profiles; plus it's
>> going to make parsing a bit faster, not needing to dereference external
>> files.
>>
>>      
>    


-- 
Martin McEvoy
Received on Friday, 19 March 2010 12:22:24 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Friday, 27 April 2012 04:55:06 GMT