Skip to content

Commit 003256b

Browse files
committed
Use toRdf instead of reader interface in jsonld executable, so that a context found by Link header will be applied.
1 parent 49976f6 commit 003256b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bin/jsonld

Lines changed: 3 additions & 3 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

0 commit comments

Comments
 (0)