W3C home > Mailing lists > Public > www-rdf-interest@w3.org > October 2001

Re: trees

From: Geoff Chappell <geoff@sover.net>
Date: Tue, 23 Oct 2001 17:09:39 -0400
Message-ID: <00e601c15c07$07cc98e0$0400a8c0@GSC866>
To: "Danny Ayers" <danny@isacat.net>, "RDF-Interest" <www-rdf-interest@w3.org>
Not sure if this is what you're looking for - could be overkill for a lot of
trees...

I've used dom-like properties to pull html and xml into rdf (usually for
further processing via rules into a richer schema). For example:

<html><body><p>some text</p></body></html>

becomes (in rdfql triple syntax)

{[rdf:type] [node:001] [x:element]}
{[x:tagName] [node:001] 'html'}
{[x:firstChild] [node:001] [node:002]}
{[rdf:type] [node:002] [x:element]}
{[x:tagName] [node:002] 'body'}
...

I use properties like nextSibling to keep order.  I usually define other
properties via rules (innerText, parentNode, ancestor, etc.) but you could
of course make them explicit. I also usually point "null" values to
something specific like [x:nil] to avoid having to use negation in rules (so
if a node has no nextSibling, nextSibling has a value of [x:nil] for that
node}.

I originally used daml lists for children which made some of the rules
easier but made for less intuitive node-walking.

geoff chappell


----- Original Message -----
From: "Danny Ayers" <danny@isacat.net>
To: "RDF-Interest" <www-rdf-interest@w3.org>
Sent: 10/23/2001 4:42 PM
Subject: trees


> Has anyone here done or seen work about the general task of representing
> hierarchical structures in RDF - like DMOZ in practice?
> I would very much appreciate references to suchlike.
>
> Cheers,
> Danny.
>
> ---
> Danny Ayers
> http://www.isacat.net
>
> Alternate email (2001) :
> danny666@virgilio.it
> danny_ayers@yahoo.co.uk
Received on Tuesday, 23 October 2001 17:12:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 7 December 2009 10:51:52 GMT