Skip to content

Commit

Permalink
test: add seed credential schema+vocab
Browse files Browse the repository at this point in the history
  • Loading branch information
noandrea committed May 30, 2022
1 parent d935f40 commit 831fbb9
Show file tree
Hide file tree
Showing 8 changed files with 603 additions and 1 deletion.
52 changes: 52 additions & 0 deletions scripts/seeds/credentials/organization-role.context.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"@context": {
"w3ccred": "https://www.w3.org/2018/credentials#",
"schema-id": "https://beta.api.schemas.serto.id/v1/public/organization-role/1.0/ld-context.json#",
"OrganizationRole": {
"@id": "schema-id"
},
"credentialStatus": {
"@id": "schema-id:credentialStatus",
"@context": {
"id": {
"@id": "schema-id:id",
"@type": "http://schema.org/URL"
},
"type": {
"@id": "schema-id:type",
"@type": "http://schema.org/Text"
},
"revocationListIndex": {
"@id": "schema-id:revocationListIndex",
"@type": "http://schema.org/Number"
},
"revocationListCredential": {
"@id": "schema-id:revocationListCredential",
"@type": "http://schema.org/URL"
}
}
},
"credentialSubject": {
"@id": "w3ccred:credentialSubject",
"@context": {
"id": {
"@id": "schema-id:id",
"@type": "@id"
},
"title": {
"@id": "schema-id:title",
"@type": "http://schema.org/Text"
},
"employmentType": {
"@id": "schema-id:employmentType",
"@type": "http://schema.org/Text"
},
"responsibilities": {
"@id": "schema-id:responsibilities",
"@type": "http://schema.org/Text"
}
}
},
"@version": 1.1
}
}
151 changes: 151 additions & 0 deletions scripts/seeds/credentials/organization-role.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://beta.api.schemas.serto.id/v1/public/organization-role/1.0/json-schema.json",
"$metadata": {
"slug": "organization-role",
"version": "1.0",
"icon": "🅞",
"discoverable": false,
"uris": {
"jsonLdContextPlus": "https://beta.api.schemas.serto.id/v1/public/organization-role/1.0/ld-context-plus.json",
"jsonLdContext": "https://beta.api.schemas.serto.id/v1/public/organization-role/1.0/ld-context.json",
"jsonSchema": "https://beta.api.schemas.serto.id/v1/public/organization-role/1.0/json-schema.json"
}
},
"title": "OrganizationRole",
"description": "A role of a Person within an Organization",
"type": "object",
"required": [
"@context",
"type",
"issuer",
"issuanceDate",
"credentialStatus",
"credentialSubject"
],
"properties": {
"@context": {
"type": [
"string",
"array",
"object"
]
},
"id": {
"type": "string",
"format": "uri"
},
"type": {
"type": [
"string",
"array"
],
"items": {
"type": "string"
}
},
"issuer": {
"type": [
"string",
"object"
],
"format": "uri",
"required": [
"id"
],
"properties": {
"id": {
"type": "string",
"format": "uri"
}
}
},
"issuanceDate": {
"type": "string",
"format": "date-time"
},
"expirationDate": {
"type": "string",
"format": "date-time"
},
"credentialStatus": {
"title": "credentialStatus",
"type": "object",
"required": [
"id",
"type",
"revocationListIndex",
"revocationListCredential"
],
"properties": {
"id": {
"title": "id",
"description": "",
"type": "string",
"format": "uri"
},
"type": {
"title": "type",
"description": "RevocationList2020Status",
"type": "string"
},
"revocationListIndex": {
"title": "revocationListIndex",
"description": "",
"type": "number"
},
"revocationListCredential": {
"title": "revocationListCredential",
"description": "",
"type": "string",
"format": "uri"
}
}
},
"credentialSubject": {
"type": "object",
"required": [
"id"
],
"properties": {
"id": {
"title": "Credential Subject ID",
"description": "The DID of the person holding the role",
"type": "string",
"format": "uri"
},
"title": {
"title": "Title",
"description": "The name of the role",
"type": "string"
},
"employmentType": {
"title": "employmentType",
"description": "Type of employment (e.g. full-time, part-time, contract, temporary, seasonal, internship).",
"type": "string"
},
"responsibilities": {
"title": "responsibilities",
"description": "Responsibilities associated with this role or Occupation.",
"type": "string"
}
}
},
"credentialSchema": {
"type": "object",
"required": [
"id",
"type"
],
"properties": {
"id": {
"type": "string",
"format": "uri"
},
"type": {
"type": "string"
}
}
}
}
}
72 changes: 72 additions & 0 deletions scripts/seeds/credentials/organization.context.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"@context": {
"w3ccred": "https://www.w3.org/2018/credentials#",
"schema-id": "https://beta.api.schemas.serto.id/v1/public/organization/1.0/ld-context.json#",
"Organization": {
"@id": "schema-id"
},
"credentialStatus": {
"@id": "schema-id:credentialStatus",
"@context": {
"id": {
"@id": "schema-id:id",
"@type": "http://schema.org/URL"
},
"type": {
"@id": "schema-id:type",
"@type": "http://schema.org/Text"
},
"revocationListIndex": {
"@id": "schema-id:revocationListIndex",
"@type": "http://schema.org/Number"
},
"revocationListCredential": {
"@id": "schema-id:revocationListCredential",
"@type": "http://schema.org/URL"
}
}
},
"credentialSubject": {
"@id": "w3ccred:credentialSubject",
"@context": {
"id": {
"@id": "schema-id:id",
"@type": "@id"
},
"name": {
"@id": "schema-id:name",
"@type": "http://schema.org/Text"
},
"legalName": {
"@id": "schema-id:legalName",
"@type": "http://schema.org/Text"
},
"iso6523Code": {
"@id": "schema-id:iso6523Code",
"@type": "http://schema.org/Text"
},
"isicV4": {
"@id": "schema-id:isicV4",
"@type": "http://schema.org/Text"
},
"slogan": {
"@id": "schema-id:slogan",
"@type": "http://schema.org/Text"
},
"logo": {
"@id": "schema-id:logo",
"@type": "http://schema.org/Text"
},
"keywords": {
"@id": "schema-id:keywords",
"@type": "http://schema.org/Text"
},
"areaServed": {
"@id": "schema-id:areaServed",
"@type": "http://schema.org/Text"
}
}
},
"@version": 1.1
}
}
Loading

0 comments on commit 831fbb9

Please sign in to comment.