rdf-n3 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.yardopts +1 -0
- data/History.txt +9 -0
- data/README.rdoc +4 -2
- data/Rakefile +37 -2
- data/VERSION +1 -1
- data/example.rb +1 -1
- data/lib/rdf/n3.rb +12 -5
- data/lib/rdf/n3/format.rb +0 -1
- data/lib/rdf/n3/patches/array_hacks.rb +46 -124
- data/lib/rdf/n3/patches/graph_properties.rb +34 -0
- data/lib/rdf/n3/patches/literal_hacks.rb +23 -0
- data/lib/rdf/n3/patches/literal_normalization.rb +120 -0
- data/lib/rdf/n3/patches/qname_hacks.rb +57 -0
- data/lib/rdf/n3/patches/rdf_escape.rb +3 -3
- data/lib/rdf/n3/patches/seq.rb +34 -0
- data/lib/rdf/n3/patches/uri_hacks.rb +19 -0
- data/lib/rdf/n3/reader.rb +110 -68
- data/lib/rdf/n3/reader/n3_grammar.rb +3876 -0
- data/lib/rdf/n3/{vocabulary.rb → vocab.rb} +0 -0
- data/lib/rdf/n3/writer.rb +444 -0
- data/rdf-n3.gemspec +38 -15
- data/script/console +8 -0
- data/script/parse +49 -0
- data/spec/cwm_spec.rb +13 -5
- data/spec/format_spec.rb +21 -0
- data/spec/literal_spec.rb +382 -0
- data/spec/matchers.rb +101 -0
- data/spec/n3reader_spec.rb +253 -185
- data/spec/rdf_helper.rb +115 -89
- data/spec/spec_helper.rb +39 -0
- data/spec/swap_spec.rb +24 -10
- data/spec/swap_test/n3parser.yml +193 -0
- data/spec/swap_test/regression.yml +226 -0
- data/spec/turtle_spec.rb +23 -8
- data/spec/writer_spec.rb +250 -0
- metadata +80 -22
- data/spec/swap_helper.rb +0 -136
- data/spec/triple_spec.rb +0 -236
data/spec/rdf_helper.rb
CHANGED
@@ -1,9 +1,21 @@
|
|
1
|
+
autoload :YAML, "yaml"
|
2
|
+
autoload :CGI, 'cgi'
|
3
|
+
|
4
|
+
RDFCORE_DIR = File.join(File.dirname(__FILE__), 'rdfcore')
|
5
|
+
RDFCORE_TEST = "http://www.w3.org/2000/10/rdf-tests/rdfcore/Manifest.rdf"
|
6
|
+
SWAP_DIR = File.join(File.dirname(__FILE__), 'swap_test')
|
7
|
+
SWAP_TEST = "http://www.w3.org/2000/10/swap/test/n3parser.tests"
|
8
|
+
CWM_TEST = "http://www.w3.org/2000/10/swap/test/regression.n3"
|
9
|
+
TURTLE_DIR = File.join(File.dirname(__FILE__), 'turtle')
|
10
|
+
TURTLE_TEST = "http://www.w3.org/2001/sw/DataAccess/df1/tests/manifest.ttl"
|
11
|
+
TURTLE_BAD_TEST = "http://www.w3.org/2001/sw/DataAccess/df1/tests/manifest-bad.ttl"
|
12
|
+
|
1
13
|
module RdfHelper
|
2
14
|
# Class representing test cases in format http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema#
|
15
|
+
|
3
16
|
class TestCase
|
4
|
-
|
5
|
-
|
6
|
-
QT_NS = Namespace.new("http://www.w3.org/2001/sw/DataAccess/tests/test-query#", "qt")
|
17
|
+
class MF < RDF::Vocabulary("http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#"); end
|
18
|
+
class QT < RDF::Vocabulary("http://www.w3.org/2001/sw/DataAccess/tests/test-query#"); end
|
7
19
|
|
8
20
|
attr_accessor :about
|
9
21
|
attr_accessor :approval
|
@@ -23,52 +35,59 @@ module RdfHelper
|
|
23
35
|
attr_accessor :warning
|
24
36
|
attr_accessor :parser
|
25
37
|
attr_accessor :compare
|
38
|
+
attr_accessor :debug
|
26
39
|
|
27
|
-
def initialize(
|
40
|
+
def initialize(statements, uri_prefix, test_dir, options = {})
|
28
41
|
case options[:test_type]
|
29
42
|
when :mf
|
30
|
-
parse_mf(
|
43
|
+
parse_mf(statements, uri_prefix, test_dir, options[:graph])
|
31
44
|
else
|
32
|
-
parse_w3c(
|
45
|
+
parse_w3c(statements, uri_prefix, test_dir)
|
33
46
|
end
|
34
47
|
end
|
35
|
-
|
36
|
-
def parse_w3c(
|
37
|
-
|
38
|
-
next if statement.subject.is_a?(
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
self.
|
45
|
-
puts
|
46
|
-
|
47
|
-
|
48
|
-
|
48
|
+
|
49
|
+
def parse_w3c(statements, uri_prefix, test_dir)
|
50
|
+
statements.each do |statement|
|
51
|
+
next if statement.subject.is_a?(RDF::Node)
|
52
|
+
pred = statement.predicate.to_s.split(/[\#\/]/).last
|
53
|
+
obj = statement.object.is_a?(RDF::Literal) ? statement.object.value : statement.object.to_s
|
54
|
+
|
55
|
+
puts "#{pred}: #{obj}" if $DEBUG
|
56
|
+
if statement.predicate == RDF.type
|
57
|
+
self.rdf_type = obj.to_s.split(/[\#\/]/).last
|
58
|
+
#puts statement.subject.to_s
|
59
|
+
elsif pred =~ /Document\Z/i
|
60
|
+
puts "sub #{uri_prefix} in #{obj} for #{test_dir}" if $DEBUG
|
61
|
+
about = obj.dup
|
62
|
+
obj.sub!(uri_prefix, test_dir)
|
63
|
+
puts " => #{obj}" if $DEBUG
|
64
|
+
self.send("#{pred}=", obj)
|
65
|
+
if pred == "inputDocument"
|
66
|
+
self.about ||= about
|
67
|
+
self.name ||= statement.subject.to_s.split(/[\#\/]/).last
|
49
68
|
end
|
50
|
-
elsif
|
51
|
-
puts "referenceOutput: #{
|
52
|
-
outputDocument =
|
53
|
-
puts "referenceOutput: " + self.send(
|
54
|
-
elsif self.respond_to?("#{
|
55
|
-
self.send("#{
|
69
|
+
elsif pred == "referenceOutput"
|
70
|
+
puts "referenceOutput: #{obj}" if $DEBUG
|
71
|
+
outputDocument = obj.sub(uri_prefix, test_dir)
|
72
|
+
puts "referenceOutput: " + self.send(pred) if $DEBUG
|
73
|
+
elsif self.respond_to?("#{pred}=")
|
74
|
+
self.send("#{pred}=", obj)
|
56
75
|
end
|
57
76
|
end
|
58
77
|
end
|
59
78
|
|
60
79
|
def parse_mf(subject, uri_prefix, test_dir, graph)
|
61
80
|
props = graph.properties(subject)
|
62
|
-
@name = (props[
|
63
|
-
@description = (props[
|
64
|
-
@outputDocument = (props[
|
81
|
+
@name = (props[MF['name'].to_s] || []).first.to_s
|
82
|
+
@description = (props[RDF::RDFS.comment.to_s] || []).first.to_s
|
83
|
+
@outputDocument = (props[MF.result.to_s] || []).first
|
65
84
|
@outputDocument = @outputDocument.to_s.sub(uri_prefix, test_dir) if @outputDocument
|
66
|
-
action = (props[
|
85
|
+
action = (props[MF.action.to_s] || []).first
|
67
86
|
a_props = graph.properties(action)
|
68
|
-
@about = (a_props[
|
87
|
+
@about = (a_props[QT.data.to_s] || []).first
|
69
88
|
@inputDocument = @about.to_s.sub(uri_prefix, test_dir)
|
70
89
|
end
|
71
|
-
|
90
|
+
|
72
91
|
def inspect
|
73
92
|
"[Test Case " + %w(
|
74
93
|
about
|
@@ -100,8 +119,7 @@ module RdfHelper
|
|
100
119
|
rdf_string = input
|
101
120
|
|
102
121
|
# Run
|
103
|
-
|
104
|
-
yield(rdf_string, @parser)
|
122
|
+
graph = yield(rdf_string)
|
105
123
|
|
106
124
|
return unless output
|
107
125
|
|
@@ -111,16 +129,14 @@ module RdfHelper
|
|
111
129
|
when :array
|
112
130
|
@parser.graph.should be_equivalent_graph(self.output, self)
|
113
131
|
else
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
@parser.graph.should be_equivalent_graph(output_parser, self)
|
132
|
+
output_graph = RDF::Graph.load(self.outputDocument, :format => detect_format(self.outputDocument))
|
133
|
+
puts "result: #{CGI.escapeHTML(graph.to_ntriples)}" if $DEBUG
|
134
|
+
graph.should Matchers::be_equivalent_graph(output_graph, self)
|
119
135
|
end
|
120
136
|
end
|
121
137
|
|
122
138
|
def trace
|
123
|
-
@
|
139
|
+
(@debug || []).to_a.join("\n")
|
124
140
|
end
|
125
141
|
|
126
142
|
def self.parse_test_cases(test_uri = nil, test_dir = nil)
|
@@ -131,70 +147,80 @@ module RdfHelper
|
|
131
147
|
|
132
148
|
test = test_uri.to_s.split('/').last
|
133
149
|
test_dir = test_dir + "/" unless test_dir.match(%r(/$))
|
150
|
+
ext = test.split(".").last
|
134
151
|
|
135
152
|
@positive_parser_tests = []
|
136
153
|
@negative_parser_tests = []
|
137
154
|
@positive_entailment_tests = []
|
138
155
|
@negative_entailment_tests = []
|
139
156
|
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
157
|
+
unless File.file?(File.join(test_dir, test.sub(ext, "yml")))
|
158
|
+
load_opts = {:base_uri => test_uri}
|
159
|
+
load_opts[:format] = :n3 if ext == "tests" # For swap tests
|
160
|
+
graph = RDF::Graph.load(File.join(test_dir, test), load_opts)
|
161
|
+
uri_base = Addressable::URI.join(test_uri, ".").to_s
|
162
|
+
t_uri = RDF::URI.new(test_uri)
|
163
|
+
|
164
|
+
# If this is a turtle test (type mf:Manifest) parse with
|
165
|
+
# alternative test case
|
166
|
+
case graph.type_of(t_uri).first
|
167
|
+
when MF.Manifest
|
168
|
+
# Get test entries
|
169
|
+
entries = graph.query(:subject => t_uri, :predicate => MF["entries"]).to_a
|
170
|
+
entries = entries.first
|
171
|
+
raise "No entires found for MF Manifest" unless entries.is_a?(RDF::Statement)
|
172
|
+
|
173
|
+
@test_cases = graph.seq(entries.object).map do |subject|
|
174
|
+
TestCase.new(subject, uri_base, test_dir, :test_type => :mf, :graph => graph)
|
175
|
+
end
|
176
|
+
else
|
177
|
+
# One of:
|
178
|
+
# http://www.w3.org/2000/10/rdf-tests/rdfcore/testSchema
|
179
|
+
# http://www.w3.org/2000/10/swap/test.n3#
|
180
|
+
# http://www.w3.org/2004/11/n3test#
|
181
|
+
# Group by subject
|
182
|
+
@test_cases = graph.subjects.map do |subj|
|
183
|
+
t = TestCase.new(graph.query(:subject => subj), uri_base, test_dir)
|
184
|
+
t.name ? t : nil
|
185
|
+
end.
|
186
|
+
compact.
|
187
|
+
sort_by{|t| t.name.to_s}
|
163
188
|
end
|
164
189
|
else
|
165
|
-
#
|
166
|
-
|
167
|
-
|
168
|
-
# http://www.w3.org/2004/11/n3test#
|
169
|
-
# Group by subject
|
170
|
-
test_hash = graph.triples.inject({}) do |hash, st|
|
171
|
-
a = hash[st.subject] ||= []
|
172
|
-
a << st
|
173
|
-
hash
|
174
|
-
end
|
190
|
+
# Read tests from Manifest.yml
|
191
|
+
self.from_yaml(File.join(test_dir, test.sub(ext, "yml")))
|
192
|
+
end
|
175
193
|
|
176
|
-
|
177
|
-
|
194
|
+
@test_cases.each do |tc|
|
195
|
+
next if tc.status && tc.status != "APPROVED"
|
196
|
+
case tc.rdf_type
|
197
|
+
when "PositiveParserTest" then @positive_parser_tests << tc
|
198
|
+
when "NegativeParserTest" then @negative_parser_tests << tc
|
199
|
+
when "PositiveEntailmentTest" then @positive_entailment_tests << tc
|
200
|
+
when "NegativeEntailmentTest" then @negative_entailment_tests << tc
|
178
201
|
end
|
179
|
-
|
180
|
-
compact.
|
181
|
-
sort_by{|t| t.name.to_s}
|
182
|
-
|
183
|
-
|
184
|
-
@test_cases.each do |tc|
|
185
|
-
next if tc.status && tc.status != "APPROVED"
|
186
|
-
case tc.rdf_type
|
187
|
-
when "PositiveParserTest" then @positive_parser_tests << tc
|
188
|
-
when "NegativeParserTest" then @negative_parser_tests << tc
|
189
|
-
when "PositiveEntailmentTest" then @positive_entailment_tests << tc
|
190
|
-
when "NegativeEntailmentTest" then @negative_entailment_tests << tc
|
191
|
-
end
|
192
|
-
end
|
202
|
+
end
|
193
203
|
end
|
194
204
|
def self.test_cases(test_uri = nil, test_dir = nil); parse_test_cases(test_uri, test_dir); @test_cases; end
|
195
205
|
def self.positive_parser_tests(test_uri = nil, test_dir = nil); parse_test_cases(test_uri, test_dir); @positive_parser_tests; end
|
196
206
|
def self.negative_parser_tests(test_uri = nil, test_dir = nil); parse_test_cases(test_uri, test_dir); @negative_parser_tests; end
|
197
207
|
def self.positive_entailment_tests(test_uri = nil, test_dir = nil); parse_test_cases(test_uri, test_dir); @positive_entailment_tests; end
|
198
208
|
def self.negative_entailment_tests(test_uri = nil, test_dir = nil); parse_test_cases(test_uri, test_dir); @negative_entailment_tests; end
|
209
|
+
|
210
|
+
def self.to_yaml(test_uri, test_dir, file)
|
211
|
+
test_cases = self.test_cases(test_uri, test_dir)
|
212
|
+
File.open(file, 'w') do |out|
|
213
|
+
YAML.dump(test_cases, out )
|
214
|
+
end
|
215
|
+
end
|
216
|
+
|
217
|
+
def self.from_yaml(file)
|
218
|
+
YAML::add_private_type("RdfHelper::TestCase") do |type, val|
|
219
|
+
TestCase.new( val )
|
220
|
+
end
|
221
|
+
File.open(file, 'r') do |input|
|
222
|
+
@test_cases = YAML.load(input)
|
223
|
+
end
|
224
|
+
end
|
199
225
|
end
|
200
226
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -3,9 +3,48 @@ $:.unshift File.dirname(__FILE__)
|
|
3
3
|
|
4
4
|
require 'rubygems'
|
5
5
|
require 'spec'
|
6
|
+
require 'matchers'
|
6
7
|
require 'rdf/n3'
|
8
|
+
require 'rdf/ntriples'
|
7
9
|
require 'rdf/spec'
|
10
|
+
require 'rdf/isomorphic'
|
11
|
+
|
12
|
+
include Matchers
|
13
|
+
|
14
|
+
module RDF
|
15
|
+
module Isomorphic
|
16
|
+
alias_method :==, :isomorphic_with?
|
17
|
+
end
|
18
|
+
class Graph
|
19
|
+
def to_ntriples
|
20
|
+
RDF::Writer.for(:ntriples).buffer do |writer|
|
21
|
+
self.each_statement do |statement|
|
22
|
+
writer << statement
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
8
28
|
|
9
29
|
Spec::Runner.configure do |config|
|
10
30
|
config.include(RDF::Spec::Matchers)
|
11
31
|
end
|
32
|
+
|
33
|
+
# Heuristically detect the input stream
|
34
|
+
def detect_format(stream)
|
35
|
+
# Got to look into the file to see
|
36
|
+
if stream.is_a?(IO) || stream.is_a?(StringIO)
|
37
|
+
stream.rewind
|
38
|
+
string = stream.read(1000)
|
39
|
+
stream.rewind
|
40
|
+
else
|
41
|
+
string = stream.to_s
|
42
|
+
end
|
43
|
+
case string
|
44
|
+
when /<\w+:RDF/ then :rdfxml
|
45
|
+
when /<RDF/ then :rdfxml
|
46
|
+
when /<html/i then :rdfa
|
47
|
+
when /@prefix/i then :n3
|
48
|
+
else :n3
|
49
|
+
end
|
50
|
+
end
|
data/spec/swap_spec.rb
CHANGED
@@ -1,17 +1,16 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), 'spec_helper')
|
2
|
-
include RdfContext
|
3
2
|
|
4
|
-
describe
|
3
|
+
describe RDF::N3::Reader do
|
5
4
|
# W3C N3 Test suite from http://www.w3.org/2000/10/swap/test/n3parser.tests
|
6
5
|
describe "w3c swap tests" do
|
7
6
|
require 'rdf_helper'
|
8
7
|
|
9
8
|
def self.positive_tests
|
10
|
-
RdfHelper::TestCase.positive_parser_tests(SWAP_TEST, SWAP_DIR)
|
9
|
+
RdfHelper::TestCase.positive_parser_tests(SWAP_TEST, SWAP_DIR)
|
11
10
|
end
|
12
11
|
|
13
12
|
def self.negative_tests
|
14
|
-
RdfHelper::TestCase.negative_parser_tests(SWAP_TEST, SWAP_DIR)
|
13
|
+
RdfHelper::TestCase.negative_parser_tests(SWAP_TEST, SWAP_DIR)
|
15
14
|
end
|
16
15
|
|
17
16
|
# Negative parser tests should raise errors.
|
@@ -20,11 +19,19 @@ describe "N3 parser" do
|
|
20
19
|
#next unless t.about.uri.to_s =~ /rdfms-rdf-names-use/
|
21
20
|
#next unless t.name =~ /11/
|
22
21
|
#puts t.inspect
|
23
|
-
specify "#{t.name}: #{t.about
|
22
|
+
specify "#{t.name}: #{t.about} against #{t.outputDocument}" do
|
24
23
|
begin
|
25
|
-
t.run_test do |rdf_string
|
24
|
+
t.run_test do |rdf_string|
|
26
25
|
t.name.should_not == "n3_10012" # Too many bnodes makes graph compare unfeasable
|
27
|
-
|
26
|
+
t.debug = []
|
27
|
+
g = RDF::Graph.new
|
28
|
+
RDF::N3::Reader.new(rdf_string,
|
29
|
+
:base_uri => t.about,
|
30
|
+
:strict => true,
|
31
|
+
:debug => t.debug).each do |statement|
|
32
|
+
g << statement
|
33
|
+
end
|
34
|
+
g
|
28
35
|
end
|
29
36
|
rescue #Spec::Expectations::ExpectationNotMetError => e
|
30
37
|
if %w(n3_10003 n3_10004).include?(t.name)
|
@@ -48,7 +55,7 @@ describe "N3 parser" do
|
|
48
55
|
#next unless t.about.uri.to_s =~ /rdfms-empty-property-elements/
|
49
56
|
#next unless t.name =~ /1/
|
50
57
|
#puts t.inspect
|
51
|
-
specify "#{t.name}: #{t.about
|
58
|
+
specify "#{t.name}: #{t.about}" do
|
52
59
|
t.run_test do |rdf_string, parser|
|
53
60
|
if !defined?(::Encoding) && %w(n3_10019 n3_10020).include?(t.name)
|
54
61
|
pending("Not supported in Ruby 1.8")
|
@@ -56,8 +63,15 @@ describe "N3 parser" do
|
|
56
63
|
end
|
57
64
|
begin
|
58
65
|
lambda do
|
59
|
-
|
60
|
-
|
66
|
+
t.debug = []
|
67
|
+
g = RDF::Graph.new
|
68
|
+
RDF::N3::Reader.new(rdf_string,
|
69
|
+
:base_uri => t.about,
|
70
|
+
:strict => true,
|
71
|
+
:debug => t.debug).each do |statement|
|
72
|
+
g << statement
|
73
|
+
end
|
74
|
+
end.should raise_error(RDF::ReaderError)
|
61
75
|
rescue Spec::Expectations::ExpectationNotMetError => e
|
62
76
|
if %w().include?(t.name)
|
63
77
|
pending("@forAll/@forEach not yet implemented")
|
@@ -0,0 +1,193 @@
|
|
1
|
+
---
|
2
|
+
- !ruby/object:RdfHelper::TestCase
|
3
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/no-last-nl.n3
|
4
|
+
description: An N3 file with no final newline character
|
5
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/no-last-nl.n3
|
6
|
+
name: n3_10001
|
7
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10001.nt
|
8
|
+
rdf_type: PositiveParserTest
|
9
|
+
- !ruby/object:RdfHelper::TestCase
|
10
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/dot-dash.n3
|
11
|
+
description: combinations of - and _ in identifiers
|
12
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/dot-dash.n3
|
13
|
+
name: n3_10002
|
14
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10002.nt
|
15
|
+
rdf_type: PositiveParserTest
|
16
|
+
- !ruby/object:RdfHelper::TestCase
|
17
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/keywords1.n3
|
18
|
+
description: "@keywords in n3"
|
19
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/keywords1.n3
|
20
|
+
name: n3_10003
|
21
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10003.nt
|
22
|
+
rdf_type: PositiveParserTest
|
23
|
+
- !ruby/object:RdfHelper::TestCase
|
24
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/keywords2.n3
|
25
|
+
description: using no keywords in n3
|
26
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/keywords2.n3
|
27
|
+
name: n3_10004
|
28
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10004.nt
|
29
|
+
rdf_type: PositiveParserTest
|
30
|
+
- !ruby/object:RdfHelper::TestCase
|
31
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/djb1a.n3
|
32
|
+
description: djb noticed a:b was parsed as rdf:type token
|
33
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/djb1a.n3
|
34
|
+
name: n3_10005
|
35
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10005.nt
|
36
|
+
rdf_type: PositiveParserTest
|
37
|
+
- !ruby/object:RdfHelper::TestCase
|
38
|
+
about: http://www.w3.org/2000/10/swap/test/contexts.n3
|
39
|
+
description: Parse and generate simple contexts
|
40
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/contexts.n3
|
41
|
+
name: n3_10007
|
42
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10007.nt
|
43
|
+
rdf_type: PositiveParserTest
|
44
|
+
- !ruby/object:RdfHelper::TestCase
|
45
|
+
about: http://www.w3.org/2000/10/swap/test/anon-prop.n3
|
46
|
+
description: Parse and regen anonymous property
|
47
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/anon-prop.n3
|
48
|
+
name: n3_10008
|
49
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10008.nt
|
50
|
+
rdf_type: PositiveParserTest
|
51
|
+
- !ruby/object:RdfHelper::TestCase
|
52
|
+
about: http://www.w3.org/2000/10/swap/test/strquot.n3
|
53
|
+
description: N3 string quoting with escaping
|
54
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/strquot.n3
|
55
|
+
name: n3_10009
|
56
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10009.nt
|
57
|
+
rdf_type: PositiveParserTest
|
58
|
+
- !ruby/object:RdfHelper::TestCase
|
59
|
+
about: http://www.w3.org/2000/10/swap/test/i18n/hiragana.n3
|
60
|
+
description: N3 string, qname and IRI with utf-8 non-ascii characters
|
61
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/i18n/hiragana.n3
|
62
|
+
name: n3_10010
|
63
|
+
rdf_type: PositiveParserTest
|
64
|
+
- !ruby/object:RdfHelper::TestCase
|
65
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/path1.n3
|
66
|
+
description: Path syntax, simple
|
67
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/path1.n3
|
68
|
+
name: n3_10011
|
69
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10011.nt
|
70
|
+
rdf_type: PositiveParserTest
|
71
|
+
- !ruby/object:RdfHelper::TestCase
|
72
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/path2.n3
|
73
|
+
description: Path syntax, more
|
74
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/path2.n3
|
75
|
+
name: n3_10012
|
76
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10012.nt
|
77
|
+
rdf_type: PositiveParserTest
|
78
|
+
- !ruby/object:RdfHelper::TestCase
|
79
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/numbers.n3
|
80
|
+
description: Number syntax
|
81
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/numbers.n3
|
82
|
+
name: n3_10013
|
83
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10013.nt
|
84
|
+
rdf_type: PositiveParserTest
|
85
|
+
- !ruby/object:RdfHelper::TestCase
|
86
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/qvars1.n3
|
87
|
+
description: Quick variable syntax, simple
|
88
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/qvars1.n3
|
89
|
+
name: n3_10014
|
90
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10014.nt
|
91
|
+
rdf_type: PositiveParserTest
|
92
|
+
- !ruby/object:RdfHelper::TestCase
|
93
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/qvars2.n3
|
94
|
+
description: Quick variable syntax, more
|
95
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/qvars2.n3
|
96
|
+
name: n3_10015
|
97
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10015.nt
|
98
|
+
rdf_type: PositiveParserTest
|
99
|
+
- !ruby/object:RdfHelper::TestCase
|
100
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/lstring.n3
|
101
|
+
description: N3 string nested triple quoting
|
102
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/lstring.n3
|
103
|
+
name: n3_10016
|
104
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10016.nt
|
105
|
+
rdf_type: PositiveParserTest
|
106
|
+
- !ruby/object:RdfHelper::TestCase
|
107
|
+
about: http://www.w3.org/2000/10/swap/test/lists.n3
|
108
|
+
description: parsing and generation of N3 list syntax
|
109
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/lists.n3
|
110
|
+
name: n3_10017
|
111
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10017.nt
|
112
|
+
rdf_type: PositiveParserTest
|
113
|
+
- !ruby/object:RdfHelper::TestCase
|
114
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/trailing-semicolon.n3
|
115
|
+
description: Propertylists can end in trailing semicolon.
|
116
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/trailing-semicolon.n3
|
117
|
+
name: n3_10018
|
118
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10018.nt
|
119
|
+
rdf_type: PositiveParserTest
|
120
|
+
- !ruby/object:RdfHelper::TestCase
|
121
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/this-quantifiers.n3
|
122
|
+
description: Can still read the old 'this log:forSome' syntax?
|
123
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/this-quantifiers.n3
|
124
|
+
name: n3_10019
|
125
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10019.nt
|
126
|
+
rdf_type: NegativeParserTest
|
127
|
+
- !ruby/object:RdfHelper::TestCase
|
128
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/this-rules.n3
|
129
|
+
description: Can still read the old 'this log:forAll' syntax
|
130
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/this-rules.n3
|
131
|
+
name: n3_10020
|
132
|
+
outputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/n3/n3parser.tests_n3_10020.nt
|
133
|
+
rdf_type: NegativeParserTest
|
134
|
+
- !ruby/object:RdfHelper::TestCase
|
135
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/equals1.n3
|
136
|
+
description: The = keyword
|
137
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/equals1.n3
|
138
|
+
name: n3_10025
|
139
|
+
rdf_type: PositiveParserTest
|
140
|
+
- !ruby/object:RdfHelper::TestCase
|
141
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/equals2.n3
|
142
|
+
description: The = keyword
|
143
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/equals2.n3
|
144
|
+
name: n3_10026
|
145
|
+
rdf_type: PositiveParserTest
|
146
|
+
- !ruby/object:RdfHelper::TestCase
|
147
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/zero-predicates.n3
|
148
|
+
description: A statement that says nothing at all
|
149
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/zero-predicates.n3
|
150
|
+
name: n3_10027
|
151
|
+
rdf_type: PositiveParserTest
|
152
|
+
- !ruby/object:RdfHelper::TestCase
|
153
|
+
about: http://www.w3.org/2000/10/swap/test/tests-work.txt
|
154
|
+
description: something that isn't n3
|
155
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/tests-work.txt
|
156
|
+
name: n3_20000
|
157
|
+
rdf_type: NegativeParserTest
|
158
|
+
- !ruby/object:RdfHelper::TestCase
|
159
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/neg-keywords3.n3
|
160
|
+
description: "@keywords is not a valid predicate"
|
161
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/neg-keywords3.n3
|
162
|
+
name: n3_20001
|
163
|
+
rdf_type: NegativeParserTest
|
164
|
+
- !ruby/object:RdfHelper::TestCase
|
165
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/neg-single-quote.n3
|
166
|
+
description: single quoted strings are illegal
|
167
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/neg-single-quote.n3
|
168
|
+
name: n3_20002
|
169
|
+
rdf_type: NegativeParserTest
|
170
|
+
- !ruby/object:RdfHelper::TestCase
|
171
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/neg-thisadoc.n3
|
172
|
+
description: "The `this' keyword is no longer legal "
|
173
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/neg-thisadoc.n3
|
174
|
+
name: n3_20003
|
175
|
+
rdf_type: NegativeParserTest
|
176
|
+
- !ruby/object:RdfHelper::TestCase
|
177
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/neg-literal-predicate.n3
|
178
|
+
description: A predicate cannot be a literal, I hope
|
179
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/neg-literal-predicate.n3
|
180
|
+
name: n3_20004
|
181
|
+
rdf_type: NegativeParserTest
|
182
|
+
- !ruby/object:RdfHelper::TestCase
|
183
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/neg-formula-predicate.n3
|
184
|
+
description: A predicate cannot be a formula, I hope
|
185
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/neg-formula-predicate.n3
|
186
|
+
name: n3_20005
|
187
|
+
rdf_type: NegativeParserTest
|
188
|
+
- !ruby/object:RdfHelper::TestCase
|
189
|
+
about: http://www.w3.org/2000/10/swap/test/syntax/zero-objects.n3
|
190
|
+
description: A statement that says nothing at all
|
191
|
+
inputDocument: /Users/gregg/Projects/rdf-n3/spec/swap_test/syntax/zero-objects.n3
|
192
|
+
name: n3_20028
|
193
|
+
rdf_type: NegativeParserTest
|