Method: JSON::LD::Utils#graph?
- Defined in:
- lib/json/ld/utils.rb
#graph?(value) ⇒ Boolean
Is value an expaned @graph?
Note: A value is a graph if all of these hold true:
-
It is an object.
-
It has an ‘@graph` key.
-
It may have ‘@context’, ‘@id’ or ‘@index’
60 61 62 |
# File 'lib/json/ld/utils.rb', line 60 def graph?(value) value.is_a?(Hash) && (value.keys - UTIL_GRAPH_KEYS) == ['@graph'] end |