-
Notifications
You must be signed in to change notification settings - Fork 1
feat: w3c vc context for opencert certificate #101
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
Merged
Merged
Changes from 3 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
41133ef
feat: added w3c Vc conext for opencert certificate
manishdex25 4f0bce9
fix: updated the uri for schema
manishdex25 2327730
fix: coderabbit issues
manishdex25 1708f3c
feat: opencert certificate context
manishdex25 248730d
fix: fix to example.com as context notdefined in schema.org
manishdex25 f78dcab
fix: renamed the file to opencerts-demo-context
manishdex25 49a525e
chore: update package versions to 2.0.2 and rename opencerts context …
manishdex25 afeaf74
chore: update deployment script and add opencerts-demo-context to fil…
rongquan1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,81 @@ | ||
| { | ||
| "@context": { | ||
| "@version": 1.1, | ||
| "@protected": true, | ||
| "OpenCertsCertificate": { | ||
| "@id": "https://trustvc.io/terms#OpenCertsCertificate", | ||
| "@type": "@id", | ||
| "@context": { | ||
| "@protected": true, | ||
| "name": { | ||
| "@id": "https://schema.org/name" | ||
| }, | ||
| "description": { | ||
| "@id": "https://schema.org/description" | ||
| }, | ||
| "issuedOn": { | ||
| "@id": "https://schema.org/dateIssued" | ||
| }, | ||
| "admissionDate": { | ||
| "@id": "https://trustvc.io/terms#admissionDate" | ||
| }, | ||
| "graduationDate": { | ||
| "@id": "https://trustvc.io/terms#graduationDate" | ||
| }, | ||
| "recipient": { | ||
| "@id": "https://trustvc.io/terms#recipient" | ||
| }, | ||
| "nric": { | ||
| "@id": "https://trustvc.io/terms#nric" | ||
| }, | ||
| "course": { | ||
| "@id": "https://schema.org/course" | ||
| }, | ||
| "transcript": { | ||
| "@id": "https://trustvc.io/terms#transcript" | ||
| }, | ||
| "grade": { | ||
| "@id": "https://schema.org/gradeLevel" | ||
| }, | ||
| "courseCredit": { | ||
| "@id": "https://trustvc.io/terms#courseCredit" | ||
| }, | ||
| "courseCode": { | ||
| "@id": "https://trustvc.io/terms#courseCode" | ||
| }, | ||
| "examinationDate": { | ||
| "@id": "https://trustvc.io/terms#examinationDate" | ||
| }, | ||
| "semester": { | ||
| "@id": "https://trustvc.io/terms#semester" | ||
| }, | ||
| "additionalData": { | ||
| "@id": "https://trustvc.io/terms#additionalData" | ||
| }, | ||
| "merit": { | ||
| "@id": "https://trustvc.io/terms#merit" | ||
| }, | ||
| "studentId": { | ||
| "@id": "https://trustvc.io/terms#studentId" | ||
| }, | ||
| "transcriptId": { | ||
| "@id": "https://trustvc.io/terms#transcriptId" | ||
| }, | ||
| "certSignatories": { | ||
| "@id": "https://trustvc.io/terms#certSignatories" | ||
| }, | ||
| "signature": { | ||
| "@id": "https://trustvc.io/terms#signature" | ||
| }, | ||
| "position": { | ||
| "@id": "https://schema.org/jobTitle" | ||
| }, | ||
| "organisation": { | ||
| "@id": "https://schema.org/Organization" | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🧩 Analysis chain
🌐 Web query:
In JSON-LD 1.1, if a term in@contextis used as a property, can its@idbe a class IRI such ashttps://schema.org/Organization`? Also, what does Schema.orghttps://schema.org/gradeLevelrepresent, and is it intended for academic result values like "A", GPA, or "Distinction"?`💡 Result:
JSON-LD 1.1: can a property term’s
@idbe a class IRI (e.g.,https://schema.org/Organization)?Yes syntactically: in JSON-LD 1.1 a term definition’s
@idvalue may be any IRI/compact IRI/term/etc., and JSON-LD processors generally don’t enforce whether that IRI is “really” an RDF property. However, if you then use that term as a JSON property, the expanded IRI is used as the predicate, so mapping a property term to a class IRI is usually a modeling mistake (you’d typically use that class IRI with@type, not as a predicate). [1]What does Schema.org
gradeLevelrepresent, and is it for “A”, GPA, “Distinction”, etc.?https://schema.org/gradeLevelis not a Schema.org term (the URL returns 404 Not Found). [2]What people often mean instead is
educationalLevel, which Schema.org defines as: “The level in terms of progression through an educational or training context” (e.g., beginner/intermediate/advanced, or formal level/grade schemes). [3] Schema.org’s examples show it being used with a “US Grade Levels” scheme (e.g., grade “2”). [4]So it’s not intended for academic result values like letter grades (“A”), GPA, or honors (“Distinction”); it’s for the learner’s/credential’s/resource’s level in an education/training progression. [3][4]
Sources
[1] JSON-LD 1.1 spec (term definition
@idvalue constraints) (w3.org)[2] Schema.org
gradeLevelURL (404) ()[3] Schema.org
educationalLeveldefinition (schema.org)[4] Schema.org
educationalLevelexample using “US Grade Levels” (schema.org)Citations:
🏁 Script executed:
fd "opencerts-context.json" -t fRepository: TrustVC/w3c
Length of output: 110
🏁 Script executed:
cat -n packages/w3c-context/src/context/opencerts-context.json | head -100Repository: TrustVC/w3c
Length of output: 2798
Use custom predicates from trustvc.io instead of Schema.org
gradeLevelandOrganization.Line 37-38:
gradeLevelathttps://schema.org/gradeLeveldoes not exist in Schema.org and is semantically wrong for certificate result values like "A", GPA, or "Distinction".Line 73-74:
organisationuseshttps://schema.org/Organization, which is a class IRI, not a predicate—a modeling mistake in JSON-LD. Properties should map to predicates, not classes.Both terms will be published as part of the VC context (via
packages/w3c-context/src/lib/index.ts) and become locked into issued credentials, making future migrations difficult. Use custom predicates consistent with the existing trustvc.io terms already used throughout this file.🔧 Suggested fix
"grade": { - "@id": "https://schema.org/gradeLevel" + "@id": "https://trustvc.io/terms#grade" }, @@ "organisation": { - "@id": "https://schema.org/Organization" + "@id": "https://trustvc.io/terms#organisation" }🤖 Prompt for AI Agents