Skip to content

Commit 4e3acf9

Browse files
committed
Update framing due to explicit @value members.
1 parent 11b7d38 commit 4e3acf9

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ GIT
88
PATH
99
remote: .
1010
specs:
11-
json-ld (0.1.2)
11+
json-ld (0.1.3)
1212
backports
1313
json (>= 1.6.5)
1414
rdf (>= 0.3.5)

lib/json/ld/api.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def self.compact(input, context, callback = nil, options = {})
129129

130130
# 1) Perform the Expansion Algorithm on the JSON-LD input.
131131
# This removes any existing context to allow the given context to be cleanly applied.
132-
expanded = API.expand(input, nil, nil, options)
132+
expanded = API.expand(input, nil, nil, options.merge(:debug => nil))
133133

134134
API.new(expanded, context, options) do
135135
debug(".compact") {"expanded input: #{expanded.to_json(JSON_STATE)}"}
@@ -215,9 +215,9 @@ def self.frame(input, frame, callback = nil, options = {})
215215

216216
# Initialize input using frame as context
217217
API.new(expanded_input, nil, options) do
218-
debug(".frame") {"context from frame: #{context.inspect}"}
219-
debug(".frame") {"expanded frame: #{expanded_frame.to_json(JSON_STATE)}"}
220-
debug(".frame") {"expanded input: #{value.to_json(JSON_STATE)}"}
218+
#debug(".frame") {"context from frame: #{context.inspect}"}
219+
#debug(".frame") {"expanded frame: #{expanded_frame.to_json(JSON_STATE)}"}
220+
#debug(".frame") {"expanded input: #{value.to_json(JSON_STATE)}"}
221221

222222
# Get framing subjects from expanded input, replacing Blank Node identifiers as necessary
223223
@subjects = Hash.ordered

lib/json/ld/frame.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,8 @@ def validate_frame(state, frame)
343343

344344
# Return value of @name in frame, or default from state if it doesn't exist
345345
def get_frame_flag(state, frame, name)
346-
!!(frame.fetch("@#{name}", [state[name.to_sym]]).first)
346+
value = frame.fetch("@#{name}", [state[name.to_sym]]).first
347+
!!(value?(value) ? value['@value'] : value)
347348
end
348349

349350
##

0 commit comments

Comments
 (0)