Advertisement
Guest User

benji

a guest
Jun 10th, 2008
666
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.32 KB | None | 0 0
  1. @@ SPARQLScript
  2. BASE <http://sparqlbot.semsol.org/data/>
  3. PREFIX dc: <http://purl.org/dc/elements/1.1/>
  4.  
  5. # set the endpoint
  6. ENDPOINT <endpoint.php>
  7.  
  8. # feed still fresh?
  9. $current = ASK FROM <graph-updates> WHERE {
  10. <http://planetrdf.com/index.rdf> dc:date ?date .
  11. FILTER (?date > ${now-1h})
  12. }
  13.  
  14. # refresh feed and update graph log
  15. IF (!$current) {
  16. DELETE FROM <http://planetrdf.com/index.rdf>
  17. LOAD <http://planetrdf.com/index.rdf>
  18. INSERT INTO <graph-updates> { <http://planetrdf.com/index.rdf> dc:date "${now}" }
  19. }
  20.  
  21. @@ Parsed Structure
  22. Array
  23. (
  24. [0] => Array
  25. (
  26. [type] => endpoint_decl
  27. [endpoint] => http://sparqlbot.semsol.org/data/endpoint.php
  28. )
  29.  
  30. [1] => Array
  31. (
  32. [type] => assignment
  33. [var] => Array
  34. (
  35. [value] => current
  36. [type] => var
  37. )
  38.  
  39. [sub_type] => query
  40. [query] => Array
  41. (
  42. [base] => http://sparqlbot.semsol.org/data/
  43. [vars] => Array
  44. (
  45. [0] => date
  46. )
  47.  
  48. [prefixes] => Array
  49. (
  50. [rdf:] => http://www.w3.org/1999/02/22-rdf-syntax-ns#
  51. [rdfs:] => http://www.w3.org/2000/01/rdf-schema#
  52. [owl:] => http://www.w3.org/2002/07/owl#
  53. [xsd:] => http://www.w3.org/2001/XMLSchema#
  54. [dc:] => http://purl.org/dc/elements/1.1/
  55. )
  56.  
  57. [placeholders] => Array
  58. (
  59. [0] => now-1h
  60. )
  61.  
  62. [type] => query
  63. [query_type] => ask
  64. [query] => ASK FROM <graph-updates> WHERE {
  65. <http://planetrdf.com/index.rdf> dc:date ?date .
  66. FILTER (?date > ${now-1h})
  67. }
  68. )
  69.  
  70. )
  71.  
  72. [2] => Array
  73. (
  74. [type] => ifblock
  75. [condition] => Array
  76. (
  77. [value] => current
  78. [type] => var
  79. [operator] => !
  80. )
  81.  
  82. [blocks] => Array
  83. (
  84. [0] => Array
  85. (
  86. [base] => http://sparqlbot.semsol.org/data/
  87. [vars] => Array
  88. (
  89. )
  90.  
  91. [prefixes] => Array
  92. (
  93. [rdf:] => http://www.w3.org/1999/02/22-rdf-syntax-ns#
  94. [rdfs:] => http://www.w3.org/2000/01/rdf-schema#
  95. [owl:] => http://www.w3.org/2002/07/owl#
  96. [xsd:] => http://www.w3.org/2001/XMLSchema#
  97. [dc:] => http://purl.org/dc/elements/1.1/
  98. )
  99.  
  100. [type] => query
  101. [query_type] => delete
  102. [query] => DELETE FROM <http://planetrdf.com/index.rdf>
  103. )
  104.  
  105. [1] => Array
  106. (
  107. [base] => http://sparqlbot.semsol.org/data/
  108. [vars] => Array
  109. (
  110. )
  111.  
  112. [prefixes] => Array
  113. (
  114. [rdf:] => http://www.w3.org/1999/02/22-rdf-syntax-ns#
  115. [rdfs:] => http://www.w3.org/2000/01/rdf-schema#
  116. [owl:] => http://www.w3.org/2002/07/owl#
  117. [xsd:] => http://www.w3.org/2001/XMLSchema#
  118. [dc:] => http://purl.org/dc/elements/1.1/
  119. )
  120.  
  121. [type] => query
  122. [query_type] => load
  123. [query] => LOAD <http://planetrdf.com/index.rdf>
  124. )
  125.  
  126. [2] => Array
  127. (
  128. [base] => http://sparqlbot.semsol.org/data/
  129. [vars] => Array
  130. (
  131. )
  132.  
  133. [prefixes] => Array
  134. (
  135. [rdf:] => http://www.w3.org/1999/02/22-rdf-syntax-ns#
  136. [rdfs:] => http://www.w3.org/2000/01/rdf-schema#
  137. [owl:] => http://www.w3.org/2002/07/owl#
  138. [xsd:] => http://www.w3.org/2001/XMLSchema#
  139. [dc:] => http://purl.org/dc/elements/1.1/
  140. )
  141.  
  142. [type] => query
  143. [query_type] => insert
  144. [query] => INSERT INTO <graph-updates> { <http://planetrdf.com/index.rdf> dc:date "${now}" }
  145. )
  146.  
  147. )
  148.  
  149. )
  150.  
  151. )
  152.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement