Skip to content

Commit 509aedd

Browse files
committed
Release 1.1.6.1.
* In jsonld executable, let API open input files, allowing documentLoader to be used. * Use toRdf instead of reader interface in jsonld executable, so that a context found by Link header will be applied.
2 parents 2d314c7 + 003256b commit 509aedd

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.1.6
1+
1.1.6.1

bin/jsonld

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ def run(input, options)
4747
options[:output].puts output.to_json(JSON::LD::JSON_STATE)
4848
STDERR.puts "Framed in #{secs} seconds." unless options[:quiet]
4949
else
50-
r = reader_class.new(input, options[:parser_options])
51-
g = RDF::Repository.new << r
50+
options = options.merge(:expandContext => options.delete(:context)) if options.has_key?(:context)
51+
g = JSON::LD::API.toRdf(input, options)
5252
secs = Time.new - start
5353
num = g.count
54-
parser_options = options[:parser_options].merge(:prefixes => r.prefixes, :standard_prefixes => true)
54+
parser_options = options[:parser_options].merge(:standard_prefixes => true)
5555
options[:output].puts g.dump(options[:output_format], parser_options)
5656
STDERR.puts "\nParsed #{num} statements in #{secs} seconds @ #{num/secs} statements/second." unless options[:quiet]
5757
end
@@ -136,7 +136,7 @@ if ARGV.empty?
136136
run(StringIO.new(s), options)
137137
else
138138
ARGV.each do |file|
139-
run(Kernel.open(file), options)
139+
run(file, options)
140140
end
141141
end
142142
puts

spec/context_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,15 +1021,15 @@ def containers
10211021
"native boolean" => ["foo", true, {"@value" => true}],
10221022
"native integer" => ["foo", 1, {"@value" => 1}],
10231023
"native double" => ["foo", 1.1e1, {"@value" => 1.1E1}],
1024-
"native date" => ["foo", Date.parse("2011-12-27Z"), {"@value" => "2011-12-27Z", "@type" => RDF::XSD.date.to_s}],
1024+
"native date" => ["foo", Date.parse("2011-12-27"), {"@value" => "2011-12-27", "@type" => RDF::XSD.date.to_s}],
10251025
"native time" => ["foo", Time.parse("10:11:12Z"), {"@value" => "10:11:12Z", "@type" => RDF::XSD.time.to_s}],
10261026
"native dateTime" =>["foo", DateTime.parse("2011-12-27T10:11:12Z"), {"@value" => "2011-12-27T10:11:12Z", "@type" => RDF::XSD.dateTime.to_s}],
10271027
"rdf boolean" => ["foo", RDF::Literal(true), {"@value" => "true", "@type" => RDF::XSD.boolean.to_s}],
10281028
"rdf integer" => ["foo", RDF::Literal(1), {"@value" => "1", "@type" => RDF::XSD.integer.to_s}],
10291029
"rdf decimal" => ["foo", RDF::Literal::Decimal.new(1.1), {"@value" => "1.1", "@type" => RDF::XSD.decimal.to_s}],
10301030
"rdf double" => ["foo", RDF::Literal::Double.new(1.1), {"@value" => "1.1E0", "@type" => RDF::XSD.double.to_s}],
10311031
"rdf URI" => ["foo", RDF::URI("foo"), {"@id" => "foo"}],
1032-
"rdf date " => ["foo", RDF::Literal(Date.parse("2011-12-27Z")), {"@value" => "2011-12-27Z", "@type" => RDF::XSD.date.to_s}],
1032+
"rdf date " => ["foo", RDF::Literal(Date.parse("2011-12-27")), {"@value" => "2011-12-27", "@type" => RDF::XSD.date.to_s}],
10331033
"rdf nonNeg" => ["foo", RDF::Literal::NonNegativeInteger.new(1), {"@value" => "1", "@type" => RDF::XSD.nonNegativeInteger}],
10341034
"rdf float" => ["foo", RDF::Literal::Float.new(1.0), {"@value" => "1.0", "@type" => RDF::XSD.float}],
10351035
}.each do |title, (key, compacted, expanded)|

0 commit comments

Comments
 (0)