uncefact / spec-untp

UN Transparency Protocol
https://uncefact.github.io/spec-untp/
GNU General Public License v3.0
11 stars 10 forks source link

Generated context file issues #121

Open Fak3 opened 1 week ago

Fak3 commented 1 week ago

Issues and notes on https://jargon.sh/user/unece/DigitalProductPassport/v/working/artefacts/jsonldContexts/DigitalProductPassport.jsonld?class=DigitalProductPassport

18 hours ago

"partyName": {
          "@id": "untp-dpp:partyName",
          "@type": "schemaorg:name"
        },

As we discussed above, partyName should be removed. Use name instead which is already defined in VC context (edited)

17 hours ago

"registrationCountry": {
          "@id": "untp-core:registrationCountry",
          "@type": "@vocab",
          "@context": {
            "@protected": true,
            "@vocab": "https://test.uncefact.org/vocabulary/untp/core/countryCode#"
          }
        },

The url this vocab points to returns http error.

17 hours ago

"fileType": {
          "@id": "untp-core:fileType",
          "@type": "@vocab",
          "@context": {
            "@protected": true,
            "@vocab": "https://test.uncefact.org/vocabulary/untp/core/mimeType#"
          }
        }

Does untp project really needs to maintain list of mimetypes in it's vocabulary? I don't see any reason to. Probably better to leave mimetype property as plain string

17 hours ago

"issuingBody": {
          "@id": "untp-dpp:issuingBody",
          "@type": "untp-core:Party"
        },

@type must be @id, this is how context say that property refers to another object. Property range defined in the vocabulary file, not context.

17 hours ago

"volume": {
          "@protected": true,
          "@id": "untp-core:Measure",

@id must be untp-core:volume

17 hours ago

"Claim": {
      "@protected": true,
      "@id": "untp-dpp:Claim",
      "@type": "@id",

Remove @type. It is only used on properties, not classes

17 hours ago "benchmarkValue": "untp-core:Metric" Should be "benchmarkValue": "untp-core:benchmarkValue"

13 hours ago

"DigitalProductPassport": {
      "@protected": true,
      "@id": "untp-dpp:DigitalProductPassport",
      "@type": "@id",
      "@context": {
        "@context": {
          "@id": "untp-dpp:@context",
          "@type": "xsd:string"
        },
        "issuer": {
          "@id": "untp-dpp:issuer",
          "@type": "untp-core:Party"
        },
        "validFrom": {
          "@id": "untp-dpp:validFrom",
          "@type": "xsd:string"
        },
        "validUntil": {
          "@id": "untp-dpp:validUntil",
          "@type": "xsd:string"
        },
        "credentialSubject": {
          "@id": "untp-dpp:credentialSubject",
          "@type": "untp-dpp:ProductPassport"
        }
      }
    }

The entry:

    "@context": {
      "@id": "untp-dpp:@context",
      "@type": "xsd:string"
    }

Needs to be removed here, this is an invalid scoped context.I would personally remove all of the "DigitalProductPassport" properties here since they are just what the "VerifiableCredential" already defines, but it doesn't break anything having them there.Same for the DCC

PatStLouis commented 1 week ago

@Fak3 please put the json snippets in code blocks for readability and to avoid pinging github users behind the json-ld terms

colugo commented 1 week ago

I have addressed the issues above that were Jargon-related. DigitalProductPassport-context.json

@onthebreeze Make your model-related changes, and then I think the remainder of issues should all go away

VladimirAlexiev commented 1 week ago

Hi @colugo ! I checked your attachment against the original link, and you've made some mistakes:

  1. Redefined "untp-dpp": "https://test.uncefact.org/vocabulary/untp/core/" but that should end in /dpp/
  2. Removed schema prefix, but that's used eg in "productName": "schema:name"
  3. Redefined registrationCountry to use "@vocab": "https://schema.org/countryCode#" but such URL doesn't exist and even if it did, it's not a list of country codes

More mistakes in addition to what @Fak3 listed:

Fak3 commented 6 days ago

@VladimirAlexiev

  • "@type": "untp-core:Classification" is wrong
  • "@type": "untp-core:Identifier" is wrong

What's wrong with them?

VladimirAlexiev commented 1 day ago

@Fak3 @onthebreeze

"@type": "untp-core:Classification" is wrong

JSON-LD is not a schema language, and you cannot specify an ObjectProperty range in the context.

In order words, you can say

"credentialSubject": {
          "@id": "untp-dpp:credentialSubject",
          "@type": "@id"
        }

But you cannot say

"credentialSubject": {
          "@id": "untp-dpp:credentialSubject",
          "@type": "untp-dpp:ProductPassport"
}

You express that kind of expectation (prop ranges) in the ontology.


WHY? because the context allows you to have "pure" payload:

But it doesn't allow you to check what rdf:type is attached to http://example.org/certificate/123

Fak3 commented 1 day ago

@Fak3 @onthebreeze

"@type": "untp-core:Classification" is wrong

JSON-LD is not a schema language,

I mean: where did you see "@type": "untp-core:Classification" in the context file?

VladimirAlexiev commented 1 day ago

@Fak3 It's already fixed! And there are other differences, eg in my copy (of 11 Jul):

    "Standard": {
      "@context": {
        "issuingBody": {
          "@id": "untp-dpp:issuingBody",
          "@type": "untp-core:Party"
        },

but in the current version:

Standard: {
      "@context": {
        issuingParty: {
          @id: "untp-dpp:issuingParty",
          @type: "@id"