rdfa_parser 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (406) hide show
  1. data/.gitmodules +3 -0
  2. data/History.txt +11 -3
  3. data/VERSION +1 -1
  4. data/bin/rdfa_parser +0 -6
  5. data/lib/rdfa_parser/literal.rb +20 -9
  6. data/lib/rdfa_parser/namespace.rb +2 -2
  7. data/lib/rdfa_parser/rdfa_parser.rb +29 -8
  8. data/lib/rdfa_parser/triple.rb +2 -4
  9. data/spec/graph_spec.rb +3 -3
  10. data/spec/literal_spec.rb +12 -9
  11. data/spec/matchers.rb +6 -3
  12. data/spec/rdfa-triples/0001.nt +1 -0
  13. data/spec/rdfa-triples/0006.nt +2 -0
  14. data/spec/rdfa-triples/0007.nt +3 -0
  15. data/spec/rdfa-triples/0008.nt +1 -0
  16. data/spec/{xhtml1-testcases → rdfa-triples}/0009.nt +0 -0
  17. data/spec/{xhtml1-testcases → rdfa-triples}/0010.nt +0 -0
  18. data/spec/rdfa-triples/0011.nt +3 -0
  19. data/spec/{xhtml1-testcases → rdfa-triples}/0012.nt +0 -0
  20. data/spec/{xhtml1-testcases → rdfa-triples}/0013.nt +0 -0
  21. data/spec/{xhtml1-testcases → rdfa-triples}/0014.nt +0 -0
  22. data/spec/rdfa-triples/0015.nt +2 -0
  23. data/spec/{xhtml1-testcases → rdfa-triples}/0017.nt +0 -0
  24. data/spec/rdfa-triples/0018.nt +1 -0
  25. data/spec/{xhtml1-testcases → rdfa-triples}/0019.nt +0 -0
  26. data/spec/rdfa-triples/0020.nt +1 -0
  27. data/spec/rdfa-triples/0021.nt +1 -0
  28. data/spec/rdfa-triples/0023.nt +1 -0
  29. data/spec/rdfa-triples/0025.nt +2 -0
  30. data/spec/{xhtml1-testcases → rdfa-triples}/0026.nt +0 -0
  31. data/spec/{xhtml1-testcases → rdfa-triples}/0027.nt +0 -0
  32. data/spec/{xhtml1-testcases → rdfa-triples}/0029.nt +0 -0
  33. data/spec/rdfa-triples/0030.nt +1 -0
  34. data/spec/rdfa-triples/0031.nt +1 -0
  35. data/spec/rdfa-triples/0032.nt +1 -0
  36. data/spec/rdfa-triples/0033.nt +2 -0
  37. data/spec/{xhtml1-testcases → rdfa-triples}/0034.nt +0 -0
  38. data/spec/{xhtml1-testcases → rdfa-triples}/0035.nt +0 -0
  39. data/spec/{xhtml1-testcases → rdfa-triples}/0036.nt +0 -0
  40. data/spec/{xhtml1-testcases → rdfa-triples}/0037.nt +0 -0
  41. data/spec/{xhtml1-testcases → rdfa-triples}/0038.nt +0 -0
  42. data/spec/{xhtml1-testcases → rdfa-triples}/0039.nt +0 -0
  43. data/spec/{xhtml1-testcases → rdfa-triples}/0040.nt +0 -0
  44. data/spec/{xhtml1-testcases → rdfa-triples}/0041.nt +0 -0
  45. data/spec/{xhtml1-testcases → rdfa-triples}/0042.nt +0 -0
  46. data/spec/{xhtml1-testcases → rdfa-triples}/0046.nt +0 -0
  47. data/spec/{xhtml1-testcases → rdfa-triples}/0047.nt +0 -0
  48. data/spec/{xhtml1-testcases → rdfa-triples}/0048.nt +0 -0
  49. data/spec/{xhtml1-testcases → rdfa-triples}/0049.nt +0 -0
  50. data/spec/{xhtml1-testcases → rdfa-triples}/0050.nt +0 -0
  51. data/spec/rdfa-triples/0051.nt +2 -0
  52. data/spec/{xhtml1-testcases → rdfa-triples}/0052.nt +0 -0
  53. data/spec/{xhtml1-testcases → rdfa-triples}/0053.nt +0 -0
  54. data/spec/rdfa-triples/0054.nt +2 -0
  55. data/spec/rdfa-triples/0055.nt +2 -0
  56. data/spec/{xhtml1-testcases → rdfa-triples}/0056.nt +0 -0
  57. data/spec/{xhtml1-testcases → rdfa-triples}/0057.nt +0 -0
  58. data/spec/{xhtml1-testcases → rdfa-triples}/0058.nt +0 -0
  59. data/spec/rdfa-triples/0059.nt +6 -0
  60. data/spec/{xhtml1-testcases → rdfa-triples}/0060.nt +0 -0
  61. data/spec/rdfa-triples/0061.nt +1 -0
  62. data/spec/rdfa-triples/0062.nt +1 -0
  63. data/spec/rdfa-triples/0063.nt +1 -0
  64. data/spec/{xhtml1-testcases → rdfa-triples}/0064.nt +0 -0
  65. data/spec/{xhtml1-testcases → rdfa-triples}/0065.nt +0 -0
  66. data/spec/rdfa-triples/0066.nt +1 -0
  67. data/spec/rdfa-triples/0067.nt +1 -0
  68. data/spec/rdfa-triples/0068.nt +1 -0
  69. data/spec/rdfa-triples/0069.nt +1 -0
  70. data/spec/rdfa-triples/0070.nt +1 -0
  71. data/spec/rdfa-triples/0071.nt +1 -0
  72. data/spec/{xhtml1-testcases → rdfa-triples}/0072.nt +0 -0
  73. data/spec/{xhtml1-testcases → rdfa-triples}/0073.nt +0 -0
  74. data/spec/{xhtml1-testcases → rdfa-triples}/0074.nt +0 -0
  75. data/spec/{xhtml1-testcases → rdfa-triples}/0075.nt +0 -0
  76. data/spec/rdfa-triples/0076.nt +23 -0
  77. data/spec/rdfa-triples/0077.nt +23 -0
  78. data/spec/{xhtml1-testcases → rdfa-triples}/0078.nt +0 -0
  79. data/spec/{xhtml1-testcases → rdfa-triples}/0079.nt +0 -0
  80. data/spec/{xhtml1-testcases → rdfa-triples}/0080.nt +0 -0
  81. data/spec/{xhtml1-testcases → rdfa-triples}/0081.nt +0 -0
  82. data/spec/{xhtml1-testcases → rdfa-triples}/0082.nt +0 -0
  83. data/spec/{xhtml1-testcases → rdfa-triples}/0083.nt +0 -0
  84. data/spec/{xhtml1-testcases → rdfa-triples}/0084.nt +0 -0
  85. data/spec/{xhtml1-testcases → rdfa-triples}/0085.nt +0 -0
  86. data/spec/{xhtml1-testcases → rdfa-triples}/0086.nt +0 -0
  87. data/spec/rdfa-triples/0087.nt +23 -0
  88. data/spec/{xhtml1-testcases → rdfa-triples}/0088.nt +0 -0
  89. data/spec/{xhtml1-testcases → rdfa-triples}/0089.nt +0 -0
  90. data/spec/{xhtml1-testcases → rdfa-triples}/0090.nt +0 -0
  91. data/spec/{xhtml1-testcases → rdfa-triples}/0091.nt +0 -0
  92. data/spec/rdfa-triples/0092.nt +3 -0
  93. data/spec/rdfa-triples/0093.nt +2 -0
  94. data/spec/rdfa-triples/0094.nt +3 -0
  95. data/spec/{xhtml1-testcases → rdfa-triples}/0099.nt +0 -0
  96. data/spec/{xhtml1-testcases → rdfa-triples}/0100.nt +0 -0
  97. data/spec/{xhtml1-testcases → rdfa-triples}/0101.nt +0 -0
  98. data/spec/{xhtml1-testcases → rdfa-triples}/0102.nt +0 -0
  99. data/spec/{xhtml1-testcases → rdfa-triples}/0103.nt +0 -0
  100. data/spec/rdfa-triples/0104.nt +3 -0
  101. data/spec/rdfa-triples/0105.nt +1 -0
  102. data/spec/rdfa-triples/0106.nt +1 -0
  103. data/spec/{xhtml1-testcases → rdfa-triples}/0107.nt +0 -0
  104. data/spec/{xhtml1-testcases → rdfa-triples}/0108.nt +0 -0
  105. data/spec/rdfa-triples/0109.nt +1 -0
  106. data/spec/rdfa-triples/0110.nt +1 -0
  107. data/spec/rdfa-triples/0111.nt +2 -0
  108. data/spec/{xhtml1-testcases → rdfa-triples}/0112.nt +0 -0
  109. data/spec/rdfa-triples/0113.nt +2 -0
  110. data/spec/rdfa-triples/0114.nt +3 -0
  111. data/spec/rdfa-triples/0115.nt +4 -0
  112. data/spec/rdfa-triples/0116.nt +2 -0
  113. data/spec/{xhtml1-testcases → rdfa-triples}/0117.nt +0 -0
  114. data/spec/rdfa-triples/0118.nt +1 -0
  115. data/spec/{xhtml1-testcases → rdfa-triples}/0119.nt +0 -0
  116. data/spec/{xhtml1-testcases → rdfa-triples}/0120.nt +0 -0
  117. data/spec/{xhtml1-testcases → rdfa-triples}/0121.nt +0 -0
  118. data/spec/{xhtml1-testcases → rdfa-triples}/0122.nt +0 -0
  119. data/spec/{xhtml1-testcases → rdfa-triples}/0123.nt +0 -0
  120. data/spec/{xhtml1-testcases → rdfa-triples}/0124.nt +0 -0
  121. data/spec/{xhtml1-testcases → rdfa-triples}/0125.nt +0 -0
  122. data/spec/{xhtml1-testcases → rdfa-triples}/0126.nt +0 -0
  123. data/spec/rdfa-triples/1001.nt +6 -0
  124. data/spec/rdfa_helper.rb +131 -19
  125. data/spec/rdfa_parser_spec.rb +42 -25
  126. data/spec/triple_spec.rb +0 -19
  127. data/spec/xhtml1-testcases/9997.xhtml +11 -0
  128. metadata +116 -346
  129. data/spec/html4-testcases/0011.html +0 -13
  130. data/spec/html5-testcases/0011.html +0 -13
  131. data/spec/xhtml1-testcases/.sparql +0 -13
  132. data/spec/xhtml1-testcases/0001.nt +0 -1
  133. data/spec/xhtml1-testcases/0001.sparql +0 -3
  134. data/spec/xhtml1-testcases/0001.xhtml +0 -11
  135. data/spec/xhtml1-testcases/0002.sparql +0 -3
  136. data/spec/xhtml1-testcases/0003.sparql +0 -3
  137. data/spec/xhtml1-testcases/0006.nt +0 -2
  138. data/spec/xhtml1-testcases/0006.sparql +0 -8
  139. data/spec/xhtml1-testcases/0006.xhtml +0 -16
  140. data/spec/xhtml1-testcases/0007.nt +0 -3
  141. data/spec/xhtml1-testcases/0007.sparql +0 -5
  142. data/spec/xhtml1-testcases/0007.xhtml +0 -16
  143. data/spec/xhtml1-testcases/0008.nt +0 -1
  144. data/spec/xhtml1-testcases/0008.sparql +0 -3
  145. data/spec/xhtml1-testcases/0008.xhtml +0 -16
  146. data/spec/xhtml1-testcases/0009.sparql +0 -3
  147. data/spec/xhtml1-testcases/0009.xhtml +0 -14
  148. data/spec/xhtml1-testcases/0010.sparql +0 -4
  149. data/spec/xhtml1-testcases/0010.xhtml +0 -13
  150. data/spec/xhtml1-testcases/0011.nt +0 -3
  151. data/spec/xhtml1-testcases/0011.sparql +0 -17
  152. data/spec/xhtml1-testcases/0011.xhtml +0 -14
  153. data/spec/xhtml1-testcases/0012.sparql +0 -3
  154. data/spec/xhtml1-testcases/0012.xhtml +0 -12
  155. data/spec/xhtml1-testcases/0013.sparql +0 -3
  156. data/spec/xhtml1-testcases/0013.xhtml +0 -12
  157. data/spec/xhtml1-testcases/0014.sparql +0 -3
  158. data/spec/xhtml1-testcases/0014.xhtml +0 -15
  159. data/spec/xhtml1-testcases/0015.nt +0 -2
  160. data/spec/xhtml1-testcases/0015.sparql +0 -4
  161. data/spec/xhtml1-testcases/0015.xhtml +0 -13
  162. data/spec/xhtml1-testcases/0017.sparql +0 -6
  163. data/spec/xhtml1-testcases/0017.xhtml +0 -16
  164. data/spec/xhtml1-testcases/0018.nt +0 -1
  165. data/spec/xhtml1-testcases/0018.sparql +0 -3
  166. data/spec/xhtml1-testcases/0018.xhtml +0 -17
  167. data/spec/xhtml1-testcases/0019.sparql +0 -3
  168. data/spec/xhtml1-testcases/0019.xhtml +0 -14
  169. data/spec/xhtml1-testcases/0020.nt +0 -1
  170. data/spec/xhtml1-testcases/0020.sparql +0 -3
  171. data/spec/xhtml1-testcases/0020.xhtml +0 -17
  172. data/spec/xhtml1-testcases/0021.nt +0 -1
  173. data/spec/xhtml1-testcases/0021.sparql +0 -3
  174. data/spec/xhtml1-testcases/0021.xhtml +0 -17
  175. data/spec/xhtml1-testcases/0023.nt +0 -1
  176. data/spec/xhtml1-testcases/0023.sparql +0 -3
  177. data/spec/xhtml1-testcases/0023.xhtml +0 -16
  178. data/spec/xhtml1-testcases/0025.nt +0 -2
  179. data/spec/xhtml1-testcases/0025.sparql +0 -4
  180. data/spec/xhtml1-testcases/0025.xhtml +0 -19
  181. data/spec/xhtml1-testcases/0026.sparql +0 -3
  182. data/spec/xhtml1-testcases/0026.xhtml +0 -16
  183. data/spec/xhtml1-testcases/0027.sparql +0 -3
  184. data/spec/xhtml1-testcases/0027.xhtml +0 -17
  185. data/spec/xhtml1-testcases/0029.sparql +0 -3
  186. data/spec/xhtml1-testcases/0029.xhtml +0 -17
  187. data/spec/xhtml1-testcases/0030.nt +0 -1
  188. data/spec/xhtml1-testcases/0030.sparql +0 -3
  189. data/spec/xhtml1-testcases/0030.xhtml +0 -16
  190. data/spec/xhtml1-testcases/0031.nt +0 -1
  191. data/spec/xhtml1-testcases/0031.sparql +0 -3
  192. data/spec/xhtml1-testcases/0031.xhtml +0 -14
  193. data/spec/xhtml1-testcases/0032.nt +0 -1
  194. data/spec/xhtml1-testcases/0032.sparql +0 -3
  195. data/spec/xhtml1-testcases/0032.xhtml +0 -15
  196. data/spec/xhtml1-testcases/0033.nt +0 -2
  197. data/spec/xhtml1-testcases/0033.sparql +0 -5
  198. data/spec/xhtml1-testcases/0033.xhtml +0 -19
  199. data/spec/xhtml1-testcases/0034.sparql +0 -3
  200. data/spec/xhtml1-testcases/0034.xhtml +0 -14
  201. data/spec/xhtml1-testcases/0035.sparql +0 -3
  202. data/spec/xhtml1-testcases/0035.xhtml +0 -17
  203. data/spec/xhtml1-testcases/0036.sparql +0 -3
  204. data/spec/xhtml1-testcases/0036.xhtml +0 -17
  205. data/spec/xhtml1-testcases/0037.sparql +0 -3
  206. data/spec/xhtml1-testcases/0037.xhtml +0 -18
  207. data/spec/xhtml1-testcases/0038.sparql +0 -3
  208. data/spec/xhtml1-testcases/0038.xhtml +0 -14
  209. data/spec/xhtml1-testcases/0039.sparql +0 -3
  210. data/spec/xhtml1-testcases/0039.xhtml +0 -17
  211. data/spec/xhtml1-testcases/0040.sparql +0 -3
  212. data/spec/xhtml1-testcases/0040.xhtml +0 -16
  213. data/spec/xhtml1-testcases/0041.sparql +0 -3
  214. data/spec/xhtml1-testcases/0041.xhtml +0 -18
  215. data/spec/xhtml1-testcases/0042.sparql +0 -4
  216. data/spec/xhtml1-testcases/0042.xhtml +0 -15
  217. data/spec/xhtml1-testcases/0046.sparql +0 -6
  218. data/spec/xhtml1-testcases/0046.xhtml +0 -13
  219. data/spec/xhtml1-testcases/0047.sparql +0 -6
  220. data/spec/xhtml1-testcases/0047.xhtml +0 -13
  221. data/spec/xhtml1-testcases/0048.sparql +0 -6
  222. data/spec/xhtml1-testcases/0048.xhtml +0 -14
  223. data/spec/xhtml1-testcases/0049.sparql +0 -4
  224. data/spec/xhtml1-testcases/0049.xhtml +0 -14
  225. data/spec/xhtml1-testcases/0050.sparql +0 -5
  226. data/spec/xhtml1-testcases/0050.xhtml +0 -14
  227. data/spec/xhtml1-testcases/0051.nt +0 -2
  228. data/spec/xhtml1-testcases/0051.sparql +0 -4
  229. data/spec/xhtml1-testcases/0051.xhtml +0 -12
  230. data/spec/xhtml1-testcases/0052.sparql +0 -3
  231. data/spec/xhtml1-testcases/0052.xhtml +0 -13
  232. data/spec/xhtml1-testcases/0053.sparql +0 -4
  233. data/spec/xhtml1-testcases/0053.xhtml +0 -13
  234. data/spec/xhtml1-testcases/0054.nt +0 -2
  235. data/spec/xhtml1-testcases/0054.sparql +0 -4
  236. data/spec/xhtml1-testcases/0054.xhtml +0 -14
  237. data/spec/xhtml1-testcases/0055.nt +0 -2
  238. data/spec/xhtml1-testcases/0055.sparql +0 -4
  239. data/spec/xhtml1-testcases/0055.xhtml +0 -16
  240. data/spec/xhtml1-testcases/0056.sparql +0 -5
  241. data/spec/xhtml1-testcases/0056.xhtml +0 -13
  242. data/spec/xhtml1-testcases/0057.sparql +0 -6
  243. data/spec/xhtml1-testcases/0057.xhtml +0 -14
  244. data/spec/xhtml1-testcases/0058.sparql +0 -9
  245. data/spec/xhtml1-testcases/0058.xhtml +0 -14
  246. data/spec/xhtml1-testcases/0059.nt +0 -6
  247. data/spec/xhtml1-testcases/0059.sparql +0 -8
  248. data/spec/xhtml1-testcases/0059.xhtml +0 -16
  249. data/spec/xhtml1-testcases/0060.sparql +0 -4
  250. data/spec/xhtml1-testcases/0060.xhtml +0 -14
  251. data/spec/xhtml1-testcases/0061.nt +0 -1
  252. data/spec/xhtml1-testcases/0061.sparql +0 -3
  253. data/spec/xhtml1-testcases/0061.xhtml +0 -11
  254. data/spec/xhtml1-testcases/0062.nt +0 -1
  255. data/spec/xhtml1-testcases/0062.sparql +0 -3
  256. data/spec/xhtml1-testcases/0062.xhtml +0 -12
  257. data/spec/xhtml1-testcases/0063.nt +0 -1
  258. data/spec/xhtml1-testcases/0063.sparql +0 -3
  259. data/spec/xhtml1-testcases/0063.xhtml +0 -11
  260. data/spec/xhtml1-testcases/0064.sparql +0 -4
  261. data/spec/xhtml1-testcases/0064.xhtml +0 -13
  262. data/spec/xhtml1-testcases/0065.sparql +0 -6
  263. data/spec/xhtml1-testcases/0065.xhtml +0 -22
  264. data/spec/xhtml1-testcases/0066.nt +0 -1
  265. data/spec/xhtml1-testcases/0066.sparql +0 -3
  266. data/spec/xhtml1-testcases/0066.xhtml +0 -11
  267. data/spec/xhtml1-testcases/0067.nt +0 -1
  268. data/spec/xhtml1-testcases/0067.sparql +0 -3
  269. data/spec/xhtml1-testcases/0067.xhtml +0 -11
  270. data/spec/xhtml1-testcases/0068.nt +0 -1
  271. data/spec/xhtml1-testcases/0068.sparql +0 -3
  272. data/spec/xhtml1-testcases/0068.xhtml +0 -14
  273. data/spec/xhtml1-testcases/0069.nt +0 -1
  274. data/spec/xhtml1-testcases/0069.sparql +0 -3
  275. data/spec/xhtml1-testcases/0069.xhtml +0 -14
  276. data/spec/xhtml1-testcases/0070.nt +0 -1
  277. data/spec/xhtml1-testcases/0070.sparql +0 -3
  278. data/spec/xhtml1-testcases/0070.xhtml +0 -13
  279. data/spec/xhtml1-testcases/0071.nt +0 -1
  280. data/spec/xhtml1-testcases/0071.sparql +0 -3
  281. data/spec/xhtml1-testcases/0071.xhtml +0 -16
  282. data/spec/xhtml1-testcases/0072.sparql +0 -3
  283. data/spec/xhtml1-testcases/0072.xhtml +0 -16
  284. data/spec/xhtml1-testcases/0073.sparql +0 -3
  285. data/spec/xhtml1-testcases/0073.xhtml +0 -16
  286. data/spec/xhtml1-testcases/0074.sparql +0 -3
  287. data/spec/xhtml1-testcases/0074.xhtml +0 -16
  288. data/spec/xhtml1-testcases/0075.sparql +0 -3
  289. data/spec/xhtml1-testcases/0075.xhtml +0 -16
  290. data/spec/xhtml1-testcases/0076.nt +0 -23
  291. data/spec/xhtml1-testcases/0076.sparql +0 -70
  292. data/spec/xhtml1-testcases/0076.xhtml +0 -35
  293. data/spec/xhtml1-testcases/0077.nt +0 -23
  294. data/spec/xhtml1-testcases/0077.sparql +0 -70
  295. data/spec/xhtml1-testcases/0077.xhtml +0 -58
  296. data/spec/xhtml1-testcases/0078.sparql +0 -7
  297. data/spec/xhtml1-testcases/0078.xhtml +0 -15
  298. data/spec/xhtml1-testcases/0079.sparql +0 -6
  299. data/spec/xhtml1-testcases/0079.xhtml +0 -15
  300. data/spec/xhtml1-testcases/0080.sparql +0 -3
  301. data/spec/xhtml1-testcases/0080.xhtml +0 -13
  302. data/spec/xhtml1-testcases/0081.sparql +0 -9
  303. data/spec/xhtml1-testcases/0081.xhtml +0 -15
  304. data/spec/xhtml1-testcases/0082.sparql +0 -11
  305. data/spec/xhtml1-testcases/0082.xhtml +0 -15
  306. data/spec/xhtml1-testcases/0083.sparql +0 -9
  307. data/spec/xhtml1-testcases/0083.xhtml +0 -15
  308. data/spec/xhtml1-testcases/0084.sparql +0 -11
  309. data/spec/xhtml1-testcases/0084.xhtml +0 -18
  310. data/spec/xhtml1-testcases/0085.sparql +0 -6
  311. data/spec/xhtml1-testcases/0085.xhtml +0 -17
  312. data/spec/xhtml1-testcases/0086.sparql +0 -4
  313. data/spec/xhtml1-testcases/0086.xhtml +0 -13
  314. data/spec/xhtml1-testcases/0087.nt +0 -23
  315. data/spec/xhtml1-testcases/0087.sparql +0 -70
  316. data/spec/xhtml1-testcases/0087.xhtml +0 -35
  317. data/spec/xhtml1-testcases/0088.sparql +0 -6
  318. data/spec/xhtml1-testcases/0088.xhtml +0 -14
  319. data/spec/xhtml1-testcases/0089.sparql +0 -3
  320. data/spec/xhtml1-testcases/0089.xhtml +0 -13
  321. data/spec/xhtml1-testcases/0090.sparql +0 -3
  322. data/spec/xhtml1-testcases/0090.xhtml +0 -16
  323. data/spec/xhtml1-testcases/0091.sparql +0 -6
  324. data/spec/xhtml1-testcases/0091.xhtml +0 -16
  325. data/spec/xhtml1-testcases/0092.nt +0 -3
  326. data/spec/xhtml1-testcases/0092.sparql +0 -16
  327. data/spec/xhtml1-testcases/0092.xhtml +0 -15
  328. data/spec/xhtml1-testcases/0093.nt +0 -2
  329. data/spec/xhtml1-testcases/0093.sparql +0 -4
  330. data/spec/xhtml1-testcases/0093.xhtml +0 -15
  331. data/spec/xhtml1-testcases/0094.nt +0 -3
  332. data/spec/xhtml1-testcases/0094.sparql +0 -16
  333. data/spec/xhtml1-testcases/0094.xhtml +0 -15
  334. data/spec/xhtml1-testcases/0099.sparql +0 -3
  335. data/spec/xhtml1-testcases/0099.xhtml +0 -20
  336. data/spec/xhtml1-testcases/0100.sparql +0 -15
  337. data/spec/xhtml1-testcases/0100.xhtml +0 -16
  338. data/spec/xhtml1-testcases/0101.sparql +0 -15
  339. data/spec/xhtml1-testcases/0101.xhtml +0 -16
  340. data/spec/xhtml1-testcases/0102.sparql +0 -15
  341. data/spec/xhtml1-testcases/0102.xhtml +0 -16
  342. data/spec/xhtml1-testcases/0103.sparql +0 -15
  343. data/spec/xhtml1-testcases/0103.xhtml +0 -15
  344. data/spec/xhtml1-testcases/0104.nt +0 -3
  345. data/spec/xhtml1-testcases/0104.sparql +0 -5
  346. data/spec/xhtml1-testcases/0104.xhtml +0 -18
  347. data/spec/xhtml1-testcases/0105.nt +0 -1
  348. data/spec/xhtml1-testcases/0105.sparql +0 -7
  349. data/spec/xhtml1-testcases/0105.xhtml +0 -13
  350. data/spec/xhtml1-testcases/0106.nt +0 -1
  351. data/spec/xhtml1-testcases/0106.sparql +0 -7
  352. data/spec/xhtml1-testcases/0106.xhtml +0 -13
  353. data/spec/xhtml1-testcases/0107.sparql +0 -4
  354. data/spec/xhtml1-testcases/0107.xhtml +0 -11
  355. data/spec/xhtml1-testcases/0108.sparql +0 -3
  356. data/spec/xhtml1-testcases/0108.xhtml +0 -14
  357. data/spec/xhtml1-testcases/0109.nt +0 -1
  358. data/spec/xhtml1-testcases/0109.sparql +0 -3
  359. data/spec/xhtml1-testcases/0109.xhtml +0 -15
  360. data/spec/xhtml1-testcases/0110.nt +0 -1
  361. data/spec/xhtml1-testcases/0110.sparql +0 -4
  362. data/spec/xhtml1-testcases/0110.xhtml +0 -12
  363. data/spec/xhtml1-testcases/0111.nt +0 -2
  364. data/spec/xhtml1-testcases/0111.sparql +0 -5
  365. data/spec/xhtml1-testcases/0111.xhtml +0 -14
  366. data/spec/xhtml1-testcases/0112.sparql +0 -3
  367. data/spec/xhtml1-testcases/0112.xhtml +0 -16
  368. data/spec/xhtml1-testcases/0113.nt +0 -2
  369. data/spec/xhtml1-testcases/0113.sparql +0 -4
  370. data/spec/xhtml1-testcases/0113.xhtml +0 -12
  371. data/spec/xhtml1-testcases/0114.nt +0 -3
  372. data/spec/xhtml1-testcases/0114.sparql +0 -5
  373. data/spec/xhtml1-testcases/0114.xhtml +0 -15
  374. data/spec/xhtml1-testcases/0115.nt +0 -4
  375. data/spec/xhtml1-testcases/0115.sparql +0 -14
  376. data/spec/xhtml1-testcases/0115.xhtml +0 -17
  377. data/spec/xhtml1-testcases/0116.nt +0 -2
  378. data/spec/xhtml1-testcases/0116.sparql +0 -6
  379. data/spec/xhtml1-testcases/0116.xhtml +0 -10
  380. data/spec/xhtml1-testcases/0117.sparql +0 -4
  381. data/spec/xhtml1-testcases/0117.xhtml +0 -15
  382. data/spec/xhtml1-testcases/0118.nt +0 -1
  383. data/spec/xhtml1-testcases/0118.sparql +0 -5
  384. data/spec/xhtml1-testcases/0118.xhtml +0 -16
  385. data/spec/xhtml1-testcases/0119.sparql +0 -5
  386. data/spec/xhtml1-testcases/0119.xhtml +0 -19
  387. data/spec/xhtml1-testcases/0120.sparql +0 -5
  388. data/spec/xhtml1-testcases/0120.xhtml +0 -17
  389. data/spec/xhtml1-testcases/0121.sparql +0 -4
  390. data/spec/xhtml1-testcases/0121.xhtml +0 -24
  391. data/spec/xhtml1-testcases/0122.sparql +0 -4
  392. data/spec/xhtml1-testcases/0122.xhtml +0 -16
  393. data/spec/xhtml1-testcases/0123.sparql +0 -5
  394. data/spec/xhtml1-testcases/0123.xhtml +0 -18
  395. data/spec/xhtml1-testcases/0124.sparql +0 -6
  396. data/spec/xhtml1-testcases/0124.xhtml +0 -14
  397. data/spec/xhtml1-testcases/0125.sparql +0 -5
  398. data/spec/xhtml1-testcases/0125.xhtml +0 -16
  399. data/spec/xhtml1-testcases/0126.sparql +0 -5
  400. data/spec/xhtml1-testcases/0126.xhtml +0 -15
  401. data/spec/xhtml1-testcases/1001.nt +0 -6
  402. data/spec/xhtml1-testcases/1001.sparql +0 -8
  403. data/spec/xhtml1-testcases/1001.xhtml +0 -20
  404. data/spec/xhtml1-testcases/9998.xhtml +0 -8
  405. data/spec/xhtml1-testcases/9999.xhtml +0 -8
  406. data/spec/xhtml1-testcases/rdfa-xhtml1-test-manifest.rdf +0 -1303
@@ -0,0 +1,3 @@
1
+ [submodule "spec/rdfa-test-suite"]
2
+ path = spec/rdfa-test-suite
3
+ url = git://github.com/msporny/rdfa-test-suite.git
@@ -1,12 +1,20 @@
1
- === 0.1.2 2009-11-04
2
- * First gem release, all XHTML1 approved test cases pass at http://rdfa.digitalbazaar.com/test-suite/
1
+ === 0.1.3
2
+ * Added rdfa-test-suite as sub-module and refactored RDFa tests to use them.
3
+ * Fix but in white-space separated attributes
4
+ * Downcase XHTML reserved words
5
+ * Check complete xmlns prefix for validity
3
6
 
4
- === 0.1.2 2009-10-27
7
+ === 0.1.2
5
8
  * Move most test-case logic into rdfa_helper.
6
9
  * Separate approved and unreviewed tests.
7
10
  * Allow for soft failure of unreviewed tests by catching Spec::Expectations::ExpectationNotMetError.
8
11
  * Integrate rdfa-test-suite and create test cases in the same manner. (Causing SPARQL problems with XMLLiterals)
9
12
 
13
+ === 0.1.1 2009-10-25
14
+ * Added VERSION constant by reading VERSION file from gem root.
15
+ * Fix [] parsing to not return a resource (TC 0121 and 0122).
16
+ * Improve test-case manifest file parsing to extract expectedResults and use in matchers.
17
+
10
18
  === 0.1.0 2009-10-17
11
19
  * First gem release, all XHTML1 approved test cases pass at http://rdfa.digitalbazaar.com/test-suite/
12
20
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.2
1
+ 0.1.3
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env ruby -s
2
- # For some reason, options preceeding files are ignored
3
2
  require 'rubygems'
4
3
  require File.expand_path(File.dirname(__FILE__) + "/../lib/rdfa_parser")
5
4
  require 'getoptlong'
@@ -20,7 +19,6 @@ class Parse
20
19
  puts parser.debug.join("\n\t") if $verbose
21
20
  rescue RdfaParser::ParserException => e
22
21
  puts "Parse failure: #{e.message}"
23
- #puts e.backtrace
24
22
  puts parser.debug if $verbose && parser
25
23
  #raise
26
24
  rescue Exception => e
@@ -35,7 +33,6 @@ base_uri = "http://example.com"
35
33
 
36
34
  opts = GetoptLong.new(
37
35
  ["--verbose", GetoptLong::NO_ARGUMENT],
38
- ["--version", GetoptLong::NO_ARGUMENT],
39
36
  ["--quiet", GetoptLong::NO_ARGUMENT],
40
37
  ["--debug", GetoptLong::NO_ARGUMENT],
41
38
  ["--format", GetoptLong::REQUIRED_ARGUMENT],
@@ -44,9 +41,6 @@ opts = GetoptLong.new(
44
41
  opts.each do |opt, arg|
45
42
  case opt
46
43
  when '--verbose' then $verbose = true
47
- when '--version'
48
- puts "version: #{RdfaParser::VERSION}"
49
- exit(0)
50
44
  when '--quiet' then $quiet = true
51
45
  when '--debug' then $DEBUG = true
52
46
  when '--format' then $format = arg
@@ -243,16 +243,27 @@ module RdfaParser
243
243
 
244
244
  # Map namespaces from context to each top-level element found within snippet
245
245
  def encode_contents(contents, options)
246
- ns_hash = options[:namespaces].values.inject({}) {|h, ns| h.merge(ns.xmlns_hash)}
247
- ns_strs = []
248
- ns_hash.each_pair {|a, u| ns_strs << "#{a}=\"#{u}\""}
249
-
250
- # Add inherited namespaces to created root element so that they're inherited to sub-elements
251
- contents = Nokogiri::XML::Document.parse("<foo #{ns_strs.join(" ")}>#{contents}</foo>").root
252
-
253
- @contents = contents.children.map do |c|
246
+ if contents.is_a?(String)
247
+ ns_hash = options[:namespaces].values.inject({}) {|h, ns| h.merge(ns.xmlns_hash)}
248
+ ns_strs = []
249
+ ns_hash.each_pair {|a, u| ns_strs << "#{a}=\"#{u}\""}
250
+
251
+ # Add inherited namespaces to created root element so that they're inherited to sub-elements
252
+ contents = Nokogiri::XML::Document.parse("<foo #{ns_strs.join(" ")}>#{contents}</foo>").root.children
253
+ end
254
+
255
+ # Add already mapped namespaces and language
256
+ @contents = contents.map do |c|
254
257
  if c.is_a?(Nokogiri::XML::Element)
255
- ns_hash.each_pair { |a, u| c[a] = u unless c.namespaces[a]}
258
+ # Gather namespaces from self and decendant nodes
259
+ c.traverse do |n|
260
+ ns = n.namespace
261
+ next unless ns
262
+ prefix = ns.prefix ? "xmlns:#{ns.prefix}" : "xmlns"
263
+ c[prefix] = ns.href unless c.namespaces[prefix]
264
+ end
265
+
266
+ # Add lanuage
256
267
  if options[:language] && c["lang"].to_s.empty?
257
268
  c["xml:lang"] = options[:language]
258
269
  end
@@ -28,7 +28,7 @@ module RdfaParser
28
28
  if shortname_valid?(short)
29
29
  @short = short
30
30
  else
31
- raise ParserException, "Invalid shortname '#{short}"
31
+ raise ParserException, "Invalid shortname '#{short}'"
32
32
  end
33
33
  end
34
34
 
@@ -81,7 +81,7 @@ module RdfaParser
81
81
 
82
82
  private
83
83
  def shortname_valid?(shortname)
84
- if shortname =~ /[a-zA-Z_][a-zA-Z0-9_]+/ || shortname.nil?
84
+ if shortname =~ /\A[a-zA-Z_][a-zA-Z0-9_]+\Z/ || shortname.nil?
85
85
  return true
86
86
  else
87
87
  return false
@@ -70,7 +70,8 @@ module RdfaParser
70
70
  # HTML4::
71
71
  # HTML5::
72
72
  # Options:
73
- # profile:: One of _xhtml1_, _html4_, or _html5_ to override intuition
73
+ # _profile_:: One of _xhtml1_, _html4_, or _html5_ to override intuition
74
+ # _strict_:: Fail when error detected, otherwise just continue
74
75
  #
75
76
  # Raises RdfaParser::RdfaException or subclass
76
77
  def parse(stream, base, options = {}, &block) # :yields: triple
@@ -79,8 +80,10 @@ module RdfaParser
79
80
  when Nokogiri::XML::Document then stream
80
81
  else Nokogiri::XML.parse(stream, base)
81
82
  end
83
+
84
+ @strict = options[:strict]
82
85
  @base = base.to_s
83
- raise ParserException, "Empty document" if @doc.nil?
86
+ raise ParserException, "Empty document" if @doc.nil? && @strict
84
87
  @callback = block
85
88
 
86
89
  # If the doc has a default, use that as "html"
@@ -106,6 +109,9 @@ module RdfaParser
106
109
  @graph << triple
107
110
  end
108
111
  triple
112
+ rescue RdfException => e
113
+ add_debug(node, "add_triple raised #{e.class}: #{e.message}")
114
+ raise if @strict
109
115
  end
110
116
 
111
117
  # Parsing an RDFa document (this is *not* the recursive method)
@@ -131,8 +137,13 @@ module RdfaParser
131
137
 
132
138
  # look for xmlns
133
139
  element.namespaces.each do |attr_name,attr_value|
134
- abbr, suffix = attr_name.split(":")
135
- mappings[suffix] = @graph.namespace(attr_value, suffix) if abbr == "xmlns"
140
+ begin
141
+ abbr, suffix = attr_name.split(":")
142
+ mappings[suffix] = @graph.namespace(attr_value, suffix) if abbr == "xmlns"
143
+ rescue RdfException => e
144
+ add_debug(element, "extract_mappings raised #{e.class}: #{e.message}")
145
+ raise if @strict
146
+ end
136
147
  end
137
148
 
138
149
  add_debug(element, "mappings: #{mappings.keys.join(", ")}")
@@ -150,7 +161,11 @@ module RdfaParser
150
161
 
151
162
  # The recursive helper function
152
163
  def traverse(element, evaluation_context)
153
- raise ParserException, "Can't parse nil element" if element.nil?
164
+ if element.nil?
165
+ add_debug(element, "traverse nil element")
166
+ raise ParserException, "Can't parse nil element" if @strict
167
+ return nil
168
+ end
154
169
 
155
170
  # local variables [5.5 Step 1]
156
171
  recurse = true
@@ -313,7 +328,7 @@ module RdfaParser
313
328
  elsif children_node_types != [Nokogiri::XML::Text] and (type == nil or type_resource.to_s == XML_LITERAL.to_s)
314
329
  # XML Literal
315
330
  add_debug(element, "XML Literal: #{element.inner_html}")
316
- current_object_literal = Literal.typed(element.inner_html, XML_LITERAL, :language => language, :namespaces => uri_mappings)
331
+ current_object_literal = Literal.typed(element.children, XML_LITERAL, :language => language, :namespaces => uri_mappings)
317
332
  recurse = false
318
333
  end
319
334
 
@@ -374,7 +389,9 @@ module RdfaParser
374
389
  if curie.include?(":")
375
390
  resource_array << curie_to_resource_or_bnode(curie, uri_mappings, base)
376
391
  elsif with_link_types
377
- link_type_curie = curie_to_resource_or_bnode(":#{value}", XH_MAPPING, base) if LINK_TYPES.include?(value.to_s)
392
+ # Reserved words are all mapped to lower case
393
+ curie = curie.to_s.downcase
394
+ link_type_curie = curie_to_resource_or_bnode(":#{curie}", XH_MAPPING, base) if LINK_TYPES.include?(curie)
378
395
  resource_array << link_type_curie if link_type_curie
379
396
  end
380
397
  end
@@ -397,7 +414,11 @@ module RdfaParser
397
414
  nil
398
415
  else
399
416
  ns = uri_mappings[prefix.to_s]
400
- raise ParserException, "No namespace mapping for #{prefix}" unless ns
417
+ unless ns
418
+ add_debug(nil, "curie_to_resource_or_bnode No namespace mapping for #{prefix}")
419
+ raise ParserException, "No namespace mapping for #{prefix}" if @strict
420
+ return nil
421
+ end
401
422
  ns + suffix
402
423
  end
403
424
  end
@@ -84,14 +84,12 @@ module RdfaParser
84
84
  case object
85
85
  when Addressable::URI
86
86
  URIRef.new(object.to_s)
87
- when String
87
+ when String, Integer, Float
88
88
  if object.to_s =~ /\S+\/\/\S+/ # does it smell like a URI?
89
89
  URIRef.new(object.to_s)
90
90
  else
91
- Literal.untyped(object)
91
+ Literal.new(object, nil, nil)
92
92
  end
93
- when Integer, Float
94
- Literal.build_from(object)
95
93
  when URIRef, BNode, Literal
96
94
  object
97
95
  else
@@ -74,7 +74,7 @@ describe "Graphs" do
74
74
  xhtml = Namespace.new("http://www.w3.org/1999/xhtml", "")
75
75
  g = Graph.new
76
76
  g << Triple.new(
77
- URIRef.new("http://www.w3.org/2006/07/SWD/RDFa/testsuite/xhtml1-testcases/0011.xhtml"),
77
+ URIRef.new("http://rdfa.digitalbazaar.com/test-suite/test-cases/xhtml1/0011.xhtml"),
78
78
  URIRef.new("http://purl.org/dc/elements/1.1/title"),
79
79
  Literal.typed("E = mc<sup xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">2</sup>: The Most Urgent Problem of Our Time",
80
80
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",
@@ -86,7 +86,7 @@ describe "Graphs" do
86
86
  }
87
87
 
88
88
  it "should output NTriple" do
89
- nt = '<http://www.w3.org/2006/07/SWD/RDFa/testsuite/xhtml1-testcases/0011.xhtml> <http://purl.org/dc/elements/1.1/title> "E = mc<sup xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">2</sup>: The Most Urgent Problem of Our Time"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .' + "\n"
89
+ nt = '<http://rdfa.digitalbazaar.com/test-suite/test-cases/xhtml1/0011.xhtml> <http://purl.org/dc/elements/1.1/title> "E = mc<sup xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">2</sup>: The Most Urgent Problem of Our Time"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .' + "\n"
90
90
  subject.to_ntriples.should == nt
91
91
  end
92
92
 
@@ -94,7 +94,7 @@ describe "Graphs" do
94
94
  rdfxml = <<-HERE
95
95
  <?xml version="1.0" encoding="UTF-8"?>
96
96
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xml=\"http://www.w3.org/XML/1998/namespace\" xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:xhv=\"http://www.w3.org/1999/xhtml/vocab#\">
97
- <rdf:Description rdf:about="http://www.w3.org/2006/07/SWD/RDFa/testsuite/xhtml1-testcases/0011.xhtml">
97
+ <rdf:Description rdf:about="http://rdfa.digitalbazaar.com/test-suite/test-cases/xhtml1/0011.xhtml">
98
98
  <dc:title rdf:parseType="Literal">E = mc<sup xmlns="http://www.w3.org/1999/xhtml" xmlns:dc="http://purl.org/dc/elements/1.1/">2>/sup>: The Most Urgent Problem of Our Time</dc:title>
99
99
  </rdf:Description>
100
100
  </rdf:RDF>
@@ -24,8 +24,8 @@ describe "Literals: " do
24
24
  subject { Literal.untyped("松本 后子") }
25
25
 
26
26
  describe "encodings" do
27
- it "should return n3" do subject.to_n3.should == '"\u677E\u672C \u540E\u5B50"' end
28
- it "should return ntriples" do subject.to_ntriples.should == '"\u677E\u672C \u540E\u5B50"' end
27
+ it "should return n3" do subject.to_n3.should == "\"\\\u677E\\\u672C \\\u540E\\\u5B50\"" end
28
+ it "should return ntriples" do subject.to_ntriples.should == "\"\\\u677E\\\u672C \\\u540E\\\u5B50\"" end
29
29
  it "should return xml_args" do subject.xml_args.should == ["松本 后子", {}] end
30
30
  it "should return TriX" do subject.to_trix.should == "<plainLiteral>" + "松本 后子" + "</plainLiteral>" end
31
31
  end
@@ -151,10 +151,10 @@ describe "Literals: " do
151
151
  }
152
152
 
153
153
  describe "encodings" do
154
- it "should return n3" do subject.to_n3.should == "\"foo <sup xmlns:dc=\\\"http://purl.org/dc/elements/1.1/\\\">bar</sup> baz!\"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>" end
154
+ it "should return n3" do subject.to_n3.should == "\"foo <sup>bar</sup> baz!\"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>" end
155
155
  it "should return ntriples" do subject.to_ntriples.should == subject.to_n3 end
156
- it "should return xml_args" do subject.xml_args.should == ["foo <sup xmlns:dc=\"http://purl.org/dc/elements/1.1/\">bar</sup> baz!", {"rdf:parseType" => "Literal"}] end
157
- it "should return TriX" do subject.to_trix.should == "<typedLiteral datatype=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral\">foo <sup xmlns:dc=\"http://purl.org/dc/elements/1.1/\">bar</sup> baz!</typedLiteral>" end
156
+ it "should return xml_args" do subject.xml_args.should == ["foo <sup>bar</sup> baz!", {"rdf:parseType" => "Literal"}] end
157
+ it "should return TriX" do subject.to_trix.should == "<typedLiteral datatype=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral\">foo <sup>bar</sup> baz!</typedLiteral>" end
158
158
  end
159
159
 
160
160
  describe "and language" do
@@ -165,10 +165,10 @@ describe "Literals: " do
165
165
  }
166
166
 
167
167
  describe "encodings" do
168
- it "should return n3" do subject.to_n3.should == "\"foo <sup xmlns:dc=\\\"http://purl.org/dc/elements/1.1/\\\" xml:lang=\\\"fr\\\">bar</sup> baz!\"\^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>" end
168
+ it "should return n3" do subject.to_n3.should == "\"foo <sup xml:lang=\\\"fr\\\">bar</sup> baz!\"\^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>" end
169
169
  it "should return ntriples" do subject.to_ntriples.should == subject.to_n3 end
170
- it "should return xml_args" do subject.xml_args.should == ["foo <sup xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xml:lang=\"fr\">bar</sup> baz!", {"rdf:parseType" => "Literal"}] end
171
- it "should return TriX" do subject.to_trix.should == "<typedLiteral datatype=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral\">foo <sup xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xml:lang=\"fr\">bar</sup> baz!</typedLiteral>" end
170
+ it "should return xml_args" do subject.xml_args.should == ["foo <sup xml:lang=\"fr\">bar</sup> baz!", {"rdf:parseType" => "Literal"}] end
171
+ it "should return TriX" do subject.to_trix.should == "<typedLiteral datatype=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral\">foo <sup xml:lang=\"fr\">bar</sup> baz!</typedLiteral>" end
172
172
  end
173
173
  end
174
174
 
@@ -210,7 +210,10 @@ describe "Literals: " do
210
210
  content = root.css("h2").children
211
211
  Literal.typed(content,
212
212
  "http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral",
213
- :namespaces => {"svg" => Namespace.new("http://www.w3.org/2000/svg", "svg")})
213
+ :namespaces => {
214
+ "svg" => Namespace.new("http://www.w3.org/2000/svg", "svg"),
215
+ "dc" => Namespace.new("http://purl.org/dc/elements/1.1/", "dc")
216
+ })
214
217
  }
215
218
  it "should return xml_args" do subject.xml_args.should == ["<svg:svg xmlns:svg=\"http://www.w3.org/2000/svg\"></svg:svg>", {"rdf:parseType" => "Literal"}] end
216
219
  end
@@ -3,6 +3,7 @@ module Matchers
3
3
  def initialize(expected, info)
4
4
  @expected = expected
5
5
  @info = info
6
+ @diffable = true
6
7
  end
7
8
  def matches?(actual)
8
9
  @actual = actual
@@ -28,7 +29,8 @@ module Matchers
28
29
  end +
29
30
  "\n\n#{info + "\n" unless info.empty?}" +
30
31
  "Unsorted Expected:\n#{@expected.to_ntriples}" +
31
- "Unsorted Results:\n#{@actual.to_ntriples}"
32
+ "Unsorted Results:\n#{@actual.to_ntriples}" +
33
+ "\nDebug:\n#{@info.trace}"
32
34
  end
33
35
  end
34
36
 
@@ -48,7 +50,7 @@ module Matchers
48
50
  @expected_results = @info.respond_to?(:expectedResults) ? @info.expectedResults : true
49
51
  model = Redland::Model.new
50
52
  ntriples_parser = Redland::Parser.ntriples
51
- ntriples_parser.parse_string_into_model(model, actual.to_ntriples, "http://www.w3.org/2006/07/SWD/RDFa/testsuite/xhtml1-testcases/")
53
+ ntriples_parser.parse_string_into_model(model, actual.to_ntriples, "http://rdfa.digitalbazaar.com/test-suite/test-cases/xhtml1/")
52
54
 
53
55
  @results = @query.execute(model)
54
56
  if @expected_results
@@ -70,7 +72,8 @@ module Matchers
70
72
  "Query returned true (expected false)"
71
73
  end +
72
74
  "\n#{@expected}" +
73
- "\nResults:\n#{@actual.to_ntriples}"
75
+ "\nResults:\n#{@actual.to_ntriples}" +
76
+ "\nDebug:\n#{@info.trace}"
74
77
  end
75
78
  end
76
79
 
@@ -0,0 +1 @@
1
+ <$TCPATH/photo1.jpg> <http://purl.org/dc/elements/1.1/creator> "Mark Birbeck" .
@@ -0,0 +1,2 @@
1
+ <http://www.blogger.com/profile/1109404> <http://xmlns.com/foaf/0.1/img> <$TCPATH/photo1.jpg> .
2
+ <$TCPATH/photo1.jpg> <http://purl.org/dc/elements/1.1/creator> <http://www.blogger.com/profile/1109404> .
@@ -0,0 +1,3 @@
1
+ <http://www.blogger.com/profile/1109404> <http://xmlns.com/foaf/0.1/img> <$TCPATH/photo1.jpg> .
2
+ <$TCPATH/photo1.jpg> <http://purl.org/dc/elements/1.1/title> "Portrait of Mark" .
3
+ <$TCPATH/photo1.jpg> <http://purl.org/dc/elements/1.1/creator> <http://www.blogger.com/profile/1109404> .
@@ -0,0 +1 @@
1
+ <$TCPATH/0008.xhtml> <http://creativecommons.org/ns#license> <http://creativecommons.org/licenses/by-nc-nd/2.5/> .
@@ -0,0 +1,3 @@
1
+ <$TCPATH/0011.xhtml> <http://purl.org/dc/elements/1.1/creator> "Albert Einstein" .
2
+ # This is one of the allowed result XML Literals
3
+ <$TCPATH/0011.xhtml> <http://purl.org/dc/elements/1.1/title> "E = mc<sup xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\">2</sup>: The Most Urgent Problem of Our Time"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral> .
@@ -0,0 +1,2 @@
1
+ <$TCPATH/0015.xhtml> <http://purl.org/dc/elements/1.1/creator> "Fyodor Dostoevsky" .
2
+ <$TCPATH/0015.xhtml> <http://purl.org/dc/elements/1.1/source> <urn:isbn:0140449132> .
@@ -0,0 +1 @@
1
+ <$TCPATH/photo1.jpg> <http://purl.org/dc/elements/1.1/creator> <http://www.blogger.com/profile/1109404> .
@@ -0,0 +1 @@
1
+ <$TCPATH/photo1.jpg> <http://purl.org/dc/elements/1.1/creator> "Mark Birbeck" .
@@ -0,0 +1 @@
1
+ <$TCPATH/0021.xhtml> <http://purl.org/dc/elements/1.1/creator> "Mark Birbeck" .
@@ -0,0 +1 @@
1
+ <$TCPATH/0023.xhtml> <http://purl.org/dc/elements/1.1/creator> "Mark Birbeck" .
@@ -0,0 +1,2 @@
1
+ <$TCPATH/0025.xhtml> <http://purl.org/dc/elements/1.1/creator> <$TCPATH/0025.xhtml#me> .
2
+ <$TCPATH/0025.xhtml#me> <http://xmlns.com/foaf/0.1/name> "Ben Adida" .
@@ -0,0 +1 @@
1
+ <$TCPATH/0030.xhtml> <http://creativecommons.org/ns#license> <http://creativecommons.org/licenses/by-nc-nd/2.5/> .
@@ -0,0 +1 @@
1
+ <$TCPATH/0031.xhtml#wtw> <http://purl.org/dc/elements/1.1/identifier> <urn:ISBN:0752820907> .
@@ -0,0 +1 @@
1
+ <$TCPATH/0032.xhtml#wtw> <http://purl.org/dc/elements/1.1/identifier> <urn:ISBN:0752820907> .
@@ -0,0 +1,2 @@
1
+ <$TCPATH/0033.xhtml> <http://purl.org/dc/elements/1.1/creator> _:a .
2
+ _:a <http://xmlns.com/foaf/0.1/name> "Ben Adida" .
@@ -0,0 +1,2 @@
1
+ <$TCPATH/0051.xhtml> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Document> .
2
+ <$TCPATH/0051.xhtml> <http://xmlns.com/foaf/0.1/topic> "John Doe" .