BASE <http://sparqlbot.semsol.org/data/>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
# set the endpoint
ENDPOINT <endpoint.php>
# feed still fresh?
$current = ASK FROM <graph-updates> WHERE {
<http://planetrdf.com/index.rdf> dc:date ?date .
FILTER (?date > ${now-1h})
}
# refresh feed and update graph log
IF (!$current) {
DELETE FROM <http://planetrdf.com/index.rdf>
LOAD <http://planetrdf.com/index.rdf>
INSERT INTO <graph-updates> { <http://planetrdf.com/index.rdf> 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
Colm, ugh, no idea, sorry.