json-ld 3.2.4 → 3.2.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/VERSION +1 -1
  3. data/lib/json/ld/api.rb +807 -771
  4. data/lib/json/ld/compact.rb +304 -304
  5. data/lib/json/ld/conneg.rb +179 -161
  6. data/lib/json/ld/context.rb +2080 -1913
  7. data/lib/json/ld/expand.rb +745 -666
  8. data/lib/json/ld/extensions.rb +14 -13
  9. data/lib/json/ld/flatten.rb +257 -247
  10. data/lib/json/ld/format.rb +202 -194
  11. data/lib/json/ld/frame.rb +525 -502
  12. data/lib/json/ld/from_rdf.rb +223 -204
  13. data/lib/json/ld/html/nokogiri.rb +123 -121
  14. data/lib/json/ld/html/rexml.rb +151 -147
  15. data/lib/json/ld/reader.rb +107 -100
  16. data/lib/json/ld/resource.rb +224 -205
  17. data/lib/json/ld/streaming_reader.rb +574 -507
  18. data/lib/json/ld/streaming_writer.rb +93 -92
  19. data/lib/json/ld/to_rdf.rb +171 -169
  20. data/lib/json/ld/utils.rb +270 -264
  21. data/lib/json/ld/version.rb +24 -14
  22. data/lib/json/ld/writer.rb +334 -311
  23. data/lib/json/ld.rb +103 -96
  24. metadata +55 -198
  25. data/spec/api_spec.rb +0 -132
  26. data/spec/compact_spec.rb +0 -3482
  27. data/spec/conneg_spec.rb +0 -373
  28. data/spec/context_spec.rb +0 -2056
  29. data/spec/expand_spec.rb +0 -4496
  30. data/spec/flatten_spec.rb +0 -1203
  31. data/spec/format_spec.rb +0 -115
  32. data/spec/frame_spec.rb +0 -2541
  33. data/spec/from_rdf_spec.rb +0 -1072
  34. data/spec/matchers.rb +0 -20
  35. data/spec/rdfstar_spec.rb +0 -25
  36. data/spec/reader_spec.rb +0 -883
  37. data/spec/resource_spec.rb +0 -76
  38. data/spec/spec_helper.rb +0 -281
  39. data/spec/streaming_reader_spec.rb +0 -237
  40. data/spec/streaming_writer_spec.rb +0 -145
  41. data/spec/suite_compact_spec.rb +0 -22
  42. data/spec/suite_expand_spec.rb +0 -36
  43. data/spec/suite_flatten_spec.rb +0 -34
  44. data/spec/suite_frame_spec.rb +0 -29
  45. data/spec/suite_from_rdf_spec.rb +0 -22
  46. data/spec/suite_helper.rb +0 -411
  47. data/spec/suite_html_spec.rb +0 -22
  48. data/spec/suite_http_spec.rb +0 -35
  49. data/spec/suite_remote_doc_spec.rb +0 -22
  50. data/spec/suite_to_rdf_spec.rb +0 -30
  51. data/spec/support/extensions.rb +0 -44
  52. data/spec/test-files/test-1-compacted.jsonld +0 -10
  53. data/spec/test-files/test-1-context.jsonld +0 -7
  54. data/spec/test-files/test-1-expanded.jsonld +0 -5
  55. data/spec/test-files/test-1-input.jsonld +0 -10
  56. data/spec/test-files/test-1-rdf.ttl +0 -8
  57. data/spec/test-files/test-2-compacted.jsonld +0 -20
  58. data/spec/test-files/test-2-context.jsonld +0 -7
  59. data/spec/test-files/test-2-expanded.jsonld +0 -16
  60. data/spec/test-files/test-2-input.jsonld +0 -20
  61. data/spec/test-files/test-2-rdf.ttl +0 -14
  62. data/spec/test-files/test-3-compacted.jsonld +0 -11
  63. data/spec/test-files/test-3-context.jsonld +0 -8
  64. data/spec/test-files/test-3-expanded.jsonld +0 -10
  65. data/spec/test-files/test-3-input.jsonld +0 -11
  66. data/spec/test-files/test-3-rdf.ttl +0 -8
  67. data/spec/test-files/test-4-compacted.jsonld +0 -10
  68. data/spec/test-files/test-4-context.jsonld +0 -7
  69. data/spec/test-files/test-4-expanded.jsonld +0 -6
  70. data/spec/test-files/test-4-input.jsonld +0 -10
  71. data/spec/test-files/test-4-rdf.ttl +0 -5
  72. data/spec/test-files/test-5-compacted.jsonld +0 -13
  73. data/spec/test-files/test-5-context.jsonld +0 -7
  74. data/spec/test-files/test-5-expanded.jsonld +0 -9
  75. data/spec/test-files/test-5-input.jsonld +0 -13
  76. data/spec/test-files/test-5-rdf.ttl +0 -7
  77. data/spec/test-files/test-6-compacted.jsonld +0 -10
  78. data/spec/test-files/test-6-context.jsonld +0 -7
  79. data/spec/test-files/test-6-expanded.jsonld +0 -10
  80. data/spec/test-files/test-6-input.jsonld +0 -10
  81. data/spec/test-files/test-6-rdf.ttl +0 -6
  82. data/spec/test-files/test-7-compacted.jsonld +0 -23
  83. data/spec/test-files/test-7-context.jsonld +0 -4
  84. data/spec/test-files/test-7-expanded.jsonld +0 -20
  85. data/spec/test-files/test-7-input.jsonld +0 -23
  86. data/spec/test-files/test-7-rdf.ttl +0 -14
  87. data/spec/test-files/test-8-compacted.jsonld +0 -34
  88. data/spec/test-files/test-8-context.jsonld +0 -11
  89. data/spec/test-files/test-8-expanded.jsonld +0 -24
  90. data/spec/test-files/test-8-frame.jsonld +0 -18
  91. data/spec/test-files/test-8-framed.jsonld +0 -25
  92. data/spec/test-files/test-8-input.jsonld +0 -30
  93. data/spec/test-files/test-8-rdf.ttl +0 -15
  94. data/spec/test-files/test-9-compacted.jsonld +0 -20
  95. data/spec/test-files/test-9-context.jsonld +0 -13
  96. data/spec/test-files/test-9-expanded.jsonld +0 -14
  97. data/spec/test-files/test-9-input.jsonld +0 -12
  98. data/spec/to_rdf_spec.rb +0 -1684
  99. data/spec/writer_spec.rb +0 -427
data/spec/reader_spec.rb DELETED
@@ -1,883 +0,0 @@
1
- # coding: utf-8
2
- require_relative 'spec_helper'
3
- require 'rdf/spec/reader'
4
-
5
- describe JSON::LD::Reader do
6
- let!(:doap) {File.expand_path("../../etc/doap.jsonld", __FILE__)}
7
- let!(:doap_nt) {File.expand_path("../../etc/doap.nt", __FILE__)}
8
- let!(:doap_count) {File.open(doap_nt).each_line.to_a.length}
9
- let(:logger) {RDF::Spec.logger}
10
-
11
- after(:each) {|example| puts logger.to_s if example.exception}
12
-
13
- it_behaves_like 'an RDF::Reader' do
14
- let(:reader_input) {File.read(doap)}
15
- let(:reader) {JSON::LD::Reader.new(reader_input)}
16
- let(:reader_count) {doap_count}
17
- end
18
-
19
- describe ".for" do
20
- formats = [
21
- :jsonld,
22
- "etc/doap.jsonld",
23
- {file_name: 'etc/doap.jsonld'},
24
- {file_extension: 'jsonld'},
25
- {content_type: 'application/ld+json'},
26
- {content_type: 'application/x-ld+json'},
27
- ].each do |arg|
28
- it "discovers with #{arg.inspect}" do
29
- expect(RDF::Reader.for(arg)).to eq JSON::LD::Reader
30
- end
31
- end
32
- end
33
-
34
- context "when validating", pending: ("JRuby support for jsonlint" if RUBY_ENGINE == "jruby") do
35
- it "detects invalid JSON" do
36
- expect do |b|
37
- described_class.new(StringIO.new(%({"a": "b", "a": "c"})), validate: true, logger: false).each_statement(&b)
38
- end.to raise_error(RDF::ReaderError)
39
- end
40
- end
41
-
42
- context :interface do
43
- {
44
- plain: %q({
45
- "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
46
- "@id": "_:bnode1",
47
- "@type": "foaf:Person",
48
- "foaf:homepage": "http://example.com/bob/",
49
- "foaf:name": "Bob"
50
- }),
51
- leading_comment: %q(
52
- // A comment before content
53
- {
54
- "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
55
- "@id": "_:bnode1",
56
- "@type": "foaf:Person",
57
- "foaf:homepage": "http://example.com/bob/",
58
- "foaf:name": "Bob"
59
- }),
60
- script: %q(<script type="application/ld+json">
61
- {
62
- "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
63
- "@id": "_:bnode1",
64
- "@type": "foaf:Person",
65
- "foaf:homepage": "http://example.com/bob/",
66
- "foaf:name": "Bob"
67
- }
68
- </script>),
69
- script_comments: %q(<script type="application/ld+json">
70
- // A comment before content
71
- {
72
- "@context": {"foaf": "http://xmlns.com/foaf/0.1/"},
73
- "@id": "_:bnode1",
74
- "@type": "foaf:Person",
75
- "foaf:homepage": "http://example.com/bob/",
76
- "foaf:name": "Bob"
77
- }
78
- </script>),
79
- }.each do |variant, src|
80
- context variant do
81
- subject {src}
82
-
83
- describe "#initialize" do
84
- it "yields reader given string" do
85
- inner = double("inner")
86
- expect(inner).to receive(:called).with(JSON::LD::Reader)
87
- JSON::LD::Reader.new(subject) do |reader|
88
- inner.called(reader.class)
89
- end
90
- end
91
-
92
- it "yields reader given IO" do
93
- inner = double("inner")
94
- expect(inner).to receive(:called).with(JSON::LD::Reader)
95
- JSON::LD::Reader.new(StringIO.new(subject)) do |reader|
96
- inner.called(reader.class)
97
- end
98
- end
99
-
100
- it "returns reader" do
101
- expect(JSON::LD::Reader.new(subject)).to be_a(JSON::LD::Reader)
102
- end
103
- end
104
-
105
- describe "#each_statement" do
106
- it "yields statements" do
107
- inner = double("inner")
108
- expect(inner).to receive(:called).with(RDF::Statement).exactly(3)
109
- JSON::LD::Reader.new(subject).each_statement do |statement|
110
- inner.called(statement.class)
111
- end
112
- end
113
- end
114
-
115
- describe "#each_triple" do
116
- it "yields statements" do
117
- inner = double("inner")
118
- expect(inner).to receive(:called).exactly(3)
119
- JSON::LD::Reader.new(subject).each_triple do |subject, predicate, object|
120
- inner.called(subject.class, predicate.class, object.class)
121
- end
122
- end
123
- end
124
- end
125
- end
126
- end
127
-
128
- describe "Base IRI resolution" do
129
- # From https://gist.github.com/RubenVerborgh/39f0e8d63e33e435371a
130
- let(:json) {%q{[
131
- {
132
- "@context": {"@base": "http://a/bb/ccc/d;p?q", "urn:ex:p": {"@type": "@id"}},
133
- "@graph": [
134
- {"@id": "urn:ex:s001", "urn:ex:p": "gg:h"},
135
- {"@id": "urn:ex:s002", "urn:ex:p": "g"},
136
- {"@id": "urn:ex:s003", "urn:ex:p": "./g"},
137
- {"@id": "urn:ex:s004", "urn:ex:p": "g/"},
138
- {"@id": "urn:ex:s005", "urn:ex:p": "/g"},
139
- {"@id": "urn:ex:s006", "urn:ex:p": "//g"},
140
- {"@id": "urn:ex:s007", "urn:ex:p": "?y"},
141
- {"@id": "urn:ex:s008", "urn:ex:p": "g?y"},
142
- {"@id": "urn:ex:s009", "urn:ex:p": "#s"},
143
- {"@id": "urn:ex:s010", "urn:ex:p": "g#s"},
144
- {"@id": "urn:ex:s011", "urn:ex:p": "g?y#s"},
145
- {"@id": "urn:ex:s012", "urn:ex:p": ";x"},
146
- {"@id": "urn:ex:s013", "urn:ex:p": "g;x"},
147
- {"@id": "urn:ex:s014", "urn:ex:p": "g;x?y#s"},
148
- {"@id": "urn:ex:s015", "urn:ex:p": ""},
149
- {"@id": "urn:ex:s016", "urn:ex:p": "."},
150
- {"@id": "urn:ex:s017", "urn:ex:p": "./"},
151
- {"@id": "urn:ex:s018", "urn:ex:p": ".."},
152
- {"@id": "urn:ex:s019", "urn:ex:p": "../"},
153
- {"@id": "urn:ex:s020", "urn:ex:p": "../g"},
154
- {"@id": "urn:ex:s021", "urn:ex:p": "../.."},
155
- {"@id": "urn:ex:s022", "urn:ex:p": "../../"},
156
- {"@id": "urn:ex:s023", "urn:ex:p": "../../g"}
157
- ]
158
- },
159
- {
160
- "@context": {"@base": "http://a/bb/ccc/d;p?q", "urn:ex:p": {"@type": "@id"}},
161
- "@graph": [
162
- {"@id": "urn:ex:s024", "urn:ex:p": "../../../g"},
163
- {"@id": "urn:ex:s025", "urn:ex:p": "../../../../g"},
164
- {"@id": "urn:ex:s026", "urn:ex:p": "/./g"},
165
- {"@id": "urn:ex:s027", "urn:ex:p": "/../g"},
166
- {"@id": "urn:ex:s028", "urn:ex:p": "g."},
167
- {"@id": "urn:ex:s029", "urn:ex:p": ".g"},
168
- {"@id": "urn:ex:s030", "urn:ex:p": "g.."},
169
- {"@id": "urn:ex:s031", "urn:ex:p": "..g"},
170
- {"@id": "urn:ex:s032", "urn:ex:p": "./../g"},
171
- {"@id": "urn:ex:s033", "urn:ex:p": "./g/."},
172
- {"@id": "urn:ex:s034", "urn:ex:p": "g/./h"},
173
- {"@id": "urn:ex:s035", "urn:ex:p": "g/../h"},
174
- {"@id": "urn:ex:s036", "urn:ex:p": "g;x=1/./y"},
175
- {"@id": "urn:ex:s037", "urn:ex:p": "g;x=1/../y"},
176
- {"@id": "urn:ex:s038", "urn:ex:p": "g?y/./x"},
177
- {"@id": "urn:ex:s039", "urn:ex:p": "g?y/../x"},
178
- {"@id": "urn:ex:s040", "urn:ex:p": "g#s/./x"},
179
- {"@id": "urn:ex:s041", "urn:ex:p": "g#s/../x"},
180
- {"@id": "urn:ex:s042", "urn:ex:p": "http:g"}
181
- ]
182
- },
183
- {
184
- "@context": {"@base": "http://a/bb/ccc/d/", "urn:ex:p": {"@type": "@id"}},
185
- "@graph": [
186
- {"@id": "urn:ex:s043", "urn:ex:p": "gg:h"},
187
- {"@id": "urn:ex:s044", "urn:ex:p": "g"},
188
- {"@id": "urn:ex:s045", "urn:ex:p": "./g"},
189
- {"@id": "urn:ex:s046", "urn:ex:p": "g/"},
190
- {"@id": "urn:ex:s047", "urn:ex:p": "/g"},
191
- {"@id": "urn:ex:s048", "urn:ex:p": "//g"},
192
- {"@id": "urn:ex:s049", "urn:ex:p": "?y"},
193
- {"@id": "urn:ex:s050", "urn:ex:p": "g?y"},
194
- {"@id": "urn:ex:s051", "urn:ex:p": "#s"},
195
- {"@id": "urn:ex:s052", "urn:ex:p": "g#s"},
196
- {"@id": "urn:ex:s053", "urn:ex:p": "g?y#s"},
197
- {"@id": "urn:ex:s054", "urn:ex:p": ";x"},
198
- {"@id": "urn:ex:s055", "urn:ex:p": "g;x"},
199
- {"@id": "urn:ex:s056", "urn:ex:p": "g;x?y#s"},
200
- {"@id": "urn:ex:s057", "urn:ex:p": ""},
201
- {"@id": "urn:ex:s058", "urn:ex:p": "."},
202
- {"@id": "urn:ex:s059", "urn:ex:p": "./"},
203
- {"@id": "urn:ex:s060", "urn:ex:p": ".."},
204
- {"@id": "urn:ex:s061", "urn:ex:p": "../"},
205
- {"@id": "urn:ex:s062", "urn:ex:p": "../g"},
206
- {"@id": "urn:ex:s063", "urn:ex:p": "../.."},
207
- {"@id": "urn:ex:s064", "urn:ex:p": "../../"},
208
- {"@id": "urn:ex:s065", "urn:ex:p": "../../g"}
209
- ]
210
- },
211
- {
212
- "@context": {"@base": "http://a/bb/ccc/d/", "urn:ex:p": {"@type": "@id"}},
213
- "@graph": [
214
- {"@id": "urn:ex:s066", "urn:ex:p": "../../../g"},
215
- {"@id": "urn:ex:s067", "urn:ex:p": "../../../../g"},
216
- {"@id": "urn:ex:s068", "urn:ex:p": "/./g"},
217
- {"@id": "urn:ex:s069", "urn:ex:p": "/../g"},
218
- {"@id": "urn:ex:s070", "urn:ex:p": "g."},
219
- {"@id": "urn:ex:s071", "urn:ex:p": ".g"},
220
- {"@id": "urn:ex:s072", "urn:ex:p": "g.."},
221
- {"@id": "urn:ex:s073", "urn:ex:p": "..g"},
222
- {"@id": "urn:ex:s074", "urn:ex:p": "./../g"},
223
- {"@id": "urn:ex:s075", "urn:ex:p": "./g/."},
224
- {"@id": "urn:ex:s076", "urn:ex:p": "g/./h"},
225
- {"@id": "urn:ex:s077", "urn:ex:p": "g/../h"},
226
- {"@id": "urn:ex:s078", "urn:ex:p": "g;x=1/./y"},
227
- {"@id": "urn:ex:s079", "urn:ex:p": "g;x=1/../y"},
228
- {"@id": "urn:ex:s080", "urn:ex:p": "g?y/./x"},
229
- {"@id": "urn:ex:s081", "urn:ex:p": "g?y/../x"},
230
- {"@id": "urn:ex:s082", "urn:ex:p": "g#s/./x"},
231
- {"@id": "urn:ex:s083", "urn:ex:p": "g#s/../x"},
232
- {"@id": "urn:ex:s084", "urn:ex:p": "http:g"}
233
- ]
234
- },
235
- {
236
- "@context": {"@base": "http://a/bb/ccc/./d;p?q", "urn:ex:p": {"@type": "@id"}},
237
- "@graph": [
238
- {"@id": "urn:ex:s085", "urn:ex:p": "gg:h"},
239
- {"@id": "urn:ex:s086", "urn:ex:p": "g"},
240
- {"@id": "urn:ex:s087", "urn:ex:p": "./g"},
241
- {"@id": "urn:ex:s088", "urn:ex:p": "g/"},
242
- {"@id": "urn:ex:s089", "urn:ex:p": "/g"},
243
- {"@id": "urn:ex:s090", "urn:ex:p": "//g"},
244
- {"@id": "urn:ex:s091", "urn:ex:p": "?y"},
245
- {"@id": "urn:ex:s092", "urn:ex:p": "g?y"},
246
- {"@id": "urn:ex:s093", "urn:ex:p": "#s"},
247
- {"@id": "urn:ex:s094", "urn:ex:p": "g#s"},
248
- {"@id": "urn:ex:s095", "urn:ex:p": "g?y#s"},
249
- {"@id": "urn:ex:s096", "urn:ex:p": ";x"},
250
- {"@id": "urn:ex:s097", "urn:ex:p": "g;x"},
251
- {"@id": "urn:ex:s098", "urn:ex:p": "g;x?y#s"},
252
- {"@id": "urn:ex:s099", "urn:ex:p": ""},
253
- {"@id": "urn:ex:s100", "urn:ex:p": "."},
254
- {"@id": "urn:ex:s101", "urn:ex:p": "./"},
255
- {"@id": "urn:ex:s102", "urn:ex:p": ".."},
256
- {"@id": "urn:ex:s103", "urn:ex:p": "../"},
257
- {"@id": "urn:ex:s104", "urn:ex:p": "../g"},
258
- {"@id": "urn:ex:s105", "urn:ex:p": "../.."},
259
- {"@id": "urn:ex:s106", "urn:ex:p": "../../"},
260
- {"@id": "urn:ex:s107", "urn:ex:p": "../../g"}
261
- ]
262
- },
263
- {
264
- "@context": {"@base": "http://a/bb/ccc/./d;p?q", "urn:ex:p": {"@type": "@id"}},
265
- "@graph": [
266
- {"@id": "urn:ex:s108", "urn:ex:p": "../../../g"},
267
- {"@id": "urn:ex:s109", "urn:ex:p": "../../../../g"},
268
- {"@id": "urn:ex:s110", "urn:ex:p": "/./g"},
269
- {"@id": "urn:ex:s111", "urn:ex:p": "/../g"},
270
- {"@id": "urn:ex:s112", "urn:ex:p": "g."},
271
- {"@id": "urn:ex:s113", "urn:ex:p": ".g"},
272
- {"@id": "urn:ex:s114", "urn:ex:p": "g.."},
273
- {"@id": "urn:ex:s115", "urn:ex:p": "..g"},
274
- {"@id": "urn:ex:s116", "urn:ex:p": "./../g"},
275
- {"@id": "urn:ex:s117", "urn:ex:p": "./g/."},
276
- {"@id": "urn:ex:s118", "urn:ex:p": "g/./h"},
277
- {"@id": "urn:ex:s119", "urn:ex:p": "g/../h"},
278
- {"@id": "urn:ex:s120", "urn:ex:p": "g;x=1/./y"},
279
- {"@id": "urn:ex:s121", "urn:ex:p": "g;x=1/../y"},
280
- {"@id": "urn:ex:s122", "urn:ex:p": "g?y/./x"},
281
- {"@id": "urn:ex:s123", "urn:ex:p": "g?y/../x"},
282
- {"@id": "urn:ex:s124", "urn:ex:p": "g#s/./x"},
283
- {"@id": "urn:ex:s125", "urn:ex:p": "g#s/../x"},
284
- {"@id": "urn:ex:s126", "urn:ex:p": "http:g"}
285
- ]
286
- },
287
- {
288
- "@context": {"@base": "http://a/bb/ccc/../d;p?q", "urn:ex:p": {"@type": "@id"}},
289
- "@graph": [
290
- {"@id": "urn:ex:s127", "urn:ex:p": "gg:h"},
291
- {"@id": "urn:ex:s128", "urn:ex:p": "g"},
292
- {"@id": "urn:ex:s129", "urn:ex:p": "./g"},
293
- {"@id": "urn:ex:s130", "urn:ex:p": "g/"},
294
- {"@id": "urn:ex:s131", "urn:ex:p": "/g"},
295
- {"@id": "urn:ex:s132", "urn:ex:p": "//g"},
296
- {"@id": "urn:ex:s133", "urn:ex:p": "?y"},
297
- {"@id": "urn:ex:s134", "urn:ex:p": "g?y"},
298
- {"@id": "urn:ex:s135", "urn:ex:p": "#s"},
299
- {"@id": "urn:ex:s136", "urn:ex:p": "g#s"},
300
- {"@id": "urn:ex:s137", "urn:ex:p": "g?y#s"},
301
- {"@id": "urn:ex:s138", "urn:ex:p": ";x"},
302
- {"@id": "urn:ex:s139", "urn:ex:p": "g;x"},
303
- {"@id": "urn:ex:s140", "urn:ex:p": "g;x?y#s"},
304
- {"@id": "urn:ex:s141", "urn:ex:p": ""},
305
- {"@id": "urn:ex:s142", "urn:ex:p": "."},
306
- {"@id": "urn:ex:s143", "urn:ex:p": "./"},
307
- {"@id": "urn:ex:s144", "urn:ex:p": ".."},
308
- {"@id": "urn:ex:s145", "urn:ex:p": "../"},
309
- {"@id": "urn:ex:s146", "urn:ex:p": "../g"},
310
- {"@id": "urn:ex:s147", "urn:ex:p": "../.."},
311
- {"@id": "urn:ex:s148", "urn:ex:p": "../../"},
312
- {"@id": "urn:ex:s149", "urn:ex:p": "../../g"}
313
- ]
314
- },
315
- {
316
- "@context": {"@base": "http://a/bb/ccc/../d;p?q", "urn:ex:p": {"@type": "@id"}},
317
- "@graph": [
318
- {"@id": "urn:ex:s150", "urn:ex:p": "../../../g"},
319
- {"@id": "urn:ex:s151", "urn:ex:p": "../../../../g"},
320
- {"@id": "urn:ex:s152", "urn:ex:p": "/./g"},
321
- {"@id": "urn:ex:s153", "urn:ex:p": "/../g"},
322
- {"@id": "urn:ex:s154", "urn:ex:p": "g."},
323
- {"@id": "urn:ex:s155", "urn:ex:p": ".g"},
324
- {"@id": "urn:ex:s156", "urn:ex:p": "g.."},
325
- {"@id": "urn:ex:s157", "urn:ex:p": "..g"},
326
- {"@id": "urn:ex:s158", "urn:ex:p": "./../g"},
327
- {"@id": "urn:ex:s159", "urn:ex:p": "./g/."},
328
- {"@id": "urn:ex:s160", "urn:ex:p": "g/./h"},
329
- {"@id": "urn:ex:s161", "urn:ex:p": "g/../h"},
330
- {"@id": "urn:ex:s162", "urn:ex:p": "g;x=1/./y"},
331
- {"@id": "urn:ex:s163", "urn:ex:p": "g;x=1/../y"},
332
- {"@id": "urn:ex:s164", "urn:ex:p": "g?y/./x"},
333
- {"@id": "urn:ex:s165", "urn:ex:p": "g?y/../x"},
334
- {"@id": "urn:ex:s166", "urn:ex:p": "g#s/./x"},
335
- {"@id": "urn:ex:s167", "urn:ex:p": "g#s/../x"},
336
- {"@id": "urn:ex:s168", "urn:ex:p": "http:g"}
337
- ]
338
- },
339
- {
340
- "@context": {"@base": "http://a/bb/ccc/.", "urn:ex:p": {"@type": "@id"}},
341
- "@graph": [
342
- {"@id": "urn:ex:s169", "urn:ex:p": "gg:h"},
343
- {"@id": "urn:ex:s170", "urn:ex:p": "g"},
344
- {"@id": "urn:ex:s171", "urn:ex:p": "./g"},
345
- {"@id": "urn:ex:s172", "urn:ex:p": "g/"},
346
- {"@id": "urn:ex:s173", "urn:ex:p": "/g"},
347
- {"@id": "urn:ex:s174", "urn:ex:p": "//g"},
348
- {"@id": "urn:ex:s175", "urn:ex:p": "?y"},
349
- {"@id": "urn:ex:s176", "urn:ex:p": "g?y"},
350
- {"@id": "urn:ex:s177", "urn:ex:p": "#s"},
351
- {"@id": "urn:ex:s178", "urn:ex:p": "g#s"},
352
- {"@id": "urn:ex:s179", "urn:ex:p": "g?y#s"},
353
- {"@id": "urn:ex:s180", "urn:ex:p": ";x"},
354
- {"@id": "urn:ex:s181", "urn:ex:p": "g;x"},
355
- {"@id": "urn:ex:s182", "urn:ex:p": "g;x?y#s"},
356
- {"@id": "urn:ex:s183", "urn:ex:p": ""},
357
- {"@id": "urn:ex:s184", "urn:ex:p": "."},
358
- {"@id": "urn:ex:s185", "urn:ex:p": "./"},
359
- {"@id": "urn:ex:s186", "urn:ex:p": ".."},
360
- {"@id": "urn:ex:s187", "urn:ex:p": "../"},
361
- {"@id": "urn:ex:s188", "urn:ex:p": "../g"},
362
- {"@id": "urn:ex:s189", "urn:ex:p": "../.."},
363
- {"@id": "urn:ex:s190", "urn:ex:p": "../../"},
364
- {"@id": "urn:ex:s191", "urn:ex:p": "../../g"}
365
- ]
366
- },
367
- {
368
- "@context": {"@base": "http://a/bb/ccc/.", "urn:ex:p": {"@type": "@id"}},
369
- "@graph": [
370
- {"@id": "urn:ex:s192", "urn:ex:p": "../../../g"},
371
- {"@id": "urn:ex:s193", "urn:ex:p": "../../../../g"},
372
- {"@id": "urn:ex:s194", "urn:ex:p": "/./g"},
373
- {"@id": "urn:ex:s195", "urn:ex:p": "/../g"},
374
- {"@id": "urn:ex:s196", "urn:ex:p": "g."},
375
- {"@id": "urn:ex:s197", "urn:ex:p": ".g"},
376
- {"@id": "urn:ex:s198", "urn:ex:p": "g.."},
377
- {"@id": "urn:ex:s199", "urn:ex:p": "..g"},
378
- {"@id": "urn:ex:s200", "urn:ex:p": "./../g"},
379
- {"@id": "urn:ex:s201", "urn:ex:p": "./g/."},
380
- {"@id": "urn:ex:s202", "urn:ex:p": "g/./h"},
381
- {"@id": "urn:ex:s203", "urn:ex:p": "g/../h"},
382
- {"@id": "urn:ex:s204", "urn:ex:p": "g;x=1/./y"},
383
- {"@id": "urn:ex:s205", "urn:ex:p": "g;x=1/../y"},
384
- {"@id": "urn:ex:s206", "urn:ex:p": "g?y/./x"},
385
- {"@id": "urn:ex:s207", "urn:ex:p": "g?y/../x"},
386
- {"@id": "urn:ex:s208", "urn:ex:p": "g#s/./x"},
387
- {"@id": "urn:ex:s209", "urn:ex:p": "g#s/../x"},
388
- {"@id": "urn:ex:s210", "urn:ex:p": "http:g"}
389
- ]
390
- },
391
- {
392
- "@context": {"@base": "http://a/bb/ccc/..", "urn:ex:p": {"@type": "@id"}},
393
- "@graph": [
394
- {"@id": "urn:ex:s211", "urn:ex:p": "gg:h"},
395
- {"@id": "urn:ex:s212", "urn:ex:p": "g"},
396
- {"@id": "urn:ex:s213", "urn:ex:p": "./g"},
397
- {"@id": "urn:ex:s214", "urn:ex:p": "g/"},
398
- {"@id": "urn:ex:s215", "urn:ex:p": "/g"},
399
- {"@id": "urn:ex:s216", "urn:ex:p": "//g"},
400
- {"@id": "urn:ex:s217", "urn:ex:p": "?y"},
401
- {"@id": "urn:ex:s218", "urn:ex:p": "g?y"},
402
- {"@id": "urn:ex:s219", "urn:ex:p": "#s"},
403
- {"@id": "urn:ex:s220", "urn:ex:p": "g#s"},
404
- {"@id": "urn:ex:s221", "urn:ex:p": "g?y#s"},
405
- {"@id": "urn:ex:s222", "urn:ex:p": ";x"},
406
- {"@id": "urn:ex:s223", "urn:ex:p": "g;x"},
407
- {"@id": "urn:ex:s224", "urn:ex:p": "g;x?y#s"},
408
- {"@id": "urn:ex:s225", "urn:ex:p": ""},
409
- {"@id": "urn:ex:s226", "urn:ex:p": "."},
410
- {"@id": "urn:ex:s227", "urn:ex:p": "./"},
411
- {"@id": "urn:ex:s228", "urn:ex:p": ".."},
412
- {"@id": "urn:ex:s229", "urn:ex:p": "../"},
413
- {"@id": "urn:ex:s230", "urn:ex:p": "../g"},
414
- {"@id": "urn:ex:s231", "urn:ex:p": "../.."},
415
- {"@id": "urn:ex:s232", "urn:ex:p": "../../"},
416
- {"@id": "urn:ex:s233", "urn:ex:p": "../../g"}
417
- ]
418
- },
419
- {
420
- "@context": {"@base": "http://a/bb/ccc/..", "urn:ex:p": {"@type": "@id"}},
421
- "@graph": [
422
- {"@id": "urn:ex:s234", "urn:ex:p": "../../../g"},
423
- {"@id": "urn:ex:s235", "urn:ex:p": "../../../../g"},
424
- {"@id": "urn:ex:s236", "urn:ex:p": "/./g"},
425
- {"@id": "urn:ex:s237", "urn:ex:p": "/../g"},
426
- {"@id": "urn:ex:s238", "urn:ex:p": "g."},
427
- {"@id": "urn:ex:s239", "urn:ex:p": ".g"},
428
- {"@id": "urn:ex:s240", "urn:ex:p": "g.."},
429
- {"@id": "urn:ex:s241", "urn:ex:p": "..g"},
430
- {"@id": "urn:ex:s242", "urn:ex:p": "./../g"},
431
- {"@id": "urn:ex:s243", "urn:ex:p": "./g/."},
432
- {"@id": "urn:ex:s244", "urn:ex:p": "g/./h"},
433
- {"@id": "urn:ex:s245", "urn:ex:p": "g/../h"},
434
- {"@id": "urn:ex:s246", "urn:ex:p": "g;x=1/./y"},
435
- {"@id": "urn:ex:s247", "urn:ex:p": "g;x=1/../y"},
436
- {"@id": "urn:ex:s248", "urn:ex:p": "g?y/./x"},
437
- {"@id": "urn:ex:s249", "urn:ex:p": "g?y/../x"},
438
- {"@id": "urn:ex:s250", "urn:ex:p": "g#s/./x"},
439
- {"@id": "urn:ex:s251", "urn:ex:p": "g#s/../x"},
440
- {"@id": "urn:ex:s252", "urn:ex:p": "http:g"}
441
- ]
442
- },
443
- {
444
- "@context": {"@base": "file:///a/bb/ccc/d;p?q", "urn:ex:p": {"@type": "@id"}},
445
- "@graph": [
446
- {"@id": "urn:ex:s253", "urn:ex:p": "gg:h"},
447
- {"@id": "urn:ex:s254", "urn:ex:p": "g"},
448
- {"@id": "urn:ex:s255", "urn:ex:p": "./g"},
449
- {"@id": "urn:ex:s256", "urn:ex:p": "g/"},
450
- {"@id": "urn:ex:s257", "urn:ex:p": "/g"},
451
- {"@id": "urn:ex:s258", "urn:ex:p": "//g"},
452
- {"@id": "urn:ex:s259", "urn:ex:p": "?y"},
453
- {"@id": "urn:ex:s260", "urn:ex:p": "g?y"},
454
- {"@id": "urn:ex:s261", "urn:ex:p": "#s"},
455
- {"@id": "urn:ex:s262", "urn:ex:p": "g#s"},
456
- {"@id": "urn:ex:s263", "urn:ex:p": "g?y#s"},
457
- {"@id": "urn:ex:s264", "urn:ex:p": ";x"},
458
- {"@id": "urn:ex:s265", "urn:ex:p": "g;x"},
459
- {"@id": "urn:ex:s266", "urn:ex:p": "g;x?y#s"},
460
- {"@id": "urn:ex:s267", "urn:ex:p": ""},
461
- {"@id": "urn:ex:s268", "urn:ex:p": "."},
462
- {"@id": "urn:ex:s269", "urn:ex:p": "./"},
463
- {"@id": "urn:ex:s270", "urn:ex:p": ".."},
464
- {"@id": "urn:ex:s271", "urn:ex:p": "../"},
465
- {"@id": "urn:ex:s272", "urn:ex:p": "../g"},
466
- {"@id": "urn:ex:s273", "urn:ex:p": "../.."},
467
- {"@id": "urn:ex:s274", "urn:ex:p": "../../"},
468
- {"@id": "urn:ex:s275", "urn:ex:p": "../../g"}
469
- ]
470
- },
471
- {
472
- "@context": {"@base": "file:///a/bb/ccc/d;p?q", "urn:ex:p": {"@type": "@id"}},
473
- "@graph": [
474
- {"@id": "urn:ex:s276", "urn:ex:p": "../../../g"},
475
- {"@id": "urn:ex:s277", "urn:ex:p": "../../../../g"},
476
- {"@id": "urn:ex:s278", "urn:ex:p": "/./g"},
477
- {"@id": "urn:ex:s279", "urn:ex:p": "/../g"},
478
- {"@id": "urn:ex:s280", "urn:ex:p": "g."},
479
- {"@id": "urn:ex:s281", "urn:ex:p": ".g"},
480
- {"@id": "urn:ex:s282", "urn:ex:p": "g.."},
481
- {"@id": "urn:ex:s283", "urn:ex:p": "..g"},
482
- {"@id": "urn:ex:s284", "urn:ex:p": "./../g"},
483
- {"@id": "urn:ex:s285", "urn:ex:p": "./g/."},
484
- {"@id": "urn:ex:s286", "urn:ex:p": "g/./h"},
485
- {"@id": "urn:ex:s287", "urn:ex:p": "g/../h"},
486
- {"@id": "urn:ex:s288", "urn:ex:p": "g;x=1/./y"},
487
- {"@id": "urn:ex:s289", "urn:ex:p": "g;x=1/../y"},
488
- {"@id": "urn:ex:s290", "urn:ex:p": "g?y/./x"},
489
- {"@id": "urn:ex:s291", "urn:ex:p": "g?y/../x"},
490
- {"@id": "urn:ex:s292", "urn:ex:p": "g#s/./x"},
491
- {"@id": "urn:ex:s293", "urn:ex:p": "g#s/../x"},
492
- {"@id": "urn:ex:s294", "urn:ex:p": "http:g"}
493
- ]
494
- },
495
- {
496
- "@context": {"@base": "http://abc/def/ghi", "urn:ex:p": {"@type": "@id"}},
497
- "@graph": [
498
- {"@id": "urn:ex:s295", "urn:ex:p": "."},
499
- {"@id": "urn:ex:s296", "urn:ex:p": ".?a=b"},
500
- {"@id": "urn:ex:s297", "urn:ex:p": ".#a=b"},
501
- {"@id": "urn:ex:s298", "urn:ex:p": ".."},
502
- {"@id": "urn:ex:s299", "urn:ex:p": "..?a=b"},
503
- {"@id": "urn:ex:s300", "urn:ex:p": "..#a=b"}
504
- ]
505
- },
506
- {
507
- "@context": {"@base": "http://ab//de//ghi", "urn:ex:p": {"@type": "@id"}},
508
- "@graph": [
509
- {"@id": "urn:ex:s301", "urn:ex:p": "xyz"},
510
- {"@id": "urn:ex:s302", "urn:ex:p": "./xyz"},
511
- {"@id": "urn:ex:s303", "urn:ex:p": "../xyz"}
512
- ]
513
- },
514
- {
515
- "@context": {"@base": "http://abc/d:f/ghi", "urn:ex:p": {"@type": "@id"}},
516
- "@graph": [
517
- {"@id": "urn:ex:s304", "urn:ex:p": "xyz"},
518
- {"@id": "urn:ex:s305", "urn:ex:p": "./xyz"},
519
- {"@id": "urn:ex:s306", "urn:ex:p": "../xyz"}
520
- ]
521
- }
522
- ]}}
523
- let(:nt) {%q{
524
- # RFC3986 normal examples
525
-
526
- <urn:ex:s001> <urn:ex:p> <gg:h>.
527
- <urn:ex:s002> <urn:ex:p> <http://a/bb/ccc/g>.
528
- <urn:ex:s003> <urn:ex:p> <http://a/bb/ccc/g>.
529
- <urn:ex:s004> <urn:ex:p> <http://a/bb/ccc/g/>.
530
- <urn:ex:s005> <urn:ex:p> <http://a/g>.
531
- <urn:ex:s006> <urn:ex:p> <http://g>.
532
- <urn:ex:s007> <urn:ex:p> <http://a/bb/ccc/d;p?y>.
533
- <urn:ex:s008> <urn:ex:p> <http://a/bb/ccc/g?y>.
534
- <urn:ex:s009> <urn:ex:p> <http://a/bb/ccc/d;p?q#s>.
535
- <urn:ex:s010> <urn:ex:p> <http://a/bb/ccc/g#s>.
536
- <urn:ex:s011> <urn:ex:p> <http://a/bb/ccc/g?y#s>.
537
- <urn:ex:s012> <urn:ex:p> <http://a/bb/ccc/;x>.
538
- <urn:ex:s013> <urn:ex:p> <http://a/bb/ccc/g;x>.
539
- <urn:ex:s014> <urn:ex:p> <http://a/bb/ccc/g;x?y#s>.
540
- <urn:ex:s015> <urn:ex:p> <http://a/bb/ccc/d;p?q>.
541
- <urn:ex:s016> <urn:ex:p> <http://a/bb/ccc/>.
542
- <urn:ex:s017> <urn:ex:p> <http://a/bb/ccc/>.
543
- <urn:ex:s018> <urn:ex:p> <http://a/bb/>.
544
- <urn:ex:s019> <urn:ex:p> <http://a/bb/>.
545
- <urn:ex:s020> <urn:ex:p> <http://a/bb/g>.
546
- <urn:ex:s021> <urn:ex:p> <http://a/>.
547
- <urn:ex:s022> <urn:ex:p> <http://a/>.
548
- <urn:ex:s023> <urn:ex:p> <http://a/g>.
549
-
550
- # RFC3986 abnormal examples
551
-
552
- <urn:ex:s024> <urn:ex:p> <http://a/g>.
553
- <urn:ex:s025> <urn:ex:p> <http://a/g>.
554
- <urn:ex:s026> <urn:ex:p> <http://a/g>.
555
- <urn:ex:s027> <urn:ex:p> <http://a/g>.
556
- <urn:ex:s028> <urn:ex:p> <http://a/bb/ccc/g.>.
557
- <urn:ex:s029> <urn:ex:p> <http://a/bb/ccc/.g>.
558
- <urn:ex:s030> <urn:ex:p> <http://a/bb/ccc/g..>.
559
- <urn:ex:s031> <urn:ex:p> <http://a/bb/ccc/..g>.
560
- <urn:ex:s032> <urn:ex:p> <http://a/bb/g>.
561
- <urn:ex:s033> <urn:ex:p> <http://a/bb/ccc/g/>.
562
- <urn:ex:s034> <urn:ex:p> <http://a/bb/ccc/g/h>.
563
- <urn:ex:s035> <urn:ex:p> <http://a/bb/ccc/h>.
564
- <urn:ex:s036> <urn:ex:p> <http://a/bb/ccc/g;x=1/y>.
565
- <urn:ex:s037> <urn:ex:p> <http://a/bb/ccc/y>.
566
- <urn:ex:s038> <urn:ex:p> <http://a/bb/ccc/g?y/./x>.
567
- <urn:ex:s039> <urn:ex:p> <http://a/bb/ccc/g?y/../x>.
568
- <urn:ex:s040> <urn:ex:p> <http://a/bb/ccc/g#s/./x>.
569
- <urn:ex:s041> <urn:ex:p> <http://a/bb/ccc/g#s/../x>.
570
- <urn:ex:s042> <urn:ex:p> <http:g>.
571
-
572
- # RFC3986 normal examples with trailing slash in base IRI
573
-
574
- <urn:ex:s043> <urn:ex:p> <gg:h>.
575
- <urn:ex:s044> <urn:ex:p> <http://a/bb/ccc/d/g>.
576
- <urn:ex:s045> <urn:ex:p> <http://a/bb/ccc/d/g>.
577
- <urn:ex:s046> <urn:ex:p> <http://a/bb/ccc/d/g/>.
578
- <urn:ex:s047> <urn:ex:p> <http://a/g>.
579
- <urn:ex:s048> <urn:ex:p> <http://g>.
580
- <urn:ex:s049> <urn:ex:p> <http://a/bb/ccc/d/?y>.
581
- <urn:ex:s050> <urn:ex:p> <http://a/bb/ccc/d/g?y>.
582
- <urn:ex:s051> <urn:ex:p> <http://a/bb/ccc/d/#s>.
583
- <urn:ex:s052> <urn:ex:p> <http://a/bb/ccc/d/g#s>.
584
- <urn:ex:s053> <urn:ex:p> <http://a/bb/ccc/d/g?y#s>.
585
- <urn:ex:s054> <urn:ex:p> <http://a/bb/ccc/d/;x>.
586
- <urn:ex:s055> <urn:ex:p> <http://a/bb/ccc/d/g;x>.
587
- <urn:ex:s056> <urn:ex:p> <http://a/bb/ccc/d/g;x?y#s>.
588
- <urn:ex:s057> <urn:ex:p> <http://a/bb/ccc/d/>.
589
- <urn:ex:s058> <urn:ex:p> <http://a/bb/ccc/d/>.
590
- <urn:ex:s059> <urn:ex:p> <http://a/bb/ccc/d/>.
591
- <urn:ex:s060> <urn:ex:p> <http://a/bb/ccc/>.
592
- <urn:ex:s061> <urn:ex:p> <http://a/bb/ccc/>.
593
- <urn:ex:s062> <urn:ex:p> <http://a/bb/ccc/g>.
594
- <urn:ex:s063> <urn:ex:p> <http://a/bb/>.
595
- <urn:ex:s064> <urn:ex:p> <http://a/bb/>.
596
- <urn:ex:s065> <urn:ex:p> <http://a/bb/g>.
597
-
598
- # RFC3986 abnormal examples with trailing slash in base IRI
599
-
600
- <urn:ex:s066> <urn:ex:p> <http://a/g>.
601
- <urn:ex:s067> <urn:ex:p> <http://a/g>.
602
- <urn:ex:s068> <urn:ex:p> <http://a/g>.
603
- <urn:ex:s069> <urn:ex:p> <http://a/g>.
604
- <urn:ex:s070> <urn:ex:p> <http://a/bb/ccc/d/g.>.
605
- <urn:ex:s071> <urn:ex:p> <http://a/bb/ccc/d/.g>.
606
- <urn:ex:s072> <urn:ex:p> <http://a/bb/ccc/d/g..>.
607
- <urn:ex:s073> <urn:ex:p> <http://a/bb/ccc/d/..g>.
608
- <urn:ex:s074> <urn:ex:p> <http://a/bb/ccc/g>.
609
- <urn:ex:s075> <urn:ex:p> <http://a/bb/ccc/d/g/>.
610
- <urn:ex:s076> <urn:ex:p> <http://a/bb/ccc/d/g/h>.
611
- <urn:ex:s077> <urn:ex:p> <http://a/bb/ccc/d/h>.
612
- <urn:ex:s078> <urn:ex:p> <http://a/bb/ccc/d/g;x=1/y>.
613
- <urn:ex:s079> <urn:ex:p> <http://a/bb/ccc/d/y>.
614
- <urn:ex:s080> <urn:ex:p> <http://a/bb/ccc/d/g?y/./x>.
615
- <urn:ex:s081> <urn:ex:p> <http://a/bb/ccc/d/g?y/../x>.
616
- <urn:ex:s082> <urn:ex:p> <http://a/bb/ccc/d/g#s/./x>.
617
- <urn:ex:s083> <urn:ex:p> <http://a/bb/ccc/d/g#s/../x>.
618
- <urn:ex:s084> <urn:ex:p> <http:g>.
619
-
620
- # RFC3986 normal examples with /. in the base IRI
621
-
622
- <urn:ex:s085> <urn:ex:p> <gg:h>.
623
- <urn:ex:s086> <urn:ex:p> <http://a/bb/ccc/g>.
624
- <urn:ex:s087> <urn:ex:p> <http://a/bb/ccc/g>.
625
- <urn:ex:s088> <urn:ex:p> <http://a/bb/ccc/g/>.
626
- <urn:ex:s089> <urn:ex:p> <http://a/g>.
627
- <urn:ex:s090> <urn:ex:p> <http://g>.
628
- <urn:ex:s091> <urn:ex:p> <http://a/bb/ccc/./d;p?y>.
629
- <urn:ex:s092> <urn:ex:p> <http://a/bb/ccc/g?y>.
630
- <urn:ex:s093> <urn:ex:p> <http://a/bb/ccc/./d;p?q#s>.
631
- <urn:ex:s094> <urn:ex:p> <http://a/bb/ccc/g#s>.
632
- <urn:ex:s095> <urn:ex:p> <http://a/bb/ccc/g?y#s>.
633
- <urn:ex:s096> <urn:ex:p> <http://a/bb/ccc/;x>.
634
- <urn:ex:s097> <urn:ex:p> <http://a/bb/ccc/g;x>.
635
- <urn:ex:s098> <urn:ex:p> <http://a/bb/ccc/g;x?y#s>.
636
- <urn:ex:s099> <urn:ex:p> <http://a/bb/ccc/./d;p?q>.
637
- <urn:ex:s100> <urn:ex:p> <http://a/bb/ccc/>.
638
- <urn:ex:s101> <urn:ex:p> <http://a/bb/ccc/>.
639
- <urn:ex:s102> <urn:ex:p> <http://a/bb/>.
640
- <urn:ex:s103> <urn:ex:p> <http://a/bb/>.
641
- <urn:ex:s104> <urn:ex:p> <http://a/bb/g>.
642
- <urn:ex:s105> <urn:ex:p> <http://a/>.
643
- <urn:ex:s106> <urn:ex:p> <http://a/>.
644
- <urn:ex:s107> <urn:ex:p> <http://a/g>.
645
-
646
- # RFC3986 abnormal examples with /. in the base IRI
647
-
648
- <urn:ex:s108> <urn:ex:p> <http://a/g>.
649
- <urn:ex:s109> <urn:ex:p> <http://a/g>.
650
- <urn:ex:s110> <urn:ex:p> <http://a/g>.
651
- <urn:ex:s111> <urn:ex:p> <http://a/g>.
652
- <urn:ex:s112> <urn:ex:p> <http://a/bb/ccc/g.>.
653
- <urn:ex:s113> <urn:ex:p> <http://a/bb/ccc/.g>.
654
- <urn:ex:s114> <urn:ex:p> <http://a/bb/ccc/g..>.
655
- <urn:ex:s115> <urn:ex:p> <http://a/bb/ccc/..g>.
656
- <urn:ex:s116> <urn:ex:p> <http://a/bb/g>.
657
- <urn:ex:s117> <urn:ex:p> <http://a/bb/ccc/g/>.
658
- <urn:ex:s118> <urn:ex:p> <http://a/bb/ccc/g/h>.
659
- <urn:ex:s119> <urn:ex:p> <http://a/bb/ccc/h>.
660
- <urn:ex:s120> <urn:ex:p> <http://a/bb/ccc/g;x=1/y>.
661
- <urn:ex:s121> <urn:ex:p> <http://a/bb/ccc/y>.
662
- <urn:ex:s122> <urn:ex:p> <http://a/bb/ccc/g?y/./x>.
663
- <urn:ex:s123> <urn:ex:p> <http://a/bb/ccc/g?y/../x>.
664
- <urn:ex:s124> <urn:ex:p> <http://a/bb/ccc/g#s/./x>.
665
- <urn:ex:s125> <urn:ex:p> <http://a/bb/ccc/g#s/../x>.
666
- <urn:ex:s126> <urn:ex:p> <http:g>.
667
-
668
- # RFC3986 normal examples with /.. in the base IRI
669
-
670
- <urn:ex:s127> <urn:ex:p> <gg:h>.
671
- <urn:ex:s128> <urn:ex:p> <http://a/bb/g>.
672
- <urn:ex:s129> <urn:ex:p> <http://a/bb/g>.
673
- <urn:ex:s130> <urn:ex:p> <http://a/bb/g/>.
674
- <urn:ex:s131> <urn:ex:p> <http://a/g>.
675
- <urn:ex:s132> <urn:ex:p> <http://g>.
676
- <urn:ex:s133> <urn:ex:p> <http://a/bb/ccc/../d;p?y>.
677
- <urn:ex:s134> <urn:ex:p> <http://a/bb/g?y>.
678
- <urn:ex:s135> <urn:ex:p> <http://a/bb/ccc/../d;p?q#s>.
679
- <urn:ex:s136> <urn:ex:p> <http://a/bb/g#s>.
680
- <urn:ex:s137> <urn:ex:p> <http://a/bb/g?y#s>.
681
- <urn:ex:s138> <urn:ex:p> <http://a/bb/;x>.
682
- <urn:ex:s139> <urn:ex:p> <http://a/bb/g;x>.
683
- <urn:ex:s140> <urn:ex:p> <http://a/bb/g;x?y#s>.
684
- <urn:ex:s141> <urn:ex:p> <http://a/bb/ccc/../d;p?q>.
685
- <urn:ex:s142> <urn:ex:p> <http://a/bb/>.
686
- <urn:ex:s143> <urn:ex:p> <http://a/bb/>.
687
- <urn:ex:s144> <urn:ex:p> <http://a/>.
688
- <urn:ex:s145> <urn:ex:p> <http://a/>.
689
- <urn:ex:s146> <urn:ex:p> <http://a/g>.
690
- <urn:ex:s147> <urn:ex:p> <http://a/>.
691
- <urn:ex:s148> <urn:ex:p> <http://a/>.
692
- <urn:ex:s149> <urn:ex:p> <http://a/g>.
693
-
694
- # RFC3986 abnormal examples with /.. in the base IRI
695
-
696
- <urn:ex:s150> <urn:ex:p> <http://a/g>.
697
- <urn:ex:s151> <urn:ex:p> <http://a/g>.
698
- <urn:ex:s152> <urn:ex:p> <http://a/g>.
699
- <urn:ex:s153> <urn:ex:p> <http://a/g>.
700
- <urn:ex:s154> <urn:ex:p> <http://a/bb/g.>.
701
- <urn:ex:s155> <urn:ex:p> <http://a/bb/.g>.
702
- <urn:ex:s156> <urn:ex:p> <http://a/bb/g..>.
703
- <urn:ex:s157> <urn:ex:p> <http://a/bb/..g>.
704
- <urn:ex:s158> <urn:ex:p> <http://a/g>.
705
- <urn:ex:s159> <urn:ex:p> <http://a/bb/g/>.
706
- <urn:ex:s160> <urn:ex:p> <http://a/bb/g/h>.
707
- <urn:ex:s161> <urn:ex:p> <http://a/bb/h>.
708
- <urn:ex:s162> <urn:ex:p> <http://a/bb/g;x=1/y>.
709
- <urn:ex:s163> <urn:ex:p> <http://a/bb/y>.
710
- <urn:ex:s164> <urn:ex:p> <http://a/bb/g?y/./x>.
711
- <urn:ex:s165> <urn:ex:p> <http://a/bb/g?y/../x>.
712
- <urn:ex:s166> <urn:ex:p> <http://a/bb/g#s/./x>.
713
- <urn:ex:s167> <urn:ex:p> <http://a/bb/g#s/../x>.
714
- <urn:ex:s168> <urn:ex:p> <http:g>.
715
-
716
- # RFC3986 normal examples with trailing /. in the base IRI
717
-
718
- <urn:ex:s169> <urn:ex:p> <gg:h>.
719
- <urn:ex:s170> <urn:ex:p> <http://a/bb/ccc/g>.
720
- <urn:ex:s171> <urn:ex:p> <http://a/bb/ccc/g>.
721
- <urn:ex:s172> <urn:ex:p> <http://a/bb/ccc/g/>.
722
- <urn:ex:s173> <urn:ex:p> <http://a/g>.
723
- <urn:ex:s174> <urn:ex:p> <http://g>.
724
- <urn:ex:s175> <urn:ex:p> <http://a/bb/ccc/.?y>.
725
- <urn:ex:s176> <urn:ex:p> <http://a/bb/ccc/g?y>.
726
- <urn:ex:s177> <urn:ex:p> <http://a/bb/ccc/.#s>.
727
- <urn:ex:s178> <urn:ex:p> <http://a/bb/ccc/g#s>.
728
- <urn:ex:s179> <urn:ex:p> <http://a/bb/ccc/g?y#s>.
729
- <urn:ex:s180> <urn:ex:p> <http://a/bb/ccc/;x>.
730
- <urn:ex:s181> <urn:ex:p> <http://a/bb/ccc/g;x>.
731
- <urn:ex:s182> <urn:ex:p> <http://a/bb/ccc/g;x?y#s>.
732
- <urn:ex:s183> <urn:ex:p> <http://a/bb/ccc/.>.
733
- <urn:ex:s184> <urn:ex:p> <http://a/bb/ccc/>.
734
- <urn:ex:s185> <urn:ex:p> <http://a/bb/ccc/>.
735
- <urn:ex:s186> <urn:ex:p> <http://a/bb/>.
736
- <urn:ex:s187> <urn:ex:p> <http://a/bb/>.
737
- <urn:ex:s188> <urn:ex:p> <http://a/bb/g>.
738
- <urn:ex:s189> <urn:ex:p> <http://a/>.
739
- <urn:ex:s190> <urn:ex:p> <http://a/>.
740
- <urn:ex:s191> <urn:ex:p> <http://a/g>.
741
-
742
- # RFC3986 abnormal examples with trailing /. in the base IRI
743
-
744
- <urn:ex:s192> <urn:ex:p> <http://a/g>.
745
- <urn:ex:s193> <urn:ex:p> <http://a/g>.
746
- <urn:ex:s194> <urn:ex:p> <http://a/g>.
747
- <urn:ex:s195> <urn:ex:p> <http://a/g>.
748
- <urn:ex:s196> <urn:ex:p> <http://a/bb/ccc/g.>.
749
- <urn:ex:s197> <urn:ex:p> <http://a/bb/ccc/.g>.
750
- <urn:ex:s198> <urn:ex:p> <http://a/bb/ccc/g..>.
751
- <urn:ex:s199> <urn:ex:p> <http://a/bb/ccc/..g>.
752
- <urn:ex:s200> <urn:ex:p> <http://a/bb/g>.
753
- <urn:ex:s201> <urn:ex:p> <http://a/bb/ccc/g/>.
754
- <urn:ex:s202> <urn:ex:p> <http://a/bb/ccc/g/h>.
755
- <urn:ex:s203> <urn:ex:p> <http://a/bb/ccc/h>.
756
- <urn:ex:s204> <urn:ex:p> <http://a/bb/ccc/g;x=1/y>.
757
- <urn:ex:s205> <urn:ex:p> <http://a/bb/ccc/y>.
758
- <urn:ex:s206> <urn:ex:p> <http://a/bb/ccc/g?y/./x>.
759
- <urn:ex:s207> <urn:ex:p> <http://a/bb/ccc/g?y/../x>.
760
- <urn:ex:s208> <urn:ex:p> <http://a/bb/ccc/g#s/./x>.
761
- <urn:ex:s209> <urn:ex:p> <http://a/bb/ccc/g#s/../x>.
762
- <urn:ex:s210> <urn:ex:p> <http:g>.
763
-
764
- # RFC3986 normal examples with trailing /.. in the base IRI
765
-
766
- <urn:ex:s211> <urn:ex:p> <gg:h>.
767
- <urn:ex:s212> <urn:ex:p> <http://a/bb/ccc/g>.
768
- <urn:ex:s213> <urn:ex:p> <http://a/bb/ccc/g>.
769
- <urn:ex:s214> <urn:ex:p> <http://a/bb/ccc/g/>.
770
- <urn:ex:s215> <urn:ex:p> <http://a/g>.
771
- <urn:ex:s216> <urn:ex:p> <http://g>.
772
- <urn:ex:s217> <urn:ex:p> <http://a/bb/ccc/..?y>.
773
- <urn:ex:s218> <urn:ex:p> <http://a/bb/ccc/g?y>.
774
- <urn:ex:s219> <urn:ex:p> <http://a/bb/ccc/..#s>.
775
- <urn:ex:s220> <urn:ex:p> <http://a/bb/ccc/g#s>.
776
- <urn:ex:s221> <urn:ex:p> <http://a/bb/ccc/g?y#s>.
777
- <urn:ex:s222> <urn:ex:p> <http://a/bb/ccc/;x>.
778
- <urn:ex:s223> <urn:ex:p> <http://a/bb/ccc/g;x>.
779
- <urn:ex:s224> <urn:ex:p> <http://a/bb/ccc/g;x?y#s>.
780
- <urn:ex:s225> <urn:ex:p> <http://a/bb/ccc/..>.
781
- <urn:ex:s226> <urn:ex:p> <http://a/bb/ccc/>.
782
- <urn:ex:s227> <urn:ex:p> <http://a/bb/ccc/>.
783
- <urn:ex:s228> <urn:ex:p> <http://a/bb/>.
784
- <urn:ex:s229> <urn:ex:p> <http://a/bb/>.
785
- <urn:ex:s230> <urn:ex:p> <http://a/bb/g>.
786
- <urn:ex:s231> <urn:ex:p> <http://a/>.
787
- <urn:ex:s232> <urn:ex:p> <http://a/>.
788
- <urn:ex:s233> <urn:ex:p> <http://a/g>.
789
-
790
- # RFC3986 abnormal examples with trailing /.. in the base IRI
791
-
792
- <urn:ex:s234> <urn:ex:p> <http://a/g>.
793
- <urn:ex:s235> <urn:ex:p> <http://a/g>.
794
- <urn:ex:s236> <urn:ex:p> <http://a/g>.
795
- <urn:ex:s237> <urn:ex:p> <http://a/g>.
796
- <urn:ex:s238> <urn:ex:p> <http://a/bb/ccc/g.>.
797
- <urn:ex:s239> <urn:ex:p> <http://a/bb/ccc/.g>.
798
- <urn:ex:s240> <urn:ex:p> <http://a/bb/ccc/g..>.
799
- <urn:ex:s241> <urn:ex:p> <http://a/bb/ccc/..g>.
800
- <urn:ex:s242> <urn:ex:p> <http://a/bb/g>.
801
- <urn:ex:s243> <urn:ex:p> <http://a/bb/ccc/g/>.
802
- <urn:ex:s244> <urn:ex:p> <http://a/bb/ccc/g/h>.
803
- <urn:ex:s245> <urn:ex:p> <http://a/bb/ccc/h>.
804
- <urn:ex:s246> <urn:ex:p> <http://a/bb/ccc/g;x=1/y>.
805
- <urn:ex:s247> <urn:ex:p> <http://a/bb/ccc/y>.
806
- <urn:ex:s248> <urn:ex:p> <http://a/bb/ccc/g?y/./x>.
807
- <urn:ex:s249> <urn:ex:p> <http://a/bb/ccc/g?y/../x>.
808
- <urn:ex:s250> <urn:ex:p> <http://a/bb/ccc/g#s/./x>.
809
- <urn:ex:s251> <urn:ex:p> <http://a/bb/ccc/g#s/../x>.
810
- <urn:ex:s252> <urn:ex:p> <http:g>.
811
-
812
- # RFC3986 normal examples with file path
813
-
814
- <urn:ex:s253> <urn:ex:p> <gg:h>.
815
- <urn:ex:s254> <urn:ex:p> <file:///a/bb/ccc/g>.
816
- <urn:ex:s255> <urn:ex:p> <file:///a/bb/ccc/g>.
817
- <urn:ex:s256> <urn:ex:p> <file:///a/bb/ccc/g/>.
818
- <urn:ex:s257> <urn:ex:p> <file:///g>.
819
- <urn:ex:s258> <urn:ex:p> <file://g>.
820
- <urn:ex:s259> <urn:ex:p> <file:///a/bb/ccc/d;p?y>.
821
- <urn:ex:s260> <urn:ex:p> <file:///a/bb/ccc/g?y>.
822
- <urn:ex:s261> <urn:ex:p> <file:///a/bb/ccc/d;p?q#s>.
823
- <urn:ex:s262> <urn:ex:p> <file:///a/bb/ccc/g#s>.
824
- <urn:ex:s263> <urn:ex:p> <file:///a/bb/ccc/g?y#s>.
825
- <urn:ex:s264> <urn:ex:p> <file:///a/bb/ccc/;x>.
826
- <urn:ex:s265> <urn:ex:p> <file:///a/bb/ccc/g;x>.
827
- <urn:ex:s266> <urn:ex:p> <file:///a/bb/ccc/g;x?y#s>.
828
- <urn:ex:s267> <urn:ex:p> <file:///a/bb/ccc/d;p?q>.
829
- <urn:ex:s268> <urn:ex:p> <file:///a/bb/ccc/>.
830
- <urn:ex:s269> <urn:ex:p> <file:///a/bb/ccc/>.
831
- <urn:ex:s270> <urn:ex:p> <file:///a/bb/>.
832
- <urn:ex:s271> <urn:ex:p> <file:///a/bb/>.
833
- <urn:ex:s272> <urn:ex:p> <file:///a/bb/g>.
834
- <urn:ex:s273> <urn:ex:p> <file:///a/>.
835
- <urn:ex:s274> <urn:ex:p> <file:///a/>.
836
- <urn:ex:s275> <urn:ex:p> <file:///a/g>.
837
-
838
- # RFC3986 abnormal examples with file path
839
-
840
- <urn:ex:s276> <urn:ex:p> <file:///g>.
841
- <urn:ex:s277> <urn:ex:p> <file:///g>.
842
- <urn:ex:s278> <urn:ex:p> <file:///g>.
843
- <urn:ex:s279> <urn:ex:p> <file:///g>.
844
- <urn:ex:s280> <urn:ex:p> <file:///a/bb/ccc/g.>.
845
- <urn:ex:s281> <urn:ex:p> <file:///a/bb/ccc/.g>.
846
- <urn:ex:s282> <urn:ex:p> <file:///a/bb/ccc/g..>.
847
- <urn:ex:s283> <urn:ex:p> <file:///a/bb/ccc/..g>.
848
- <urn:ex:s284> <urn:ex:p> <file:///a/bb/g>.
849
- <urn:ex:s285> <urn:ex:p> <file:///a/bb/ccc/g/>.
850
- <urn:ex:s286> <urn:ex:p> <file:///a/bb/ccc/g/h>.
851
- <urn:ex:s287> <urn:ex:p> <file:///a/bb/ccc/h>.
852
- <urn:ex:s288> <urn:ex:p> <file:///a/bb/ccc/g;x=1/y>.
853
- <urn:ex:s289> <urn:ex:p> <file:///a/bb/ccc/y>.
854
- <urn:ex:s290> <urn:ex:p> <file:///a/bb/ccc/g?y/./x>.
855
- <urn:ex:s291> <urn:ex:p> <file:///a/bb/ccc/g?y/../x>.
856
- <urn:ex:s292> <urn:ex:p> <file:///a/bb/ccc/g#s/./x>.
857
- <urn:ex:s293> <urn:ex:p> <file:///a/bb/ccc/g#s/../x>.
858
- <urn:ex:s294> <urn:ex:p> <http:g>.
859
-
860
- # additional cases
861
-
862
- <urn:ex:s295> <urn:ex:p> <http://abc/def/>.
863
- <urn:ex:s296> <urn:ex:p> <http://abc/def/?a=b>.
864
- <urn:ex:s297> <urn:ex:p> <http://abc/def/#a=b>.
865
- <urn:ex:s298> <urn:ex:p> <http://abc/>.
866
- <urn:ex:s299> <urn:ex:p> <http://abc/?a=b>.
867
- <urn:ex:s300> <urn:ex:p> <http://abc/#a=b>.
868
-
869
- <urn:ex:s301> <urn:ex:p> <http://ab//de//xyz>.
870
- <urn:ex:s302> <urn:ex:p> <http://ab//de//xyz>.
871
- <urn:ex:s303> <urn:ex:p> <http://ab//de/xyz>.
872
-
873
- <urn:ex:s304> <urn:ex:p> <http://abc/d:f/xyz>.
874
- <urn:ex:s305> <urn:ex:p> <http://abc/d:f/xyz>.
875
- <urn:ex:s306> <urn:ex:p> <http://abc/xyz>.
876
- }}
877
- it "produces equivalent triples" do
878
- nt_str = RDF::NTriples::Reader.new(nt).dump(:ntriples)
879
- json_str = JSON::LD::Reader.new(json).dump(:ntriples)
880
- expect(json_str).to eql(nt_str)
881
- end
882
- end
883
- end