[Top][All Lists]

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

[DotGNU]RDF Query Language

From: Peter Minten
Subject: [DotGNU]RDF Query Language
Date: Tue, 25 Mar 2003 18:21:42 +0100

Hi folks,

for the GNU.RDF project ( an RDF Query Language (RQL)
is needed. Here's what I have in mind. A query consists of roughly 2 parts: the
actual query and metadata about the query. The query metadata can be used to
notify the RDF server of things, like that only the local store of the RDF
server should be searched and not the complete semantic web. RQL resources have
one property query that contains the complete text of the query, all other
properties are metadata. The output of an RDF query is the wanted RDF.

The query text looks like SQL. A RDF resource with properties can be thought of
as a tuple (table row), the columns being the properties. A property bag (a
property that has as value a bag) can be thought of as a table with one column
(the property) and many rows, the cells containing the value of the elements of
the bag. All RDF containers and collections are represented this way. Note that
in the resource type bag the order of the tuples is unspecified (because it's
irrelevant). A RDF resource with beside other properties a sequence can be
thought of as a table with on each row the same values for the
non-container/collection properties and another value for the sequence property.
Logical consequence of this is that when there a resource has two bags as
property values the table can get quite big (sizeof(bag1)*sizeof(bag2)).

Now to some syntax. The first difference from SQL is ALIAS, which is a
pre-processor directive that works just like in C, it allows using simple names
instead of uri's, note that ALIAS does not bluntly replace every occurence of a
string, it only replaces if the string completely matches. Before sending the
RQL to the server the client pre-processes.

The basic SELECT operation goes like this:
SELECT propertynames
FROM resourceclassnames
WHERE condition
GROUP BY propertynames
HAVING condition

An example:
ALIAS rdf;

SELECT dc:creator
FROM rdf:Description
WHERE dc:language = "english";

This query returns all the resources from class rdf:Description
( that have as language
English and it returns the creator of those descriptions.

That's the general idea, any comments before I develop this further?



reply via email to

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