Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @@ SPARQLScript
- 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
- Array
- (
- [0] => Array
- (
- [type] => endpoint_decl
- [endpoint] => http://sparqlbot.semsol.org/data/endpoint.php
- )
- [1] => Array
- (
- [type] => assignment
- [var] => Array
- (
- [value] => current
- [type] => var
- )
- [sub_type] => query
- [query] => Array
- (
- [base] => http://sparqlbot.semsol.org/data/
- [vars] => Array
- (
- [0] => date
- )
- [prefixes] => Array
- (
- [rdf:] => http://www.w3.org/1999/02/22-rdf-syntax-ns#
- [rdfs:] => http://www.w3.org/2000/01/rdf-schema#
- [owl:] => http://www.w3.org/2002/07/owl#
- [xsd:] => http://www.w3.org/2001/XMLSchema#
- [dc:] => http://purl.org/dc/elements/1.1/
- )
- [placeholders] => Array
- (
- [0] => now-1h
- )
- [type] => query
- [query_type] => ask
- [query] => ASK FROM <graph-updates> WHERE {
- <http://planetrdf.com/index.rdf> dc:date ?date .
- FILTER (?date > ${now-1h})
- }
- )
- )
- [2] => Array
- (
- [type] => ifblock
- [condition] => Array
- (
- [value] => current
- [type] => var
- [operator] => !
- )
- [blocks] => Array
- (
- [0] => Array
- (
- [base] => http://sparqlbot.semsol.org/data/
- [vars] => Array
- (
- )
- [prefixes] => Array
- (
- [rdf:] => http://www.w3.org/1999/02/22-rdf-syntax-ns#
- [rdfs:] => http://www.w3.org/2000/01/rdf-schema#
- [owl:] => http://www.w3.org/2002/07/owl#
- [xsd:] => http://www.w3.org/2001/XMLSchema#
- [dc:] => http://purl.org/dc/elements/1.1/
- )
- [type] => query
- [query_type] => delete
- [query] => DELETE FROM <http://planetrdf.com/index.rdf>
- )
- [1] => Array
- (
- [base] => http://sparqlbot.semsol.org/data/
- [vars] => Array
- (
- )
- [prefixes] => Array
- (
- [rdf:] => http://www.w3.org/1999/02/22-rdf-syntax-ns#
- [rdfs:] => http://www.w3.org/2000/01/rdf-schema#
- [owl:] => http://www.w3.org/2002/07/owl#
- [xsd:] => http://www.w3.org/2001/XMLSchema#
- [dc:] => http://purl.org/dc/elements/1.1/
- )
- [type] => query
- [query_type] => load
- [query] => LOAD <http://planetrdf.com/index.rdf>
- )
- [2] => Array
- (
- [base] => http://sparqlbot.semsol.org/data/
- [vars] => Array
- (
- )
- [prefixes] => Array
- (
- [rdf:] => http://www.w3.org/1999/02/22-rdf-syntax-ns#
- [rdfs:] => http://www.w3.org/2000/01/rdf-schema#
- [owl:] => http://www.w3.org/2002/07/owl#
- [xsd:] => http://www.w3.org/2001/XMLSchema#
- [dc:] => http://purl.org/dc/elements/1.1/
- )
- [type] => query
- [query_type] => insert
- [query] => INSERT INTO <graph-updates> { <http://planetrdf.com/index.rdf> dc:date "${now}" }
- )
- )
- )
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement