Skip to content
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

Fix @context for scopeNote. #240

Open
4 tasks
FeLungs opened this issue Nov 22, 2017 · 4 comments
Open
4 tasks

Fix @context for scopeNote. #240

FeLungs opened this issue Nov 22, 2017 · 4 comments
Assignees

Comments

@FeLungs
Copy link
Contributor

FeLungs commented Nov 22, 2017

I was playing around with the expanded and compacted forms of a profile I am developing (via https://json-ld.org/playground/) and noticed something strange about scopeNote

...
"rules":[{"location":"$.result.duration","presence":"recommended","scopeNote":{"en": "the Length of..."}]}

compacts to:
{
          "http://www.w3.org/2004/02/skos/core#scopeNote": {},
          "https://w3id.org/xapi/profiles/ontology#location": "$.result.duration",
          "https://w3id.org/xapi/profiles/ontology#presence": "recommended"
        }

and expands to:

{
            "https://w3id.org/xapi/profiles/ontology#location": [
              {
                "@value": "$.result.duration"
              }
            ],
            "https://w3id.org/xapi/profiles/ontology#presence": [
              {
                "@value": "recommended"
              }
            ],
            "http://www.w3.org/2004/02/skos/core#scopeNote": [
              {}
            ]
          }

Where as for prefLabel

...
"prefLabel":{"en":"some label"}
...

compacts to:
"http://www.w3.org/2004/02/skos/core#prefLabel": {
        "@language": "en",
        "@value": "some label"
      }

and expands to:

"http://www.w3.org/2004/02/skos/core#prefLabel": [
          {
            "@value": "some label",
            "@language": "en"
          }
        ],

I tried setting the value of scopeNote to a string and got:

"rules":[{"location":"$.result.duration","presence":"recommended","scopeNote": "the length of..."]}
{
            "https://w3id.org/xapi/profiles/ontology#location": [
              {
                "@value": "$.result.duration"
              }
            ],
            "https://w3id.org/xapi/profiles/ontology#presence": [
              {
                "@value": "recommended"
              }
            ],
            "http://www.w3.org/2004/02/skos/core#scopeNote": [
              {
                "@value": "the length of..."
              }
            ]
          }

When looking into this difference, I noticed that within the @context for the profile specification
(https://adlnet.github.io/xapi-profiles/context/profile-context.jsonld) there are different alias definitions for prefLabel and scopeNote:

"prefLabel": {
            "@id": "skos:prefLabel",
            "@container": "@language"
        },

"scopeNote": {
            "@id": "skos:scopeNote"
        },

Yet in the spec, both prefLabel and scopeNote are defined as objects


prefLabel | Object | A Language Map of the preferred names in each language | Required


scopeNote | Object | A Language Map describing usage details for the parts of Statements addressed by this rule. For example, a Profile with a rule requiring result.duration might provide guidance on how to calculate it. | Optional

I believe the @context for scopeNote needs to be updated to

"scopeNote": {
            "@id": "skos:scopeNote"
            "@container": "@language"
        },

TL;DR

  • Which part/parts of the specification are at issue?

  • @context

  • What is your understanding of what the spec means in these parts?

  • It is used for aliasing within JSON-LD

  • Related to your implementation, what's the use case you're trying to achieve? What are the user stories you're trying to support?

  • I would like JSON-LD processors to pick up scopeNote and not have that information lost while following this spec

  • How you would like the specification to be improved?

  • update scopeNote within @context to

"scopeNote": {
            "@id": "skos:scopeNote"
            "@container": "@language"
        },
@jhaag75
Copy link
Contributor

jhaag75 commented Dec 7, 2017

@fugu13 this looks like a valid to me. Thoughts? I can submit a PR and update if you agree.

@phtyson
Copy link

phtyson commented Oct 21, 2021

Yes, this should be updated, it is a bug that prevents automated translation to other serializations.

@jhaag75
Copy link
Contributor

jhaag75 commented Oct 21, 2021

Yes, this should be updated, it is a bug that prevents automated translation to other serializations.

Please submit an update and PR if you want this fixed. ADL will review and controls this repo.

@phtyson
Copy link

phtyson commented Oct 21, 2021

Pull request #253

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants