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://w3id.org/dfc/ontology/context/context_1.16.0.json"- URL_NORMALISED =
"http://w3id.org/dfc/ontology/context/context_1.16.0.json"
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.
42 43 44 |
# File 'lib/datafoodconsortium/connector/context.rb', line 42 def self.inputContext @inputContext = json.select { |key, value| value.is_a? String } end |
.json ⇒ Object
46 47 48 |
# File 'lib/datafoodconsortium/connector/context.rb', line 46 def self.json @json ||= JSON.parse(File.read("#{__dir__}/context_1.16.0.json"))["@context"] end |