Skip to content

Commit

Permalink
Merge pull request #130 from DiSSCo/ImplementOpenDS_0.4.0
Browse files Browse the repository at this point in the history
Implement open ds 0.4.0
  • Loading branch information
TomDijkema authored Nov 20, 2024
2 parents 07c17c3 + 6099792 commit 4148438
Show file tree
Hide file tree
Showing 88 changed files with 7,923 additions and 3,098 deletions.
42 changes: 22 additions & 20 deletions src/app/GenerateTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,28 @@ import { Dict } from './Types';

/* Dict of types and their endpoints to fetch */
const typesDict = {
identifier: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.3.0/identifier.json',
agent: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.3.0/agent.json',
assertion: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.3.0/assertion.json',
chronometricAge: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.3.0/chronometric-age.json',
citation: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.3.0/citation.json',
tombstoneMetadata: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.3.0/tombstone-metadata.json',
entityRelationship: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.3.0/entity-relationship.json',
identification: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.3.0/identification.json',
location: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.3.0/location.json',
event: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.3.0/event.json',
digitalMedia: 'https://schemas.dissco.tech/schemas/fdo-type/digital-media/0.3.0/digital-media.json',
materialEntity: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.3.0/material-entity.json',
digitalSpecimen: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.3.0/digital-specimen.json',
annotationTarget: 'https://schemas.dissco.tech/schemas/fdo-type/annotation/0.3.0/annotation-target.json',
annotationBody: 'https://schemas.dissco.tech/schemas/fdo-type/annotation/0.3.0/annotation-body.json',
annotation: 'https://schemas.dissco.tech/schemas/fdo-type/annotation/0.3.0/annotation.json',
sourceSystem: 'https://schemas.dissco.tech/schemas/fdo-type/source-system/0.3.0/source-system.json',
environmentalVariable: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.3.0/environmental-variable.json',
secretVariable: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.3.0/secret-variable.json',
machineAnnotationService: 'https://schemas.dissco.tech/schemas/fdo-type/machine-annotation-service/0.3.0/machine-annotation-service.json'
identifier: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.4.0/identifier.json',
agent: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.4.0/agent.json',
assertion: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.4.0/assertion.json',
chronometricAge: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.4.0/chronometric-age.json',
citation: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.4.0/citation.json',
tombstoneMetadata: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.4.0/tombstone-metadata.json',
entityRelationship: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.4.0/entity-relationship.json',
taxonIdentification: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.4.0/taxon-identification.json',
identification: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.4.0/identification.json',
georeference: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.4.0/georeference.json',
geologicalContext: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.4.0/geological-context.json',
location: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.4.0/location.json',
event: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.4.0/event.json',
digitalMedia: 'https://schemas.dissco.tech/schemas/fdo-type/digital-media/0.4.0/digital-media.json',
specimenPart: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.4.0/specimen-part.json',
digitalSpecimen: 'https://schemas.dissco.tech/schemas/fdo-type/digital-specimen/0.4.0/digital-specimen.json',
annotationTarget: 'https://schemas.dissco.tech/schemas/fdo-type/annotation/0.4.0/annotation-target.json',
annotationBody: 'https://schemas.dissco.tech/schemas/fdo-type/annotation/0.4.0/annotation-body.json',
annotation: 'https://schemas.dissco.tech/schemas/fdo-type/annotation/0.4.0/annotation.json',
environmentalVariable: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.4.0/environmental-variable.json',
secretVariable: 'https://schemas.dissco.tech/schemas/fdo-type/shared-model/0.4.0/secret-variable.json',
machineAnnotationService: 'https://schemas.dissco.tech/schemas/fdo-type/machine-annotation-service/0.4.0/machine-annotation-service.json'
};

/**
Expand Down
12 changes: 6 additions & 6 deletions src/app/Types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,16 +111,16 @@ export type AnnotationTemplate = {
"oa:hasTarget": {
"@id": string,
"@type": string,
"ods:ID": string,
"ods:type": string,
"dcterms:identifier": string,
"ods:fdoType": string,
"oa:hasSelector": {
"@type"?: 'ods:FieldSelector' | 'ods:ClassSelector' | 'oa:FragmentSelector',
"ods:field"?: string
"@type"?: 'ods:TermSelector' | 'ods:ClassSelector' | 'oa:FragmentSelector',
"ods:term"?: string
} | {
"@type"?: 'ods:FieldSelector' | 'ods:ClassSelector' | 'oa:FragmentSelector',
"@type"?: 'ods:TermSelector' | 'ods:ClassSelector' | 'oa:FragmentSelector',
"ods:class"?: string
} | {
"@type"?: 'ods:FieldSelector' | 'ods:ClassSelector' | 'oa:FragmentSelector',
"@type"?: 'ods:TermSelector' | 'ods:ClassSelector' | 'oa:FragmentSelector',
"ac:hasROI"?: {
"ac:xFrac": number,
"ac:yFrac": number,
Expand Down
10 changes: 5 additions & 5 deletions src/app/config/idCard/DigitalMediaIdCardConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ const DigitalMediaIdCardConfig = ({ digitalMedia }: { digitalMedia: DigitalMedia
jsonPath: string,
link?: string
}[] => {
const digitalSpecimenEntityRelationshipIndex: number | undefined = digitalMedia["ods:hasEntityRelationship"]?.findIndex(
const digitalSpecimenEntityRelationshipIndex: number | undefined = digitalMedia["ods:hasEntityRelationships"]?.findIndex(
entityRelationship => entityRelationship['dwc:relationshipOfResource'] === 'hasDigitalSpecimen'
);

return [
{
label: 'Digital Specimen Identifier',
jsonPath: digitalSpecimenEntityRelationshipIndex ? `$['ods:hasEntityRelationship'][${digitalSpecimenEntityRelationshipIndex}]['dwc:relatedResourceID']` : "$['ods:ID']"
jsonPath: digitalSpecimenEntityRelationshipIndex ? `$['ods:hasEntityRelationship'][${digitalSpecimenEntityRelationshipIndex}]['dwc:relatedResourceID']` : "$['@id']"
},
{
label: 'Media URL',
Expand All @@ -44,11 +44,11 @@ const DigitalMediaIdCardConfig = ({ digitalMedia }: { digitalMedia: DigitalMedia
},
{
label: 'Creator',
jsonPath: "$['dcterms:creator']"
jsonPath: "$['hasAgents']"
},
{
label: 'Licence',
jsonPath: "$['dcterms:license']"
label: 'Rights',
jsonPath: "$['dcterms:rights']"
}
];
};
Expand Down
153 changes: 116 additions & 37 deletions src/app/types/Agent.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,44 +11,96 @@ export interface Agent {
*/
"@id"?: string;
/**
* The type of the agent, the prov ontology is only used in the prov-o createUpdateTombstoneEvent
* The type of the agent, the prov ontology is only used in the prov-o ods:CreateUpdateTombstoneEvent
*/
"@type": "schema:Person" | "schema:Organisation" | "as:Application" | "prov:Person" | "prov:SoftwareAgent";
"@type":
| "schema:Person"
| "schema:Organization"
| "schema:SoftwareApplication"
| "prov:Person"
| "prov:SoftwareAgent";
/**
* Full name of the agent
*/
"schema:name"?: string;
/**
* Indicates the role of the agent, https://schema.org/roleName
*/
"schema:roleName"?: string;
/**
* Date the agent began the role
*/
"schema:startDate"?: string;
/**
* Date the agent ended the role
* The primary unique identifier of the Agent object. All identifiers will also be added to the ods:hasIdentifiers array
*/
"schema:endDate"?: string;
"schema:identifier"?: string;
/**
* Order of the agent in the role. Can be used to indicate the order of importance
* Full name of the agent
*/
"ods:roleOrder"?: number;
"schema:name"?: string;
/**
* Email of the agent, can be present in case the agent is a maintainer of a MAS
* Contains all roles associated with the agent in the context of the Digital Object. Should always contain at least one role
*
* @minItems 1
*/
"ods:hasRoles"?: [
{
/**
* The identifier for the agent role, preferably a URL to a controlled vocabulary
*/
"@id"?: string;
/**
* The type of the object, in this case schema:Role
*/
"@type": "schema:Role";
/**
* The category that best matches the nature of a role of an Agent
*/
"schema:roleName": string;
/**
* Date the agent began the role
*/
"schema:startDate"?: string;
/**
* Date the agent ended the role
*/
"schema:endDate"?: string;
/**
* Can be used to indicate the order of importance when there are multiple agents with the same role. Lower order means higher importance.
*/
"schema:position"?: number;
},
...{
/**
* The identifier for the agent role, preferably a URL to a controlled vocabulary
*/
"@id"?: string;
/**
* The type of the object, in this case schema:Role
*/
"@type": "schema:Role";
/**
* The category that best matches the nature of a role of an Agent
*/
"schema:roleName": string;
/**
* Date the agent began the role
*/
"schema:startDate"?: string;
/**
* Date the agent ended the role
*/
"schema:endDate"?: string;
/**
* Can be used to indicate the order of importance when there are multiple agents with the same role. Lower order means higher importance.
*/
"schema:position"?: number;
}[]
];
/**
* Email of the agent
*/
"schema:email"?: string;
/**
* URL of the agent, can be present in case the agent is a maintainer of a MAS
* URL to a website of the agent
*/
"schema:url"?: string;
/**
* Contains zero or more ods:Identifier objects
* Contains all identifiers associated with the agent
*/
"ods:hasIdentifier"?: Identifier[];
"ods:hasIdentifiers"?: Identifier[];
}
/**
* Based on https://rs.gbif.org/extension/gbif/1.0/identifier.xml but includes ods specific terms
* Object used to describe identifiers of a Digital Object, based on https://rs.gbif.org/extension/gbif/1.0/identifier.xml but includes ods specific terms
*/
export interface Identifier {
/**
Expand All @@ -60,35 +112,62 @@ export interface Identifier {
*/
"@type": "ods:Identifier";
/**
* The type of the identifier, https://purl.org/dc/elements/1.1/title
* A name for the identifier
*/
"dcterms:title": string;
/**
* The local title of the identifier
*/
"ods:localTitle"?: string;
/**
* The value for the identifier, https://purl.org/dc/terms/identifier
* The type of the value in the `dcterms:identifier` field
*/
"dcterms:type"?:
| "ARK"
| "arXiv"
| "bibcode"
| "DOI"
| "EAN13"
| "EISSN"
| "Handle"
| "IGSN"
| "ISBN"
| "ISSN"
| "ISTC"
| "LISSN"
| "LSID"
| "PMID"
| "PURL"
| "UPC"
| "URL"
| "URN"
| "w3id"
| "UUID"
| "Other"
| "Locally unique identifier";
/**
* The value for the identifier
*/
"dcterms:identifier": string;
/**
* Mime type of content returned by identifier in case the identifier is resolvable. https://purl.org/dc/terms/format
* All possible mime types of content that can be returned by identifier in case the identifier is resolvable. Plain UUIDs for example do not have a dc:format return type, as they are not resolvable on their own. For a list of MIME types see the list maintained by IANA: http://www.iana.org/assignments/media-types/index.html, in particular the text http://www.iana.org/assignments/media-types/text/ and application http://www.iana.org/assignments/media-types/application/ types. Frequently used values are text/html, text/xml, application/rdf+xml, application/json
*/
"dcterms:format"?: string;
"dcterms:format"?: string[];
/**
* Keywords qualifying the identifier https://purl.org/dc/terms/subject
* Additional keywords that the publisher may prefer to be attached to the identifier
*/
"dcterms:subject"?: string;
"dcterms:subject"?: string[];
/**
* Indicates whether the identifier is part of the physical label
*/
"ods:isPartOfLabel"?: boolean;
/**
* Indicates whether the identifier is part of the barcode or nfc chip
* Indicates whether the identifier is a persistent identifier
*/
"ods:isBarcodeOrNFC"?: boolean;
"ods:gupriLevel"?:
| "LocallyUniqueStable"
| "GloballyUniqueStable"
| "GloballyUniqueStableResolvable"
| "GloballyUniqueStablePersistentResolvable"
| "GloballyUniqueStablePersistentResolvableFDOCompliant";
/**
* Indicates whether the identifier is a persistent identifier
* Indicates the status of the identifier
*/
"ods:isIDPersistent"?: boolean;
"ods:identifierStatus"?: "Preferred" | "Alternative" | "Superseded";
}
Loading

0 comments on commit 4148438

Please sign in to comment.