dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

((TODO)) Re: [DotGNU]GNU.RDF update 29-3-2003


From: Peter Minten
Subject: ((TODO)) Re: [DotGNU]GNU.RDF update 29-3-2003
Date: Tue, 01 Apr 2003 09:34:41 +0200

Peter Minten wrote:
> 
> Hi folks,
> 
> on the agenda of GNU.RDF this week:
> * Getting GNU.RDF.QL designed.
> * Getting the API designed.
> 
> I will take care of GNU.RDF.QL .

Some new stuff. First of all a correction. 

INSERT http://dotgnu.org/people/PeterMinten as contact:person 
PROPERTIES (contact:fullName, contact:mailbox)
PROPERTYTYPES (*, xsd:string)
VALUES ("Peter Minten", "mailto:address@hidden";);

Should be:

INSERT (contact:fullName, contact:mailbox)
INTO http://dotgnu.org/people/PeterMinten
PROPERTYTYPES (*, xsd:string)
VALUES ("Peter Minten", "mailto:address@hidden";);

Which is much closer to SQL, and looks a lot better. Note that if * in
PROPERTYTYPES is given the system tries to resolve the datatype based on
ontology information if present.

The INSERT operation is now reserved for adding resource properties, it does not
create resources (well actually it can be used to create resources, but there is
a better way to do that). It's possible to create resources with the CREATE
RESOURCE operation (kinda like CREATE TABLE in SQL):

CREATE RESOURCE http://dotgnu.org/people/PeterMinten
TYPE contact:person
LABEL "Peter Minten";

This creates a number of triples containing the usual resource overhead like
type and label. This method is actually just an INSERT operation in disquise,
but it's a lot clearer.

Now onto the really cool stuff.

SQL has PL/SQL for the complicated work. I don't like PL/SQL, it's ugly,
inconsistent and hard to program in. That's why I'm using (Guile) Scheme as the
primary language for GNU.RDF.QL extension.

You can escape to Scheme mode by typing 'BEGIN Scheme SCRIPT'. You can end
Scheme mode by typing 'END Scheme SCRIPT;'. Note the semicolon, it's used only
at END because the whole 'BEGIN lang SCRIPT ... END lang SCRIPT' is technically
one GNU.RDF.QL statement. It may be possible in the future to use other
languages than Scheme, in that case you can simply substitute Scheme with the
name of the wanted language.

Inside Scheme it's possible to execute GNU.RDF.QL queries using the
exec-rdf-query function. The function returns either a single value (in the case
of for example SELECT COUNT(*) ...), or a table. I've yet to work out the Scheme
representation of the table.

Greetings,

Peter



reply via email to

[Prev in Thread] Current Thread [Next in Thread]