Class: DataFoodConsortium::Connector::Context
- Inherits:
-
JSON::LD::Context
- Object
- JSON::LD::Context
- DataFoodConsortium::Connector::Context
- Defined in:
- lib/datafoodconsortium/connector/context.rb
Overview
Preload the DFC context.
Similar to: github.com/ruby-rdf/json-ld-preloaded/
Constant Summary collapse
- URL =
"https://www.datafoodconsortium.org"
Class Method Summary collapse
-
.inputContext ⇒ Object
The hash serializer expects only string values in the context.
- .json ⇒ Object
Class Method Details
.inputContext ⇒ Object
The hash serializer expects only string values in the context.
35 36 37 |
# File 'lib/datafoodconsortium/connector/context.rb', line 35 def self.inputContext @inputContext = json.select { |key, value| value.is_a? String } end |
.json ⇒ Object
39 40 41 |
# File 'lib/datafoodconsortium/connector/context.rb', line 39 def self.json @json ||= JSON.parse(File.read("#{__dir__}/context_1.16.0.json"))["@context"] end |