Guest User

Jena rules syntax testing by rdfman

a guest
Feb 11th, 2021
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.46 KB | None | 0 0
  1. @prefix my: <http://test/dream#> .
  2.  
  3.  
  4. # This is sample file of Jena rules. It tests the rule parser which currently fails on some single-char strings (the open parenthesis and the comma).
  5. # An error mention above a line of code means: when this line of code is outcommented then the error disappears.
  6.  
  7. # Note also the influence of quotes type (double or single).
  8.  
  9.  
  10.  
  11. # Rules including string "("
  12.  
  13.  
  14. # ok
  15. [ -> print('test jena!') ]
  16.  
  17. # FAIL: org.apache.jena.reasoner.rulesys.Rule$ParserException: Expected ')' at end of clause, found ]
  18. [(?a my:text "(") -> ]
  19.  
  20. # FAIL: org.apache.jena.reasoner.rulesys.Rule$ParserException: Malformed rule
  21. -> print("(").
  22.  
  23. # FAIL [before]: org.apache.jena.reasoner.rulesys.Rule$ParserException: Expected ')' at end of clause, found [
  24. # FAIL [now]: org.apache.jena.reasoner.rulesys.Rule$ParserException: Malformed rule
  25. -> print('(').
  26.  
  27. # FAIL: org.apache.jena.reasoner.rulesys.Rule$ParserException: Malformed rule
  28. [ -> print('(') ]
  29.  
  30. # ok (different char: closing parenthesis)
  31. -> print(')') .
  32.  
  33.  
  34.  
  35. # Rules including string ","
  36.  
  37.  
  38. # FAIL: org.apache.jena.reasoner.rulesys.Rule$ParserException: Malformed rule
  39. -> print(",").
  40.  
  41. # ok (note the different quotes)
  42. -> print(',').
  43.  
  44.  
  45.  
  46. # Rules including other single-character strings (no problems here)
  47.  
  48.  
  49. # ok
  50. -> print(".").
  51.  
  52. # ok
  53. -> print("->").
  54.  
  55. # ok
  56. -> print("[").
  57.  
  58. # ok
  59. -> print("]").
  60.  
  61. # ok
  62. -> print(":").
  63.  
  64. # ok
  65. -> print("?").
  66.  
  67.  
  68. # ok
  69. -> print("<<").
  70.    
  71.  
  72.  
Advertisement
Add Comment
Please, Sign In to add comment