New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
process additional context and add to final json results #200
Conversation
9b4b434
to
0f4ca35
Compare
3a73809
to
d40c624
Compare
@@ -189,6 +189,11 @@ def jsonld? | |||
format == 'jsonld' | |||
end | |||
|
|||
def context? | |||
context = params.fetch(:context, false) | |||
context == 'true' ? true : false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elrayle Do you care about TRUE or True here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep... I'll downcase before comparison. Good catch.
# @param subject_uri [RDF::URI] the subject within the graph for which the values are being extracted | ||
# @return [<Hash<Symbol><Array<Object>>] mapped context values and information with hash of map key = array of object values for predicates identified in predicate_map. | ||
# @example value map for a single result | ||
# {:uri=>[#<RDF::URI:0x3fcff54a829c URI:http://id.loc.gov/authorities/names/n2010043281>], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should start with a [
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also thing if I am reading the code correctly the example should really look like below. I do not see id, label, altlabel being added in construct context.
[{"group" => "group label,
"property" => "property label",
"values" => ["value 1","value 2"],
"selectable" => true,
"drillable" => false}]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is a copy paste error. I'll update the example.
d40c624
to
43c689d
Compare
|
||
def context? | ||
context = params.fetch(:context, 'false') | ||
context.casecmp('true').zero? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Switched to use casecmp based on rubocop recommendation. Applied the same change to jsonld? for consistency.
And one other small cleanup to check for blank? instead of nil? for subauth, which covers more potential non-existing values for subauth.
@Cam156 Your requested changes have been made. |
Adds:
Remaining Work after this PR: