Skip to content

Commit 046c8e8

Browse files
committed
Removes support for legacy text/plain (as an alias for application/n-triples) and text/x-nquads (as an alias for application/n-quads)
1 parent 4e2630b commit 046c8e8

9 files changed

Lines changed: 12 additions & 20 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ Notably, {RDF::Queryable#query} and {RDF::Query#execute} are now completely symm
105105

106106
## Differences between RDF 1.1 and RDF 1.2
107107
* {RDF::Literal} has an optional `direction` property for directional language-tagged strings.
108+
* Removes support for legacy `text/plain` (as an alias for `application/n-triples`) and `text/x-nquads` (as an alias for `application/n-quads`)
108109

109110
## Tutorials
110111

lib/rdf/nquads.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ module NQuads
2222
class Format < RDF::Format
2323
content_type 'application/n-quads',
2424
extension: :nq,
25-
alias: 'text/x-nquads;q=0.2',
2625
uri: RDF::URI("http://www.w3.org/ns/formats/N-Quads")
2726
content_encoding 'utf-8'
2827

lib/rdf/ntriples.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module RDF
88
# [Turtle](http://www.w3.org/TeamSubmission/turtle/) and
99
# [Notation3](http://www.w3.org/TeamSubmission/n3/) (N3).
1010
#
11-
# The MIME content type for N-Triples files is `text/plain` and the
11+
# The MIME content type for N-Triples files is `application/n-triples` and the
1212
# recommended file extension is `.nt`.
1313
#
1414
# An example of an RDF statement in N-Triples format:

lib/rdf/ntriples/format.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ module RDF::NTriples
1818
class Format < RDF::Format
1919
content_type 'application/n-triples',
2020
extension: :nt,
21-
alias: 'text/plain;q=0.2',
2221
uri: RDF::URI("http://www.w3.org/ns/formats/N-Triples")
2322
content_encoding 'utf-8'
2423

spec/format_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ def self.to_sym; :foo_bar; end
114114
describe ".reader_types" do
115115
it "returns content-types of available readers" do
116116
expect(RDF::Format.reader_types).to include(*%w(
117-
application/n-triples text/plain
118-
application/n-quads text/x-nquads
117+
application/n-triples
118+
application/n-quads
119119
application/test application/x-test
120120
))
121121
end
@@ -124,8 +124,8 @@ def self.to_sym; :foo_bar; end
124124
describe ".accept_types" do
125125
it "returns accept-types of available readers with quality" do
126126
expect(RDF::Format.accept_types).to include(*%w(
127-
application/n-triples text/plain;q=0.2
128-
application/n-quads text/x-nquads;q=0.2
127+
application/n-triples
128+
application/n-quads
129129
application/test application/x-test;q=0.1
130130
))
131131
end
@@ -134,8 +134,8 @@ def self.to_sym; :foo_bar; end
134134
describe ".uris" do
135135
it "returns accept-types of available readers with quality" do
136136
expect(RDF::Format.accept_types).to include(*%w(
137-
application/n-triples text/plain;q=0.2
138-
application/n-quads text/x-nquads;q=0.2
137+
application/n-triples
138+
application/n-quads
139139
application/test application/x-test;q=0.1
140140
))
141141
end
@@ -155,8 +155,8 @@ def self.to_sym; :foo_bar; end
155155
describe ".writer_types" do
156156
it "returns content-types of available writers" do
157157
%w(
158-
application/n-triples text/plain
159-
application/n-quads text/x-nquads
158+
application/n-triples
159+
application/n-quads
160160
).each do |ct|
161161
expect(RDF::Format.writer_types).to include(ct)
162162
end

spec/nquads_spec.rb

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
{file_name: 'etc/doap.nq'},
2121
{file_extension: 'nq'},
2222
{content_type: 'application/n-quads'},
23-
{content_type: 'text/x-nquads'},
2423
].each do |arg|
2524
it "discovers with #{arg.inspect}" do
2625
expect(RDF::Format.for(arg)).to eq subject
@@ -105,7 +104,6 @@
105104
{file_name: 'etc/doap.nq'},
106105
{file_extension: 'nq'},
107106
{content_type: 'application/n-quads'},
108-
{content_type: 'text/x-nquads'},
109107
].each do |arg|
110108
it "discovers with #{arg.inspect}" do
111109
expect(RDF::Reader.for(arg)).to eq RDF::NQuads::Reader
@@ -242,7 +240,6 @@
242240
{file_name: 'etc/doap.nq'},
243241
{file_extension: 'nq'},
244242
{content_type: 'application/n-quads'},
245-
{content_type: 'text/x-nquads'},
246243
].each do |arg|
247244
it "discovers with #{arg.inspect}" do
248245
expect(RDF::Writer.for(arg)).to eq RDF::NQuads::Writer

spec/ntriples_spec.rb

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
{file_name: 'etc/doap.nt'},
2828
{file_extension: 'nt'},
2929
{content_type: 'application/n-triples'},
30-
{content_type: 'text/plain'},
3130
].each do |arg|
3231
it "discovers with #{arg.inspect}" do
3332
expect(RDF::Format.for(arg)).to eq subject
@@ -103,15 +102,15 @@
103102
{file_name: 'etc/doap.nt'},
104103
{file_extension: 'nt'},
105104
{content_type: 'application/n-triples'},
106-
{content_type: 'text/plain'},
107105
].each do |arg|
108106
it "discovers with #{arg.inspect}" do
109107
expect(RDF::Reader.for(arg)).to eq described_class
110108
end
111109
end
112110

113-
context "content_type text/plain with non-N-Triples content" do
111+
context "content_type text/plain" do
114112
{
113+
:ntriples => "<a> <b> <c> . ",
115114
:nquads => "<a> <b> <c> <d> . ",
116115
:nq_literal => '<a> <b> "literal" <d> .',
117116
:nq_multi_line => %(<a>\n <b>\n "literal"\n <d>\n .),
@@ -567,7 +566,6 @@
567566
{file_name: 'etc/doap.nt'},
568567
{file_extension: 'nt'},
569568
{content_type: 'application/n-triples'},
570-
{content_type: 'text/plain'},
571569
].each do |arg|
572570
it "discovers with #{arg.inspect}" do
573571
expect(RDF::Writer.for(arg)).to eq RDF::NTriples::Writer

spec/reader_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
{file_name: 'etc/doap.nt'},
2424
{file_extension: 'nt'},
2525
{content_type: 'application/n-triples'},
26-
{content_type: 'text/plain'},
2726
].each do |arg|
2827
it "discovers with #{arg.inspect}" do
2928
expect(RDF::Reader.for(arg)).to eq RDF::NTriples::Reader

spec/writer_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
{file_name: 'etc/doap.nt'},
1111
{file_extension: 'nt'},
1212
{content_type: 'application/n-triples'},
13-
{content_type: 'text/plain'},
1413
].each do |arg|
1514
it "discovers with #{arg.inspect}" do
1615
expect(RDF::Writer.for(arg)).to eq RDF::NTriples::Writer

0 commit comments

Comments
 (0)