Skip to content

Commit

Permalink
Add type_of property to insert the class assertion in the graph
Browse files Browse the repository at this point in the history
  • Loading branch information
johardi committed Nov 30, 2023
1 parent ec4501a commit 843c292
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
23 changes: 16 additions & 7 deletions schemas/src/shared/metadata-base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ prefixes:
foaf: http://xmlns.com/foaf/0.1/
schema: http://schema.org/
rdfs: http://www.w3.org/2000/01/rdf-schema#
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
xsd: http://www.w3.org/2001/XMLSchema#
linkml: https://w3id.org/linkml/

Expand All @@ -25,6 +26,10 @@ classes:
mixin: true
slots:
- id
Instance:
mixin: true
slots:
- type_of
ProvEntity:
class_uri: prov:Entity
slots:
Expand All @@ -35,27 +40,25 @@ classes:
slots:
- had_member
Creator:
mixins:
- Person
- SoftwareApplication
abstract: true
slots:
- class_type
slot_usage:
class_type:
annotations:
owl: SubClassOf
Person:
is_a: Creator
mixins:
- NamedEntity
- Instance
class_uri: schema:Person
slots:
- fullName
- firstName
- lastName
- orcid
SoftwareApplication:
is_a: Creator
mixins:
- NamedEntity
- Instance
class_uri: schema:SoftwareApplication
slots:
- name
Expand Down Expand Up @@ -108,6 +111,12 @@ slots:
class_type:
required: true
designates_type: true
slot_uri: ccf:class_type
type_of:
range: NamedEntity
slot_uri: rdf:type
annotations:
owl: ClassAssertion

# DCAT properties
distributions:
Expand Down
6 changes: 6 additions & 0 deletions src/normalization/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,19 @@ export function normalizeMetadata(context, metadata) {
metadata.creators = metadata.creators?.map((creator) => ({
id: `https://orcid.org/${creator.orcid}`,
class_type: "Person",
type_of: "schema:Person",
...creator
}));
metadata.project_leads = metadata.project_leads?.map((leader) => ({
id: `https://orcid.org/${leader.orcid}`,
class_type: "Person",
type_of: "schema:Person",
...leader
}))
metadata.reviewers = metadata.reviewers?.map((reviewer) => ({
id: `https://orcid.org/${reviewer.orcid}`,
class_type: "Person",
type_of: "schema:Person",
...reviewer
}))
return {
Expand Down Expand Up @@ -111,6 +116,7 @@ function generateGraphMetadata(context, metadata) {
creators: [{
id: "https://github.com/hubmapconsortium/hra-do-processor",
class_type: "SoftwareApplication",
type_of: "schema:SoftwareApplication",
name: "HRA Digital Object Processor",
version: getVersionTag(),
target_product: {
Expand Down

0 comments on commit 843c292

Please sign in to comment.