lib/active_triples/elasticsearch/serializable.rb
##
# Return a framed, compacted JSON-LD representation
# by embedding related objects from the graph
#
# NB: Will NOT embed related objects with same @type.
# Spec under discussion, see https://github.com/json-ld/json-ld.org/issues/110
#
# @return [Hash] a serialized, framed JSON-LD version of the resource
Return a framed, compacted JSON-LD representation
by embedding related objects from the graph

Will NOT embed related objects with same @type.
Return a framed compacted JSON - LD representation by embedding related objects from the graph Will NOT embed related objects with same @type .
def as_framed_jsonld
        json_hash = self.as_jsonld
        context = json_hash['@context']
        frame = { '@context' => context }
        frame['@type'] = type.first.pname unless type.empty?
        JSON::LD::API.compact(JSON::LD::API.frame(json_hash, frame), context)
      end
def as_framed_jsonld json_hash = self . as_jsonld context = json_hash [ '@context' ] frame = { '@context' => context } frame [ '@type' ] = type . first . pname unless type . empty? JSON :: LD :: API . compact ( JSON :: LD :: API . frame ( json_hash , frame ) , context ) end
Return a framed, compacted JSON-LD representation
by embedding related objects from the graph
Return a framed compacted JSON - LD representation by embedding related objects from the graph
a serialized, framed JSON-LD version of the resource
a serialized framed JSON - LD version of the resource
Hash