The latest
ARC revision got two new features:
SPARQL Triggers and
MySQL function extensions for SPARQL.
SPARQL Triggers
Triggers in ARC were suggested by
Dan Brickley, who is experimenting with
dynamically populated/updated Group definitions. What you can effectively do now in ARC is associating custom trigger classes with SPARQL query types, which will then be automatically called after registered query types, for example to refresh inferred Graphs:
$config = array(
...
'store_triggers' => array(
/* register LOAD triggers */
'load' => array('updateFriendsList', 'crawlXFNLinks'),
),
);
$ep = ARC2::getStoreEndpoint($config);
$ep->go();
MySQL Extension Functions
Morten Frederiksen did it again. He sent in about 10 lines of code which he suggested to add to ARC's SQL rewriter. The effect? ARC suddenly has access to dozens of
MySQL functions. That's CONCAT, CURDATE, MD5, UNIX_TIMESTAMP, and many more. A
namespace for MySQL function URIs is now online, and queries look like this:
PREFIX mysql: <http://web-semantics.org/ns/mysql/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?person WHERE {
?person foaf:givenname ?n1 ;
foaf:family_name ?n2 .
FILTER (mysql:concat(?n1, " ", ?n2) = "Alec Tronnick") .
}
I talked a little bit more about these things with
Danny Ayers in a
recent podcast.
Comments and Trackbacks