Skip to content

Commit 7087a2b

Browse files
authored
Turtle tests (#187)
* More N-Triples syntax tests as Turtle syntax tests. Make naming more consistent. * Turtle Triple Term Evalutation tests. Fixes #182. * Test renaming. * Variations on reifiers for reifying triples. * Variations on reifiers and annotation blocks. Fixes #183. * Add negative syntax tests for turtle numeric escapes encoding surrogates. * Rename turtle eval tests using "quoted triples" as "reified triples". --------- Co-authored-by: gkellogg <[email protected]>
1 parent d8c2e0d commit 7087a2b

File tree

83 files changed

+1041
-290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

83 files changed

+1041
-290
lines changed

Gemfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@ gem 'rake'
55
gem 'json-ld'
66
gem 'rdf-turtle'
77
gem 'haml', '~> 6.3'
8-
gem 'kramdown', '~> 2.5'
98
gem 'htmlbeautifier', '~> 1.4'
9+
gem 'kramdown', '~> 2.5'
1010
gem 'logger', '~> 1.7'
1111
gem 'ostruct', '~> 0.6'
1212
gem 'nokogiri', '~> 1.18'
13+
gem 'pathname', '~> 0.4'

Gemfile.lock

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ GEM
3737
nokogiri (1.18.8-x86_64-linux-gnu)
3838
racc (~> 1.4)
3939
ostruct (0.6.1)
40+
pathname (0.4.0)
4041
racc (1.8.1)
4142
rack (3.1.14)
4243
rake (13.2.1)
@@ -72,6 +73,7 @@ DEPENDENCIES
7273
logger (~> 1.7)
7374
nokogiri (~> 1.18)
7475
ostruct (~> 0.6)
76+
pathname (~> 0.4)
7577
rake
7678
rdf-turtle
7779

Rakefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ require 'haml'
55
require 'htmlbeautifier'
66
require 'nokogiri'
77
require 'rake/clean'
8+
require 'pathname'
89

910
task default: :index
1011

rdf/rdf11/rdf-turtle/index.html

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5167,6 +5167,216 @@ <h2>
51675167
</dd>
51685168
</dl>
51695169
</dd>
5170+
<dt id='turtle-syntax-bad-numeric-escape-01'>
5171+
<a class='testlink' href='#turtle-syntax-bad-numeric-escape-01'>
5172+
turtle-syntax-bad-numeric-escape-01:
5173+
</a>
5174+
<span about='#turtle-syntax-bad-numeric-escape-01' property='mf:name'>turtle-syntax-bad-numeric-escape-01</span>
5175+
</dt>
5176+
<dd inlist='true' property='mf:entry' resource='#turtle-syntax-bad-numeric-escape-01' typeof='rdft:TestTurtleNegativeSyntax'>
5177+
<div property='rdfs:comment'>
5178+
<p>Surrogates not allowed in STRING_LITERAL_QUOTE</p>
5179+
</div>
5180+
<dl class='test-detail'>
5181+
<dt>type</dt>
5182+
<dd>rdft:TestTurtleNegativeSyntax</dd>
5183+
<dt>approval</dt>
5184+
<dd property='mf:approval' resource='rdft:Approved'>rdft:Approved</dd>
5185+
<dt>action</dt>
5186+
<dd>
5187+
<a href='turtle-syntax-bad-numeric-escape-01.ttl' property='mf:action'>turtle-syntax-bad-numeric-escape-01.ttl</a>
5188+
</dd>
5189+
</dl>
5190+
</dd>
5191+
<dt id='turtle-syntax-bad-numeric-escape-02'>
5192+
<a class='testlink' href='#turtle-syntax-bad-numeric-escape-02'>
5193+
turtle-syntax-bad-numeric-escape-02:
5194+
</a>
5195+
<span about='#turtle-syntax-bad-numeric-escape-02' property='mf:name'>turtle-syntax-bad-numeric-escape-02</span>
5196+
</dt>
5197+
<dd inlist='true' property='mf:entry' resource='#turtle-syntax-bad-numeric-escape-02' typeof='rdft:TestTurtleNegativeSyntax'>
5198+
<div property='rdfs:comment'>
5199+
<p>Surrogates not allowed in STRING_LITERAL_QUOTE</p>
5200+
</div>
5201+
<dl class='test-detail'>
5202+
<dt>type</dt>
5203+
<dd>rdft:TestTurtleNegativeSyntax</dd>
5204+
<dt>approval</dt>
5205+
<dd property='mf:approval' resource='rdft:Approved'>rdft:Approved</dd>
5206+
<dt>action</dt>
5207+
<dd>
5208+
<a href='turtle-syntax-bad-numeric-escape-02.ttl' property='mf:action'>turtle-syntax-bad-numeric-escape-02.ttl</a>
5209+
</dd>
5210+
</dl>
5211+
</dd>
5212+
<dt id='turtle-syntax-bad-numeric-escape-03'>
5213+
<a class='testlink' href='#turtle-syntax-bad-numeric-escape-03'>
5214+
turtle-syntax-bad-numeric-escape-03:
5215+
</a>
5216+
<span about='#turtle-syntax-bad-numeric-escape-03' property='mf:name'>turtle-syntax-bad-numeric-escape-03</span>
5217+
</dt>
5218+
<dd inlist='true' property='mf:entry' resource='#turtle-syntax-bad-numeric-escape-03' typeof='rdft:TestTurtleNegativeSyntax'>
5219+
<div property='rdfs:comment'>
5220+
<p>Surrogates not allowed in STRING_LITERAL_SINGLE_QUOTE</p>
5221+
</div>
5222+
<dl class='test-detail'>
5223+
<dt>type</dt>
5224+
<dd>rdft:TestTurtleNegativeSyntax</dd>
5225+
<dt>approval</dt>
5226+
<dd property='mf:approval' resource='rdft:Approved'>rdft:Approved</dd>
5227+
<dt>action</dt>
5228+
<dd>
5229+
<a href='turtle-syntax-bad-numeric-escape-03.ttl' property='mf:action'>turtle-syntax-bad-numeric-escape-03.ttl</a>
5230+
</dd>
5231+
</dl>
5232+
</dd>
5233+
<dt id='turtle-syntax-bad-numeric-escape-04'>
5234+
<a class='testlink' href='#turtle-syntax-bad-numeric-escape-04'>
5235+
turtle-syntax-bad-numeric-escape-04:
5236+
</a>
5237+
<span about='#turtle-syntax-bad-numeric-escape-04' property='mf:name'>turtle-syntax-bad-numeric-escape-04</span>
5238+
</dt>
5239+
<dd inlist='true' property='mf:entry' resource='#turtle-syntax-bad-numeric-escape-04' typeof='rdft:TestTurtleNegativeSyntax'>
5240+
<div property='rdfs:comment'>
5241+
<p>Surrogates not allowed in STRING_LITERAL_SINGLE_QUOTE</p>
5242+
</div>
5243+
<dl class='test-detail'>
5244+
<dt>type</dt>
5245+
<dd>rdft:TestTurtleNegativeSyntax</dd>
5246+
<dt>approval</dt>
5247+
<dd property='mf:approval' resource='rdft:Approved'>rdft:Approved</dd>
5248+
<dt>action</dt>
5249+
<dd>
5250+
<a href='turtle-syntax-bad-numeric-escape-04.ttl' property='mf:action'>turtle-syntax-bad-numeric-escape-04.ttl</a>
5251+
</dd>
5252+
</dl>
5253+
</dd>
5254+
<dt id='turtle-syntax-bad-numeric-escape-05'>
5255+
<a class='testlink' href='#turtle-syntax-bad-numeric-escape-05'>
5256+
turtle-syntax-bad-numeric-escape-05:
5257+
</a>
5258+
<span about='#turtle-syntax-bad-numeric-escape-05' property='mf:name'>turtle-syntax-bad-numeric-escape-05</span>
5259+
</dt>
5260+
<dd inlist='true' property='mf:entry' resource='#turtle-syntax-bad-numeric-escape-05' typeof='rdft:TestTurtleNegativeSyntax'>
5261+
<div property='rdfs:comment'>
5262+
<p>Surrogates not allowed in STRING_LITERAL_LONG_SINGLE_QUOTE</p>
5263+
</div>
5264+
<dl class='test-detail'>
5265+
<dt>type</dt>
5266+
<dd>rdft:TestTurtleNegativeSyntax</dd>
5267+
<dt>approval</dt>
5268+
<dd property='mf:approval' resource='rdft:Approved'>rdft:Approved</dd>
5269+
<dt>action</dt>
5270+
<dd>
5271+
<a href='turtle-syntax-bad-numeric-escape-05.ttl' property='mf:action'>turtle-syntax-bad-numeric-escape-05.ttl</a>
5272+
</dd>
5273+
</dl>
5274+
</dd>
5275+
<dt id='turtle-syntax-bad-numeric-escape-06'>
5276+
<a class='testlink' href='#turtle-syntax-bad-numeric-escape-06'>
5277+
turtle-syntax-bad-numeric-escape-06:
5278+
</a>
5279+
<span about='#turtle-syntax-bad-numeric-escape-06' property='mf:name'>turtle-syntax-bad-numeric-escape-06</span>
5280+
</dt>
5281+
<dd inlist='true' property='mf:entry' resource='#turtle-syntax-bad-numeric-escape-06' typeof='rdft:TestTurtleNegativeSyntax'>
5282+
<div property='rdfs:comment'>
5283+
<p>Surrogates not allowed in STRING_LITERAL_LONG_SINGLE_QUOTE</p>
5284+
</div>
5285+
<dl class='test-detail'>
5286+
<dt>type</dt>
5287+
<dd>rdft:TestTurtleNegativeSyntax</dd>
5288+
<dt>approval</dt>
5289+
<dd property='mf:approval' resource='rdft:Approved'>rdft:Approved</dd>
5290+
<dt>action</dt>
5291+
<dd>
5292+
<a href='turtle-syntax-bad-numeric-escape-06.ttl' property='mf:action'>turtle-syntax-bad-numeric-escape-06.ttl</a>
5293+
</dd>
5294+
</dl>
5295+
</dd>
5296+
<dt id='turtle-syntax-bad-numeric-escape-07'>
5297+
<a class='testlink' href='#turtle-syntax-bad-numeric-escape-07'>
5298+
turtle-syntax-bad-numeric-escape-07:
5299+
</a>
5300+
<span about='#turtle-syntax-bad-numeric-escape-07' property='mf:name'>turtle-syntax-bad-numeric-escape-07</span>
5301+
</dt>
5302+
<dd inlist='true' property='mf:entry' resource='#turtle-syntax-bad-numeric-escape-07' typeof='rdft:TestTurtleNegativeSyntax'>
5303+
<div property='rdfs:comment'>
5304+
<p>Surrogates not allowed in STRING_LITERAL_LONG_QUOTE</p>
5305+
</div>
5306+
<dl class='test-detail'>
5307+
<dt>type</dt>
5308+
<dd>rdft:TestTurtleNegativeSyntax</dd>
5309+
<dt>approval</dt>
5310+
<dd property='mf:approval' resource='rdft:Approved'>rdft:Approved</dd>
5311+
<dt>action</dt>
5312+
<dd>
5313+
<a href='turtle-syntax-bad-numeric-escape-07.ttl' property='mf:action'>turtle-syntax-bad-numeric-escape-07.ttl</a>
5314+
</dd>
5315+
</dl>
5316+
</dd>
5317+
<dt id='turtle-syntax-bad-numeric-escape-08'>
5318+
<a class='testlink' href='#turtle-syntax-bad-numeric-escape-08'>
5319+
turtle-syntax-bad-numeric-escape-08:
5320+
</a>
5321+
<span about='#turtle-syntax-bad-numeric-escape-08' property='mf:name'>turtle-syntax-bad-numeric-escape-08</span>
5322+
</dt>
5323+
<dd inlist='true' property='mf:entry' resource='#turtle-syntax-bad-numeric-escape-08' typeof='rdft:TestTurtleNegativeSyntax'>
5324+
<div property='rdfs:comment'>
5325+
<p>Surrogates not allowed in STRING_LITERAL_LONG_QUOTE</p>
5326+
</div>
5327+
<dl class='test-detail'>
5328+
<dt>type</dt>
5329+
<dd>rdft:TestTurtleNegativeSyntax</dd>
5330+
<dt>approval</dt>
5331+
<dd property='mf:approval' resource='rdft:Approved'>rdft:Approved</dd>
5332+
<dt>action</dt>
5333+
<dd>
5334+
<a href='turtle-syntax-bad-numeric-escape-08.ttl' property='mf:action'>turtle-syntax-bad-numeric-escape-08.ttl</a>
5335+
</dd>
5336+
</dl>
5337+
</dd>
5338+
<dt id='turtle-syntax-bad-numeric-escape-09'>
5339+
<a class='testlink' href='#turtle-syntax-bad-numeric-escape-09'>
5340+
turtle-syntax-bad-numeric-escape-09:
5341+
</a>
5342+
<span about='#turtle-syntax-bad-numeric-escape-09' property='mf:name'>turtle-syntax-bad-numeric-escape-09</span>
5343+
</dt>
5344+
<dd inlist='true' property='mf:entry' resource='#turtle-syntax-bad-numeric-escape-09' typeof='rdft:TestTurtleNegativeSyntax'>
5345+
<div property='rdfs:comment'>
5346+
<p>Surrogates not allowed in IRIREF</p>
5347+
</div>
5348+
<dl class='test-detail'>
5349+
<dt>type</dt>
5350+
<dd>rdft:TestTurtleNegativeSyntax</dd>
5351+
<dt>approval</dt>
5352+
<dd property='mf:approval' resource='rdft:Approved'>rdft:Approved</dd>
5353+
<dt>action</dt>
5354+
<dd>
5355+
<a href='turtle-syntax-bad-numeric-escape-09.ttl' property='mf:action'>turtle-syntax-bad-numeric-escape-09.ttl</a>
5356+
</dd>
5357+
</dl>
5358+
</dd>
5359+
<dt id='turtle-syntax-bad-numeric-escape-10'>
5360+
<a class='testlink' href='#turtle-syntax-bad-numeric-escape-10'>
5361+
turtle-syntax-bad-numeric-escape-10:
5362+
</a>
5363+
<span about='#turtle-syntax-bad-numeric-escape-10' property='mf:name'>turtle-syntax-bad-numeric-escape-10</span>
5364+
</dt>
5365+
<dd inlist='true' property='mf:entry' resource='#turtle-syntax-bad-numeric-escape-10' typeof='rdft:TestTurtleNegativeSyntax'>
5366+
<div property='rdfs:comment'>
5367+
<p>Surrogates not allowed in IRIREF</p>
5368+
</div>
5369+
<dl class='test-detail'>
5370+
<dt>type</dt>
5371+
<dd>rdft:TestTurtleNegativeSyntax</dd>
5372+
<dt>approval</dt>
5373+
<dd property='mf:approval' resource='rdft:Approved'>rdft:Approved</dd>
5374+
<dt>action</dt>
5375+
<dd>
5376+
<a href='turtle-syntax-bad-numeric-escape-10.ttl' property='mf:action'>turtle-syntax-bad-numeric-escape-10.ttl</a>
5377+
</dd>
5378+
</dl>
5379+
</dd>
51705380
<dt id='turtle-syntax-bad-struct-08'>
51715381
<a class='testlink' href='#turtle-syntax-bad-struct-08'>
51725382
turtle-syntax-bad-struct-08:

rdf/rdf11/rdf-turtle/manifest.ttl

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,16 @@
251251
<#turtle-syntax-bad-n3-extras-11>
252252
<#turtle-syntax-bad-n3-extras-12>
253253
<#turtle-syntax-bad-n3-extras-13>
254+
<#turtle-syntax-bad-numeric-escape-01>
255+
<#turtle-syntax-bad-numeric-escape-02>
256+
<#turtle-syntax-bad-numeric-escape-03>
257+
<#turtle-syntax-bad-numeric-escape-04>
258+
<#turtle-syntax-bad-numeric-escape-05>
259+
<#turtle-syntax-bad-numeric-escape-06>
260+
<#turtle-syntax-bad-numeric-escape-07>
261+
<#turtle-syntax-bad-numeric-escape-08>
262+
<#turtle-syntax-bad-numeric-escape-09>
263+
<#turtle-syntax-bad-numeric-escape-10>
254264
<#turtle-syntax-bad-struct-08>
255265
<#turtle-syntax-bad-struct-09>
256266
<#turtle-syntax-bad-struct-10>
@@ -1934,6 +1944,76 @@
19341944
mf:action <turtle-syntax-bad-n3-extras-13.ttl> ;
19351945
.
19361946

1947+
<#turtle-syntax-bad-numeric-escape-01> rdf:type rdft:TestTurtleNegativeSyntax ;
1948+
mf:name "turtle-syntax-bad-numeric-escape-01" ;
1949+
rdfs:comment "Surrogates not allowed in STRING_LITERAL_QUOTE" ;
1950+
rdft:approval rdft:Approved ;
1951+
mf:action <turtle-syntax-bad-numeric-escape-01.ttl> ;
1952+
.
1953+
1954+
<#turtle-syntax-bad-numeric-escape-02> rdf:type rdft:TestTurtleNegativeSyntax ;
1955+
mf:name "turtle-syntax-bad-numeric-escape-02" ;
1956+
rdfs:comment "Surrogates not allowed in STRING_LITERAL_QUOTE" ;
1957+
rdft:approval rdft:Approved ;
1958+
mf:action <turtle-syntax-bad-numeric-escape-02.ttl> ;
1959+
.
1960+
1961+
<#turtle-syntax-bad-numeric-escape-03> rdf:type rdft:TestTurtleNegativeSyntax ;
1962+
mf:name "turtle-syntax-bad-numeric-escape-03" ;
1963+
rdfs:comment "Surrogates not allowed in STRING_LITERAL_SINGLE_QUOTE" ;
1964+
rdft:approval rdft:Approved ;
1965+
mf:action <turtle-syntax-bad-numeric-escape-03.ttl> ;
1966+
.
1967+
1968+
<#turtle-syntax-bad-numeric-escape-04> rdf:type rdft:TestTurtleNegativeSyntax ;
1969+
mf:name "turtle-syntax-bad-numeric-escape-04" ;
1970+
rdfs:comment "Surrogates not allowed in STRING_LITERAL_SINGLE_QUOTE" ;
1971+
rdft:approval rdft:Approved ;
1972+
mf:action <turtle-syntax-bad-numeric-escape-04.ttl> ;
1973+
.
1974+
1975+
<#turtle-syntax-bad-numeric-escape-05> rdf:type rdft:TestTurtleNegativeSyntax ;
1976+
mf:name "turtle-syntax-bad-numeric-escape-05" ;
1977+
rdfs:comment "Surrogates not allowed in STRING_LITERAL_LONG_SINGLE_QUOTE" ;
1978+
rdft:approval rdft:Approved ;
1979+
mf:action <turtle-syntax-bad-numeric-escape-05.ttl> ;
1980+
.
1981+
1982+
<#turtle-syntax-bad-numeric-escape-06> rdf:type rdft:TestTurtleNegativeSyntax ;
1983+
mf:name "turtle-syntax-bad-numeric-escape-06" ;
1984+
rdfs:comment "Surrogates not allowed in STRING_LITERAL_LONG_SINGLE_QUOTE" ;
1985+
rdft:approval rdft:Approved ;
1986+
mf:action <turtle-syntax-bad-numeric-escape-06.ttl> ;
1987+
.
1988+
1989+
<#turtle-syntax-bad-numeric-escape-07> rdf:type rdft:TestTurtleNegativeSyntax ;
1990+
mf:name "turtle-syntax-bad-numeric-escape-07" ;
1991+
rdfs:comment "Surrogates not allowed in STRING_LITERAL_LONG_QUOTE" ;
1992+
rdft:approval rdft:Approved ;
1993+
mf:action <turtle-syntax-bad-numeric-escape-07.ttl> ;
1994+
.
1995+
1996+
<#turtle-syntax-bad-numeric-escape-08> rdf:type rdft:TestTurtleNegativeSyntax ;
1997+
mf:name "turtle-syntax-bad-numeric-escape-08" ;
1998+
rdfs:comment "Surrogates not allowed in STRING_LITERAL_LONG_QUOTE" ;
1999+
rdft:approval rdft:Approved ;
2000+
mf:action <turtle-syntax-bad-numeric-escape-08.ttl> ;
2001+
.
2002+
2003+
<#turtle-syntax-bad-numeric-escape-09> rdf:type rdft:TestTurtleNegativeSyntax ;
2004+
mf:name "turtle-syntax-bad-numeric-escape-09" ;
2005+
rdfs:comment "Surrogates not allowed in IRIREF" ;
2006+
rdft:approval rdft:Approved ;
2007+
mf:action <turtle-syntax-bad-numeric-escape-09.ttl> ;
2008+
.
2009+
2010+
<#turtle-syntax-bad-numeric-escape-10> rdf:type rdft:TestTurtleNegativeSyntax ;
2011+
mf:name "turtle-syntax-bad-numeric-escape-10" ;
2012+
rdfs:comment "Surrogates not allowed in IRIREF" ;
2013+
rdft:approval rdft:Approved ;
2014+
mf:action <turtle-syntax-bad-numeric-escape-10.ttl> ;
2015+
.
2016+
19372017
<#turtle-syntax-bad-struct-08> rdf:type rdft:TestTurtleNegativeSyntax ;
19382018
mf:name "turtle-syntax-bad-struct-08" ;
19392019
rdfs:comment "missing '.' (negative test)" ;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<http://a.example/s> <http://a.example/p> "\ud800" .
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<http://a.example/s> <http://a.example/p> "\udfff" .
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<http://a.example/s> <http://a.example/p> '\ud800' .
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<http://a.example/s> <http://a.example/p> '\udfff' .
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<http://a.example/s> <http://a.example/p> """\ud800""" .

0 commit comments

Comments
 (0)