Subject: Re: [SWIPL] [BUG] rdf_db declares bad rdfs namespace

From: Jan Wielemaker <[email-masked]>
Date: Wed, 7 Nov 2001 14:20:42 +0100

On Wed, 07 Nov 2001, Bijan Parsia wrote:
>On Tue, 6 Nov 2001, Jan Wielemaker wrote:
>
>[snip]
>> Code on the twiki web should be seen as examples, not maintained
>> libraries.
>
>Sure....uhm...does that mean you don't want us to dicuss them here?

This depends.  For the RDF stuff the answer is possitive, as it is
ongoing work for me.  Some other code there is not much more than an
abandoned or at least sleeping track.

The RDF stuff is there because quite some people appear to be using
SWI-Prolog for its RDF parser and it might be useful to share some code 
doing something to what comes out of the parser.  rdf_db.pl and rdfs.pl
are two libraries I'm using in current projects.  For neither though
I claim the API is adequate or the implementation is complete.  I extend
them mostly on my needs and it would be nice if others did the same, so
eventually they become complete enough to incorporate into the normal
distribution.

>Should I avoid pointing to them from articles?

It's just fine to refer to them, but where appropriate, explain it is
just sample code.

>I'm working on a new XML.com article about SWI-Prolog and RDF, called
>"Expert System Backed Websites" (if anyone has a project that they'd like
>pointed to or highlighted in this article, please drop me a note!). Plan
>is to treat RSS1.0 + RDFS as a language for describing semantic networks.
>I'm not clear that rdfs.pl is actually going to be useful for this, though
>a modified version might be. (I still haven't gotten rdf_instance to
>recognize instances of subclasses.)

You've got to enumerate the subclasses first or later.  See
rdfs_domain/2.  Eventually there should be two calls, one for strictly
instance of this class and one for this class or a subclass thereof. 
The database probably needs some additional tables to make the latter
quick, given a large number of instances and classes.

>I note that the cache doesn't refresh if you add a class or subclass via
>rdf_assert, nor does it recognize that (just about) everything should be a
>member of rdfs:Resource. (All this is ok, this is just sample code, I
>know!)

There are other concerns.  The project I'm working with uses a large,
but fixed, set of schemas.  Trivial would be to add a call to flush the
cache.  Given the class structure in RDFS efficient caching an cache
updates are not really trivial.  I'd be glad if someone digs into this.

	Regards --- Jan