Method: JSON::LD::API.fromRDF
- Defined in:
- lib/json/ld/api.rb
.fromRDF(input, callback = nil, options = {}) {|jsonld| ... } ⇒ Array<Hash>
Take an ordered list of RDF::Statements and turn them into a JSON-LD document.
The resulting Array is returned via the provided callback.
Note that for Ruby, if the callback is not provided and a block is given, it will be yielded
404 405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/json/ld/api.rb', line 404 def self.fromRDF(input, callback = nil, = {}, &block) = {:useNativeTypes => true}.merge() result = nil API.new(nil, nil, ) do |api| result = api.from_statements(input) end callback ||= block if block_given? callback.call(result) if callback result end |