finally a bnode with a uri

SPARQLScript Teaser

Basic support for variable assignments, placeholders, IF branches
I just managed to trick my experimental SPARQLScript parser into accepting simple IF-branches and placeholders. Here is an example of what is going to be possible with ARC soon (and yes, I know this snippet most probably won't excite anyone but me ;)
PREFIX dc: <>

# set the endpoint
ENDPOINT <endpoint.php>

# feed still fresh?
$current = ASK FROM <graph-updates> WHERE {
  <> dc:date ?date .
  FILTER (?date > ${now-1h})

# refresh feed and update graph log
IF (!$current) {
  LOAD <>
  INSERT INTO <graph-updates> { <> dc:date "${now}" }
(Parsed Structure)

The fun thing about the whole SPARQLScript experiment is that the parser (so far) is still below 200 LOC. A lot can be re-used from the official SPARQL Grammar, e.g. IF-blocks are really just:
Script ::= ( Query | PrefixDecl | EndpointDecl | Assignment | IFBlock )*
IFBlock ::= 'IF' BrackettedExpression '{' Script '}'

Implementing the actual SPARQLScript processing engine is of course more work than the parser, but I'm making progress there, too.

Comments and Trackbacks

How does sparql compare with the "toy" language in chap. 4 of sicp? see: .
Comment by Colm Kennedy on 2008-06-11 11:38:37 UTC
Very cool bengee!
Comment by Keith Alexander on 2008-06-11 13:26:07 UTC
Keith, Thanks :)
Colm, ugh, no idea, sorry.
Comment by Benjamin Nowack on 2008-06-11 15:07:05 UTC
0 comments are currently in the approval queue.

Comments are disabled for this post.

Later Posts


No Posts found