-
Notifications
You must be signed in to change notification settings - Fork 18
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
parsing the prefix correctly #47
Comments
|
Actually, we should just define the mapping separately. @sanuann can you add another field in schema-standardization that preserves the mapping between items that are used to evaluate |
I just realized you can string multiple prefixes together, so jsonld.compact might not help EDIT: compact-ing doesn't help |
compact doesn't seem to hel |
Didn't get you. Why doesn't compacting help? |
this is an issue, but since scoring and branching are javascript code. that's not a clean implementation, and something has to translate the javascript variables to "values/keys" outside that scope. i expect that to help with the mapping. this can be done prior to expansion, but i would not put in the schema. the other way is to get the mapping from the id of the jsonld file: the most important thing that we need to get out of this is that response keys are URIs to items and response values are a literal or a controlled dictionary. |
Losing context shouldn't be an insurmountable issue; well-formed IRIs should resolve to include or link to all of the necessary context, right? |
Let me restate the problem, this might help with my confusion:
Our hack for getting this to work quickly was that I noticed we named our files with the same name as the prefix. But, as we move to a schema-server for all this, we can't make this filename assumption. Here are the workarounds I can think of:
Any other ideas? |
I don't follow 2‒4 in the problem restatement.
The whole point of JSON-LD prefixing is that expanding the prefix + the suffix results in a dereferencable IRI. In Mindlogger, the entity ID can be encoded; on GitHub, the raw URL. If the prefix:suffix doesn't expand into a dereferencable string, the syntax is incorrect. We don't need to know or care about filenames so long as we have an API that can route us based on these strings.
|
On the jsonld playground: https://json-ld.org/playground/ if you copy/paste the PHQ-9 activity: https://raw.githubusercontent.com/ReproNim/schema-standardization/master/activities/PHQ-9/phq9_schema.jsonld and look at the expanded result, there is no way for me to know that This is a problem because I refer to it in the "visibility" section, to calculate whether or not to show an item. I'm not familiar with jsonld enough to know how to keep the mapping in the expanded result.
The problem is that prefix:suffix DOES expand into a dereferencable string, but it isn't happening in the branching logic or scoring equation sections. And we lose the reference in other places (which is correct behavior) |
@akeshavan - you cannot. the expanded form is a graph, which is why there is a mismatch between using keys (for json simplicity) in scoring/branching, when the underlying data model has no concept of it. we are also taking account of a default vocabulary that let's us use those string keys without a prefix. there may be a middle ground, but i do want to think about this more carefully. let's not hack a hack at this point and solve it with a proper solution. |
@satra any ideas? :) |
@satra aren't we using the |
yes. closing. |
We are making a dangerous assumption here: https://github.com/ReproNim/schema-ui/blob/master/src/components/Survey/Survey.vue#L217
That the context prefix we are using maps directly to the name of the jsonld file. We need this because the prefix is how we are defining the scoring and branching logic. @satra when we do
jsonld.expand
on an activity, we lose the prefixes that we defined in@context
-- do you know of a way to recover them?The text was updated successfully, but these errors were encountered: