Skip to content

Fix @context for scopeNote. #240

@FeLungs

Description

@FeLungs

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"
        },

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions