Model Hacking

Volume 7, Issue 172; 04 Oct 2004; last modified 08 Oct 2010

I’ve been offline for several days, visiting with my folks, taking pictures, relaxing. I’ve also been hacking a bit with the way foaf:depicts is used on this site.

One who imitates what is bad always goes beyond his model; while one who imitates what is good always comes up short of it.

Francesco Guicciardini

I’ve been offline for several days, visiting with my folks, taking pictures, relaxing. I’ve also been hacking a bit with the way foaf:depicts is used on this site. Specifically, following some discussions on #foaf, I’ve been fixing a bug in my model.

Previously, if I took a picture of a rabbit, I modelled that relationship like this:

<rdf:Description rdf:about="http://norman.walsh.name/path/to/my/picture">
  <foaf:depicts rdf:resource="http://xmlns.com/wordnet/1.6/Rabbit"/>
</rdf:Description>

Technically, what that says is that my picture depicts the Wordnet word “Rabbit”. That’s not really what I mean.

What I really mean is that my picture depicts something that is a rabbit:

<rdf:Description rdf:about="http://norman.walsh.name/path/to/my/picture">
  <foaf:depicts rdf:nodeID="b1"/>
</rdf:Description>

<rdf:Description rdf:nodeID="b1">
  <rdf:type rdf:resource="http://xmlns.com/wordnet/1.6/Rabbit"/>
</rdf:Description>

(This being RDF, there are about six ways to serialize that relationship. For this essay, I’ve chosen to use one that emphasizes the anonymous resource. And as long as I’ve got a parenthetical gripe about RDF/XML syntax started, let me just add, why on earth is the attribute rdf:nodeID used for both the ID and the reference to that ID!?)

That change forced me to address the way picture metadata is formatted when you click the “Show Metadata” link for a picture. It also got me thinking that there should be an index of dipicted things and that turned out to be really hard to build. In fact, I haven’t succeeded yet.

RDFTwig doesn’t have the chops to “find all resources X that have a foaf:depicts property with the value Y that has the type Z.” And my implementation of RDQL in RDFTwig doesn’t allow XSLT instructions in the body of the query (what was I thinking?).

What does all this mean to you?

  1. I care. I really care. About the model, I mean. Nevermind, you probably don’t care anywhere near as much as I do (readers of #rdfig, #foaf, and other hard-core RDF modelers, all 17 of you, excepted, of course.).

  2. I’ve touched just about every picture on the site in order to update the metadata.

  3. Metadata display is in flux.

  4. I felt I needed to publish this essay today, since I’ve touched so much. What I really wanted to get published is the XML 1.1 essay I wrote on the plane a few days ago.

But mostly: Fear not, beautiful panoramic views of Cromer, more pub signs, two geocaches, and other random vacation thoughts and pictures will indeed show up here. Real soon now.

Comments

Jip, an attendee of the foafCamp, has a similiar photopage. He has a very impressive collection of depictions, annotated with WN. see f.e. http://www.kwark.org/Gfx/2004/2004Week40/dscn8438.BergEnDal.jpg.html perhaps you should discuss with him some mutual standard.... my 2 bits: x foaf:depicts y is easier than x foaf:depicts _ _ rdf:type y (more inference work, etc) but semantically you are right with the second go. so perhaps stick with it.

—Posted by Leo Sauermann on 04 Oct 2004 @ 07:36 UTC #

If the first relationship doesn't work, isn't the problem carried over into the revised version? i.e.
#1
rabbitPicture depicts rabbitWord
#2
rabbitPicture depicts _:bunny
_:bunny type rabbitWord
It's a bit early in the day here, so I could be way off the mark, but making the word resource into an rdfs:Class doesn't seem to add enough indirection. My first thought was perhaps:
#3
rabbitPicture depicts _:bunny
rabbitWord denotes _:bunny
But that still doesn't seem right somehow. I don't think its handling the Rabbit as class/species and Rabbit as instance/Benjamin Fluffytail thing properly. But then it starts getting a bit longwinded -
#4
picture depicts _:benji
rabbitWord denotes _:rabbit
_:benji type _:rabbit
Dunno. [I give up on the formatting too...]

—Posted by Danny on 04 Oct 2004 @ 09:02 UTC #

I share your concern, Danny, but the folks on #foaf seemed comfortable with a single level of indirection. It probably deserves more discussion, though.

—Posted by Norman Walsh on 04 Oct 2004 @ 11:11 UTC #

I needn't have been concerned: http://www.ilrt.bris.ac.uk/discovery/chatlogs/foaf/2004-10-04#T11-20-52

—Posted by Norman Walsh on 04 Oct 2004 @ 11:26 UTC #

Got it. Perhaps an amendment to "Technically, what that says is that my picture depicts the Wordnet word “Rabbit”." is in order..?

—Posted by Danny on 04 Oct 2004 @ 11:45 UTC #

...why on earth is the attribute rdf:nodeID used for both the ID and the reference to that ID!?

I guess you're thinking of id and idref here, but that's pretty different. What's happening is you're getting two statements:

<http://norman.walsh.name/path/to/my/picture> foaf:depicts _:b1 .

and

_:b1 rdf:type <http://xmlns.com/wordnet/1.6/Rabbit>

'b1' is a reference in both cases (well, an existentially quantified variable). Indeed literals are the only solid things in RDF, apart from them it's all refs.

(The weird case is rdf:about and rdf:resource, which are only different for historical reasons.)

—Posted by Damian on 04 Oct 2004 @ 02:19 UTC #