Skip to content
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

Feature/schema library #69

Merged
merged 15 commits into from
Dec 14, 2023
Merged
71 changes: 71 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Build
on:
push:
branches:
- main
pull_request:
types: [ opened, synchronize, reopened ]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: set lower case repo name
run: |
echo "REPO_LC=${REPO,,}" >>${GITHUB_ENV}
env:
REPO: '${{ github.event.repository.name }}'
- name: Login to Public ECR
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
registry: public.ecr.aws
username: ${{ secrets.AWS_ACCESS_KEY_ID }}
password: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
- name: Build image
run: |
docker build -t $REPO_LC data-model/
- name: Trivy - List all vulnerabilities
uses: aquasecurity/trivy-action@master
with:
image-ref: '$REPO_LC'
format: 'table'
ignore-unfixed: true
vuln-type: 'os,library'
- name: Trivy - Stop on Severe Vulnerabilities
uses: aquasecurity/trivy-action@master
with:
image-ref: '$REPO_LC'
format: 'table'
ignore-unfixed: true
trivyignores: .github/workflows/.trivyignore
exit-code: '1'
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: public.ecr.aws/dissco/$REPO_LC
tags: |
type=sha
type=raw,value=latest
- name: Build and Push to ECR
uses: docker/build-push-action@v3
with:
context: "{{defaultContext}}:data-model"
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
- name: Set outputs
id: vars
run: echo "::set-output name=sha_short::$(git rev-parse --short HEAD)"
- name: Push tag
if: github.event_name != 'pull_request'
uses: anothrNick/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CUSTOM_TAG: sha-${{ steps.vars.outputs.sha_short }}
14 changes: 14 additions & 0 deletions data-model/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM nginx:stable-alpine3.17-slim

COPY ./nginx/nginx.conf /etc/nginx/nginx.conf

COPY ./annotations/0.1.0/schema/annotation.json schema-root/schemas/annotations/0.1.0/annotation.json

COPY ./fdo-profiles/0.1.0/digital-specimen/schema/ schema-root/schemas/fdo-profiles/0.1.0/
COPY ./fdo-profiles/0.1.0/doi-kernel/schema/ schema-root/schemas/fdo-profiles/0.1.0/
COPY ./fdo-profiles/0.1.0/handle-kernel/schema/ schema-root/schemas/fdo-profiles/0.1.0/

COPY ./specimens-and-media/0.1.0/digital-specimens/schema schema-root/schemas/digital-specimens/0.1.0/
COPY ./specimens-and-media/0.1.0/shared-models/schema schema-root/schemas/shared-models/0.1.0/
COPY ./specimens-and-media/0.1.0/digital-media-object/schema schema-root/schemas/digital-media-object/0.1.0/

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$id": "https://schema.dissco.tech/0.0.1/annotation",
"$id": "https://schemas.dissco.tech/schemas/annotations/0.1.0/annotation.json",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Annotation",
"description": "Information about the annotation data model. This model has been based on the W3C Web Annotation model",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"$id": "handle-kernel",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$comment": "Kernel from which all DiSSCo DOI FDO profiles are derived",
"allof": [
{
"$ref": "https://schemas.dissco.tech/schemas/fdo-profiles/0.1.0/handle-kernel.json"
},
{
"$ref": "https://schemas.dissco.tech/schemas/fdo-profiles/0.1.0/doi-kernel.json"
}
],
"properties": {
"specimenHost": {
"type": "string",
"description": "ROR or, in absence of a ROR, Wikidata Qnumber for the administrative organisation hosting the specimen. Same as: Latimer Core identifierSource.",
"example": "https://ror.org/0566bfb96",
"$comment": "idx = 200"
},
"specimenHostName": {
"type": "string",
"description": "Name for the administrative organisation as derived from ROR or Wikidata at the point of creating the FDO record.",
"example": "Naturalis Biodiversity Center",
"$comment": "idx = 201"
},
"primarySpecimenObjectId": {
"type": "string",
"description": "Primary local identifier used to identify the physical specimen, which is a preserved material entity. This identifier is usually physically attached to the specimen, e.g. as barcode. It is recommended to use a global and resolvable identifier if available. The host of the physical specimen should be able to find the physical specimen with only this ID plus, if that is not globally unique, the primarySpecimenObjectIdName",
"example": "RMNH.1.2b",
"$comment": "idx = 202"
},
"primarySpecimenObjectIdType": {
"enum": [
"Global",
"Resolvable",
"Local"
],
"description": "Nature of institutional identifier",
"$comment": "idx = 203"
}
},
"primarySpecimenObjectIdName": {
"type": "string",
"description": "Locally used name for the identifier, to distinguish it from other locally used identifiers, max 30 characters.",
"example": "Registration number",
"$comment": "idx = 204"
},
"normalisedSpecimenObjectId": {
"type": "string",
"description": "For internal processing purposes only to make a local identifier globally unique. This is the primarySpecimenObjectId if it is globally unique or a combination of ROR ID string, source system ID string, primarySpecimenObjectId if it is a proprietary identifier.",
"example": "0566bfb96:20.5000.1025/GEE-W3J-HL2:RMNH.1.2b",
"$comment": "idx = 205"
},
"specimenObjectIdAbsenceReason": {
"type": "string",
"description": "*Not currently supported.* Either this attribute or primarySpecimenObjectId needs to be filled, if both are filled the FDO record is invalid. Max 255 chars. Note that absence of the ID poses a challenge on avoiding duplicate digital specimen IDs.",
"example": "Not yet accessioned",
"$comment": "idx = 206"
},
"otherSpecimenIds": {
"type": "array",
"$comment": "idx = 207",
"items": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"idType": {
"type": "string"
},
"idName": {
"type": "string"
}
}
}
},
"topicOrigin": {
"enum": ["Natural", "Human-made", "Mixed origin"],
"description": "Highest-level terms identifying the fundamentals of the activities, in which context the objects in the collection were collected.",
"$comment": "idx = 208"
},
"topicDomain": {
"enum": [],
"description": "",
"$comment": "idx = 209"
},

"": {
"type": "string",
"description": "",
"example": "",
"$comment": "idx = "
},
"additionalProperties": false,
"required": [
"specimenHost",
"specimenHostName"

]
}
41 changes: 41 additions & 0 deletions data-model/fdo-profiles/0.1.0/doi-kernel/schema/doi-kernel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
{
"$id": "handle-kernel",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$comment": "Kernel from which all DiSSCo DOI FDO profiles are derived",
"allof": [{
"$ref": "https://schemas.dissco.tech/schemas/fdo-profiles/0.1.0/handle-kernel.json"
}],
"properties": {
"referentType": {
"type": "string",
"description": "A generic name for the type of object that the DOI refers to. This is different from digitalObjectType that points to a specific type, e.g. there can be different types of digital specimens that each have a slightly different metadata schema because they describe a different kind of specimen, like a botanical versus a geological specimen.",
"example": "digital specimen",
"$comment": "idx = 40"
},
"referentDoiName": {
"type": "string",
"description": "The bare DOI Name string for the PID, e.g. without the resolver.",
"example": "10.22/GEE-W3J-HL2",
"$comment": "idx = 41"
},
"referentName": {
"type": "string",
"description": "In the case of a digital specimen this is the name for the object in the collection, which can be anything from a taxon name to a collection number.",
"example": "Mus musculus type 1",
"$comment": "idx = 42"
},
"primaryReferentType": {
"type": "string",
"description": "The primary type of the referent in the DOI Kernel XML Schema (e.g. creation, party, event). This is an open list. For digital specimens and media it will always be creation.",
"example": "creation",
"$comment": "idx = 43"
}
},
"additionalProperties": true,
"required": [
"referentType",
"referentDoiName",
"referentName",
"primaryReferentType"
]
}
30 changes: 30 additions & 0 deletions data-model/fdo-profiles/0.1.0/doi-kernel/schema/doi-request.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$id": "handle-kernel",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$comment": "Kernel from which all DiSSCo DOI FDO profiles are derived",
"allof": [
{
"$ref": "https://schemas.dissco.tech/schemas/fdo-profiles/0.1.0/handle-request.json"
}
],
"properties": {
"referentType": {
"type": "string",
"description": "A generic name for the type of object that the DOI refers to. This is different from digitalObjectType that points to a specific type, e.g. there can be different types of digital specimens that each have a slightly different metadata schema because they describe a different kind of specimen, like a botanical versus a geological specimen.",
"example": "digital specimen",
"$comment": "idx = 40"
},
"referentName": {
"type": "string",
"description": "In the case of a digital specimen this is the name for the object in the collection, which can be anything from a taxon name to a collection number.",
"example": "Mus musculus type 1",
"$comment": "idx = 42"
},
"primaryReferentType": {
"type": "string",
"description": "The primary type of the referent in the DOI Kernel XML Schema (e.g. creation, party, event). This is an open list. For digital specimens and media it will always be creation.",
"example": "creation",
"$comment": "idx = 43"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"$id": "handle-kernel",
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"$comment": "Kernel from which all DiSSCo FAIR Digital Object profiles are derived",
"properties": {
"fdoProfile" : {
"type": "string",
"description": "PID to a machine readable description of the attributes in the FDO record",
"example": "https://hdl.handle.net/21.T11148/d8de0819e144e4096645",
"$comment": "idx = 1"
},
"fdoRecordLicense": {
"const": "https://creativecommons.org/publicdomain/zero/1.0/",
"description": "The licence for the FDO record, required to be always public domain",
"$comment": "idx = 2"
},
"digitalObjectType": {
"type": "string",
"description": "PID to a description of the Type of digital object that defines the metadata, bit sequences (if any) and operations for the object",
"example": "https://hdl.handle.net/21.T11148/894b1e6cad57e921764e",
"$comment": "idx = 3"
},
"digitalObjectName": {
"type": "string",
"description": "Name of the object type for humans\n",
"example": "digital specimen type 1",
"$comment": "idx = 4"
},
"pid": {
"type": "string",
"description": "The PID of which the FDO record is part, in DiSSCo this is a Handle or DOI. It is recommended to store this pid also in the local collection management system for the specimen.",
"example": "https://doi.org/10.22/GEE-W3J-HL2",
"$comment": "idx = 5"
},
"pidIssuer": {
"type": "string",
"description": "In case of a DOI this is a PID for the DOI Registration Agency",
"example": "https://hdl.handle.net/10.17183",
"$comment": "idx = 6"
},
"pidIssuerName": {
"type": "string",
"description": "Human-readable name of the PID issuer",
"example": "DataCite",
"$comment": "idx = 7"
},
"issuedForAgent": {
"type": "string",
"description": "In the case of a digital specimen, this is a PID for DiSSCo as the agent responsible for serving the digital specimen object",
"example": "https://hdl.handle.net/10.22",
"$comment": "idx = 8"
},
"issuedForAgentName": {
"type": "string",
"description": "Human-readable agent name",
"example": "DiSSCo",
"$comment": "idx = 9"
},
"pidRecordIssueDate": {
"type": "string",
"description": "Date the PID record was created",
"example": "2023-10-16T12:08:37.494Z",
"$comment": "idx = 10"
},
"pidRecordIssueNumber": {
"type": "integer",
"description": "Starts with 1 and is incrementally increased by 1 every time the pid record is updated. Compatible with DOI schema requirements.",
"example": "2",
"$comment": "idx = 11"
},
"structuralType": {
"enum": ["digital", "physical", "performance", "abstraction"],
"description": "Nature of the digital object, compatible with DOI schema requirements. The nature of a digital specimen object is always \"digital\". Other digital objects (outside DiSSCo) could be of physical, performance or abstraction nature.",
"$comment": "idx = 12"
},
"pidStatus": {
"enum": ["DRAFT", "ACTIVE", "RETIRED", "OBSOLETE", "FAILED", "MERGED", "SPLIT", "TEST"],
"description": "A PID is considered to have a lifecycle, PID status indicates the status in the life cycle, e.g. draft, active, retired. PID statuses are described further in the PID infrastructure design.",
"$comment": "idx = 13"
}
},
"required": [
"fdoProfile",
"fdoRecordLicense",
"digitalObjectType",
"digitalObjectName",
"pid",
"pidIssuer",
"pidIssuerName",
"issuedForAgent",
"pidRecordIssueDate",
"pidRecordIssueNumber",
"structuralType",
"pidStatus"
]
}
Loading