Re: [foaf-dev] Re: RDFa for HTML imagemap accessibility and clipart?

Hm. I looked at the first example of Kanzaki:

http://www.kanzaki.com/works/2005/imgdsc/www2005-1.rdf

to see how that would look in XHTML. There are, however, some problems 
which makes this example a bit difficult.

- One of the goals of using RDFa is to try to avoid repeating yourself. 
Ie, if something appears somewhere, then let us avoid being forced to 
repeat that elsewhere for the purpose of RDF. However, some of the data 
that is meant to appear in the RDF are the content of other HTML 
_attributes_ (like image width and height, coordinates of an area...). 
Those values are inaccessible for RDFa, so to say...

- This is also a bit special because <img> has a nasty restriction (from 
RDFa's point of view, that is) namely that in a valid XHTML it cannot 
have a child element. Ie, unless object is used, statements on the image 
URI should be repeated somewhere with the image URI as an @about.

*If* we ignored the restriction on <img>, the example could look 
something like:

  <map name="da8bb51_b" id="da8bb51_b">
 <area id="area1"
   shape="POLY"
   coords="XXXX,YYYY..."
   href="http://danbri.org/" />
 <area id="area2"
   shape="POLY"
   coords="AAAA,BBBB..."
   href="http://danbri.org/" />
    </map>
    <img src="2169955372_503da8bb51_b.jpg" instanceof="foaf:Image">
      width="1024" height="770" usemap="#da8bb51_b">
      <span property="image:width" content="1024"/>
      <span property="image:height" content="770"/>
      <span rel="foaf:hasPart">
        <span about="#area1" instanceof="image:Rectangle">
           <span property="dc:title">Zac</span>
           <span property="dc:description">Zac taking a photo of
              lunch box</span>
           <span property="image:points">XXXX,YYYY...</span>
         </span>
         <span about="#area2" instanceof="image:Rectangle">
           <span property="dc:title">masaka</span>
           <span property="dc:description">masaka holds a cameraphone
             with a lunch box on his knee</span>
           <span property="image:points">AAAA,BBBB...</span>
         </span>
       </span>
     </img> 

Which is, of course, a more or less verbatim copy of the rdf code. (You 
could use @content if you do not want those values like 'Zac' and 
'masaka' displayed). If you want valid XHTML, an alternative is to use 
<object> which allows a child element.

However... as I said, there *is* a need to repeat the attribute values 
which, in some ways, beats to purpose of using RDFa for this particular 
example. For larger scale deployment a GRDDL based approach might be 
better for this...

Ivan

Dan Brickley wrote:
> On 07/01/2008, Ivan Herman <ivan@w3.org> wrote:
>> Danbri,
>>
>> I have to run, so I cannot really dig into details, but I am happy to
>> look at it tomorrow. However....
>>
>> - can you give me some more detailed turtle code of what else you would
>> like to have?
>> - I used the latest spec version which is not yet documented and I am
>> not sure Ben's code implements it fully. I have an implementation
>> running on my machine, that is what I used...
>>
> 
> Sure, there's a great demo from Masahide Kanzaki here -
> http://www.kanzaki.com/works/2005/imgdsc/0510sparql-area.html
> 
> The SPARQL'ing is not working currently, as Leigh lost a domain name
> (but it should be back up soon). You can see the SPARQL patterns and
> data files all linked there.
> 
> Is that enough to be going along with?
> 
> cheers,
> 
> Dan
> 
> 
> 
>> Ivan
>>
>> Dan Brickley wrote:
>>> Ivan Herman wrote:
>>>> I made a run at it; it is actually pretty close to Niklas' second
>>>> version.
>>> Thanks Ivan, Niklas, Karl, ...
>>>
>>> We're getting there!
>>>
>>>> What I guess you wanted to achieve was:
>>>>
>>>> _:a a foaf:Person;
>>>>     foaf:name "Dan Brickley".
>>>> <#area> ex:depicts _:a.
>>>> <http://danbri.org> foaf:primaryTopic :_a.
>>> Yup, but I was hoping also to get the details of the area and the image
>>> URL into triples too, so a SPARQL store can be a self-contained
>>> photographic addressbook / clipart db.
>>>
>>> I put your example into http://danbri.org/2008/imagemap/ivan.html and
>>> ran the latest GetN3 .js bookmarklet on it. Results:
>>>
>>> _:n0 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
>>> <http://xmlns.com/foaf/0.1/Person> .
>>> _:n0 <http://xmlns.com/foaf/0.1/name> "Dan Brickley"@en .
>>>
>>> <http://danbri.org/2008/imagemap/ivan.html#area1>
>>> <http://xmlns.com/foaf/0.1/depicts> _:n0 .
>>>
>>>
>>> hmm it's not getting the primaryTopic. Maybe the .js is out of date?
>>>
>>> Some candidate goals:
>>>
>>> * look as much like current HTML as possible
>>> * work with multiple tagged areas
>>> * allow enough info to be exposed via triples to reconstruct the shapes
>>> over the mapped image from the RDF
>>>
>>>> According to the latest status of the group's discussions (not the
>>>> syntax document as published, though), the following encoding does the
>>>> trick:
>>>>
>>>> <div instanceof="foaf:Person"
>>>>   property="foaf:name" content="Dan Brickley">
>>>>   <map name="da8bb51_b" id="da8bb51_b">
>>>>     <area id="area1"
>>>>       shape="POLY" coords="463,662,..."
>>>>       rev="foaf:primaryTopic" href="http://danbri.org/"/>
>>>>   </map>
>>>>   <span rev="foaf:depicts" resource="#area1"/>
>>>>   <img src="2169955372_503da8bb51_b.jpg"
>>>>      width="1024" height="770" usemap="#da8bb51_b"/>
>>>> </div>
>>>>
>>>> The reason why a separate <span> is necessary is because for many use
>>>> cases the special interpretation of @src is necessary, and does get a
>>>> special usage in RDFa (essentially, it behaves like an @about). That is
>>> So we can get triples that use the URI from src somehow?
>>>
>>>> why the @rev and @resource pair could not be put on the <img> element.
>>>> If, instead of <img> you had used something like <object>, for
>>>> example, then you could also have
>>>>
>>>> <div instanceof="foaf:Person"
>>>>   property="foaf:name" content="Dan Brickley">
>>>>   <map name="da8bb51_b" id="da8bb51_b">
>>>>     <area id="area1"
>>>>       shape="POLY" coords="463,662,..."
>>>>       rev="foaf:primaryTopic" href="http://danbri.org/"/>
>>>>   </map>
>>>>   <object data="2169955372_503da8bb51_b.jpg"
>>>>      width="1024" height="770" usemap="#da8bb51_b"
>>>>      rev="foaf:depicts" resource="#area1"
>>>>   />
>>>> </div>
>>>>
>>>> which is, actually, quite nice!
>>> Is it legit to use <object>? do browsers understand it appropriately in
>>> this context?
>>>
>>> cheers,
>>>
>>> Dan
>> --
>>
>> 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
>>
>> _______________________________________________
>> foaf-dev mailing list
>> foaf-dev@lists.foaf-project.org
>> http://lists.foaf-project.org/mailman/listinfo/foaf-dev
>>
>>

-- 

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

Received on Tuesday, 8 January 2008 10:52:37 UTC