Re: can i do this with gss?

Edwin Shin wrote:

> first: thanks for the great work! isaviz is excellent.

Thank you!

> consider the following foaf excerpt:
> 
> <foaf:Person>
>    <foaf:name>Edwin Shin</foaf:name>
>    <foaf:img rdf:resource="http://example.com/picture.jpg"/>
>    <foaf:knows>
>       <foaf:Person>
>          <foaf:name>Emmanuel Pietriga</foaf:name>
>          <foaf:img rdf:resource="http://example.org/another.jpg"/>
>       </foaf:Person>
>    </foaf:knows>
> </foaf:Person>
> 
> what i would like to be able to do is use the image resource as the
> bitmap/icon representation of a person.
> 
> note that i'm not trying to use the same bitmap for all persons as is
> done in the stylesheet at
> http://www.w3.org/2001/11/IsaViz/gss/foaf/foaf.gss; but rather, use the
> image that is defined for each person. it's not clear to me if this kind
> can be accomplished with the selectors that are available in gss.

You can use a GSS style defining gss:icon=gss:Fetch to achieve something 
close to this. See the very end of section 5 of the user manual [1] for 
an example of use.

[1] http://www.w3.org/2001/11/IsaViz/gss/gssmanual.html#styles

However, this instruction only lets you assign the bitmap image as the 
node representation of the xxx.jpg resource itself. You cannot say that 
this image should be used to represent another node (in this context the 
node of type foaf:Person itself). This would indeed be a nice feature of 
GSS, but it is not supported yet. Note that this requires a significant 
extension of the language if we want to have something elegant (the 
language has to allow selection/extraction instructions in the 
right-hand side of rules, as with 'select' attributes in XPath + XSLT ; 
GSS is much closer to CSS (and thus less powerful than XSLT in this 
regard). I am considering significantly extending the language in the 
future, but whether I will be able to do that will depend on many 
criteria, the most important being where/for whom I will work.



> in fact, what would be nice is to cascade: 1) if a person has an img
> defined, use that, 2) otherwise, use a depiction if defined, or 3) use a
> default image, e.g.
> http://www.w3.org/2001/11/IsaViz/gss/foaf/person.png.

Yes, that's yet another (very interesting) step, again on the XPath/XSLT 
path (from the expressiveness point of view). I am considering this too.



> i have a similar case where i'd like to use an image (depiction) to
> represent a foaf:currentProject. here, too, i have not been successful
> in specifying a generic style that will use an image when
> available/defined.
> 
> finally, if i can make a suggestion regarding the gss manual: it would
> be helpful in the examples to include/link to the actual rdf stylesheets
> (in addition to the svg drawings).

Indeed. I will try to do that.

Thanks for the suggestions,
Emmanuel


-- 
Emmanuel Pietriga (epietriga@nuxeo.com)
http://claribole.net

Received on Monday, 7 June 2004 02:50:16 UTC