Skip to content

Commit

Permalink
feat: Add cached citizenship JSON-LD context.
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Sabadello <[email protected]>
  • Loading branch information
peacekeeper committed Dec 1, 2020
1 parent 9e40fdc commit 5ba35fe
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class VerifiableCredentialContexts {
public static final URI JSONLD_CONTEXT_W3C_2018_CREDENTIALS_V1 = URI.create("https://www.w3.org/2018/credentials/v1");
public static final URI JSONLD_CONTEXT_W3C_2018_CREDENTIALS_V2 = URI.create("https://www.w3.org/2018/credentials/v2");
public static final URI JSONLD_CONTEXT_W3C_2018_CREDENTIALS_EXAMPLES_V1 = URI.create("https://www.w3.org/2018/credentials/examples/v1");
public static final URI JSONLD_CONTEXT_W3ID_CITIZENSHIP_V1 = URI.create("https://w3id.org/citizenship/v1");
public static final URI JSONLD_CONTEXT_W3C_NS_ODRL = URI.create("https://www.w3.org/ns/odrl.jsonld");
public static final URI JSONLD_CONTEXT_DANUBETECH_2020_CREDENTIALS_V1 = URI.create("https://danubetech.com/2020/credentials/v1");

Expand All @@ -36,6 +37,8 @@ public class VerifiableCredentialContexts {
JsonDocument.of(MediaType.JSON_LD, VerifiableCredentialContexts.class.getResourceAsStream("credentials-v2-unstable.jsonld")));
CONTEXTS.put(JSONLD_CONTEXT_W3C_2018_CREDENTIALS_EXAMPLES_V1,
JsonDocument.of(MediaType.JSON_LD, VerifiableCredentialContexts.class.getResourceAsStream("credentials-examples-v1.jsonld")));
CONTEXTS.put(JSONLD_CONTEXT_W3ID_CITIZENSHIP_V1,
JsonDocument.of(MediaType.JSON_LD, VerifiableCredentialContexts.class.getResourceAsStream("citizenship-v1.jsonld")));
CONTEXTS.put(JSONLD_CONTEXT_W3C_NS_ODRL,
JsonDocument.of(MediaType.JSON_LD, VerifiableCredentialContexts.class.getResourceAsStream("odrl.jsonld")));
CONTEXTS.put(JSONLD_CONTEXT_DANUBETECH_2020_CREDENTIALS_V1,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
{
"@context": {
"@version": 1.1,
"@protected": true,

"name": "http://schema.org/name",
"description": "http://schema.org/description",
"identifier": "http://schema.org/identifier",
"image": {"@id": "http://schema.org/image", "@type": "@id"},

"PermanentResidentCard": {
"@id": "https://w3id.org/citizenship#PermanentResidentCard",
"@context": {
"@version": 1.1,
"@protected": true,

"id": "@id",
"type": "@type",

"description": "http://schema.org/description",
"name": "http://schema.org/name",
"identifier": "http://schema.org/identifier",
"image": {"@id": "http://schema.org/image", "@type": "@id"}
}
},

"PermanentResident": {
"@id": "https://w3id.org/citizenship#PermanentResident",
"@context": {
"@version": 1.1,
"@protected": true,

"id": "@id",
"type": "@type",

"ctzn": "https://w3id.org/citizenship#",
"schema": "http://schema.org/",
"xsd": "http://www.w3.org/2001/XMLSchema#",

"birthCountry": "ctzn:birthCountry",
"birthDate": {"@id": "schema:birthDate", "@type": "xsd:dateTime"},
"commuterClassification": "ctzn:commuterClassification",
"familyName": "schema:familyName",
"gender": "schema:gender",
"givenName": "schema:givenName",
"lprCategory": "ctzn:lprCategory",
"lprNumber": "ctzn:lprNumber",
"residentSince": {"@id": "ctzn:residentSince", "@type": "xsd:dateTime"}
}
},

"Person": "http://schema.org/Person"
}
}

0 comments on commit 5ba35fe

Please sign in to comment.