Skip to content

Commit

Permalink
Merge pull request #5 from linkml/material-process-data
Browse files Browse the repository at this point in the history
added child process container slots and child process data
sierra-moxon authored Aug 5, 2024
2 parents 87f98e1 + e8ed4de commit 9cf7ac2
Showing 17 changed files with 815 additions and 931 deletions.
27 changes: 27 additions & 0 deletions .env.public
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file is public in git. No sensitive info allowed.

###### schema definition variables, used by makefile

LINKML_SCHEMA_NAME="cmdr"
LINKML_SCHEMA_AUTHOR="LinkML Team <admin@linkml.org>"
LINKML_SCHEMA_DESCRIPTION="Core Model for Clinical Data Collection"
LINKML_SCHEMA_SOURCE_PATH="src/cmdr/schema/cmdr.yaml"

###### linkml generator variables, used by makefile

## gen-project configuration file
LINKML_GENERATORS_CONFIG_YAML= --config-file config.yaml

## pass args if gendoc ignores config.yaml (i.e. --no-mergeimports)
LINKML_GENERATORS_DOC_ARGS=

## pass args to workaround genowl rdfs config bug (linkml#1453)
## (i.e. --no-type-objects --no-metaclasses --metadata-profile rdfs)
LINKML_GENERATORS_OWL_ARGS=

## pass args to trigger experimental java/typescript generation
LINKML_GENERATORS_JAVA_ARGS=
LINKML_GENERATORS_TYPESCRIPT_ARGS=

LINKML_SCHEMA_GOOGLE_SHEET_ID="1wVoaiFg47aT9YWNeRfTZ8tYHN8s8PAuDx5i2HUcDpvQ"
LINKML_SCHEMA_GOOGLE_SHEET_TABS="personinfo enums"
29 changes: 15 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
@@ -6,14 +6,6 @@ SHELL := bash
.SUFFIXES:
.SECONDARY:

# environment variables
.EXPORT_ALL_VARIABLES:
ifdef LINKML_ENVIRONMENT_FILENAME
include ${LINKML_ENVIRONMENT_FILENAME}
else
include .env.public
endif

RUN = poetry run
SCHEMA_NAME = $(LINKML_SCHEMA_NAME)
SOURCE_SCHEMA_PATH = $(LINKML_SCHEMA_SOURCE_PATH)
@@ -24,11 +16,20 @@ PYMODEL = $(SRC)/$(SCHEMA_NAME)/datamodel
DOCDIR = docs
EXAMPLEDIR = examples
SHEET_MODULE = from_sheets
SHEET_ID = $(shell ${SHELL} ./utils/get-value.sh google_sheet_id)
SHEET_TABS = $(shell ${SHELL} ./utils/get-value.sh google_sheet_tabs)
SHEET_ID = $(LINKML_SCHEMA_GOOGLE_SHEET_ID)
SHEET_TABS = $(LINKML_SCHEMA_GOOGLE_SHEET_TABS)
SHEET_MODULE_PATH = $(SOURCE_SCHEMA_DIR)/$(SHEET_MODULE).yaml
CONFIG_YAML = config.yaml

# environment variables

.EXPORT_ALL_VARIABLES:
ifdef LINKML_ENVIRONMENT_FILENAME
include ${LINKML_ENVIRONMENT_FILENAME}
else
include .env.public
endif

GEN_PARGS =
ifdef LINKML_COOKIECUTTER_GEN_PROJECT_ARGS
GEN_PARGS = ${LINKML_COOKIECUTTER_GEN_PROJECT_ARGS}
@@ -107,9 +108,9 @@ gen-examples:

# generates all project files

gen-project: $(PYMODEL) compile-sheets
$(RUN) gen-project ${CONFIG_YAML} -d $(DEST) $(SOURCE_SCHEMA_PATH) && mv $(DEST)/*.py $(PYMODEL)

gen-project: $(PYMODEL)
$(RUN) gen-project -d $(DEST) $(SOURCE_SCHEMA_PATH) && mv $(DEST)/*.py $(PYMODEL)
$(RUN) gen-pydantic --pydantic-version 2 $(SOURCE_SCHEMA_PATH) > $(PYMODEL)/pydanticmodel_v2.py

# non-empty arg triggers owl (workaround https://github.com/linkml/linkml/issues/1453)
ifneq ($(strip ${GEN_OWL_ARGS}),)
@@ -129,7 +130,7 @@ endif
test: test-schema test-python test-examples

test-schema:
$(RUN) gen-project ${CONFIG_YAML} -d tmp $(SOURCE_SCHEMA_PATH)
$(RUN) gen-project -d tmp $(SOURCE_SCHEMA_PATH)

test-python:
$(RUN) python -m unittest discover
46 changes: 12 additions & 34 deletions config.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,19 @@
# Configuration of generators (defaults illustrated)
---
generator_args:
excel:
mergeimports: true
jsonschema: {}
owl:
mergeimports: true
metaclasses: true
type_objects: true
# throws 'Cannot handle metadata profile: rdfs'
# metadata_profile: rdfs
markdown:
mergeimports: true
graphql:
mergeimports: true
java:
mergeimports: true
metadata: true
jsonld:
mergeimports: true
jsonschema:
mergeimports: true
jsonldcontext:
mergeimports: true
python:
mergeimports: true
prefixmap:
mergeimports: true
proto:
mergeimports: true
shacl:
mergeimports: true
shex:
mergeimports: true
sqlddl:
mergeimports: true
typescript:
mergeimports: true
metadata: true

...
includes:
- jsonschema
- python
- owl
- shex
- shacl
- prefixmap
excludes:
- graphql
- sqlschema
- protobuf
29 changes: 28 additions & 1 deletion examples/Container-material-entities.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
materials:
- id: "omicsrus:m1"
name: "water"
volume:
has_raw_value: "33.3 mL"
has_numeric_value: 33.3
has_unit: "mL"
- id: "omicsrus:m2"
name: "soil"
volume:
has_raw_value: "100.2 mL"
has_numeric_value: 100.2
has_unit: "mL"
- id: "omicsrus:m3"
name: "blood"
volume:
has_raw_value: "1.2 L"
has_numeric_value: 1.2
has_unit: "L"
investigations:
- id: "omicsrus:st1"
name: "parent study"
@@ -13,10 +27,23 @@ participations:
- id: "omicsrus:p1"
name: "participant one"
includes: "omicsrus:su1"
involved_in: "omicsrus:st1"
- id: "omicsrus:p2"
name: "participant two"
includes: "omicsrus:su2"
involved_in: "omicsrus:st2"
subjects:
- id: "omicsrus:su1"
name: "subject one"
- id: "omicsrus:su2"
name: "subject two"
name: "subject two"
material_processings:
- id: "omicsrus:mp1"
name: "Material Processing 1"
has_input: "omicsrus:m1"
has_output: "omicsrus:m1"
specimen_collection_processes:
- id: "omicsrus:scp1"
name: "Specimen Collection Process 1"
has_input: "omicsrus:su1"
has_output: "omicsrus:m3"
Binary file removed project/excel/cmdr.xlsx
Binary file not shown.
77 changes: 0 additions & 77 deletions project/graphql/cmdr.graphql

This file was deleted.

92 changes: 2 additions & 90 deletions project/jsonld/cmdr.context.jsonld
Original file line number Diff line number Diff line change
@@ -1,115 +1,27 @@
{
"comments": {
"description": "Auto generated by LinkML jsonld context generator",
"generation_date": "2023-03-07T15:56:42",
"generation_date": "2024-08-05T13:47:38",
"source": "cmdr.yaml"
},
"@context": {
"OBI": {
"@id": "http://purl.obolibrary.org/obo/OBI_",
"@prefix": true
},
"OBI": "http://example.org/UNKNOWN/OBI/",
"PATO": {
"@id": "http://purl.obolibrary.org/obo/PATO_",
"@prefix": true
},
"TEMP": "https://example.org/TEMP/",
"biolink": "https://w3id.org/biolink/",
"cmdr": "https://w3id.org/linkml/cmdr/",
"example": "https://example.org/",
"linkml": "https://w3id.org/linkml/",
"schema": "http://schema.org/",
"@vocab": "https://w3id.org/linkml/cmdr/",
"comparator": {
"@id": "TEMP:comparator"
},
"concentration": {
"@id": "TEMP:concentration"
},
"has_input": {
"@id": "TEMP:has_input"
},
"has_numeric_value": {
"@id": "TEMP:has_numeric_value"
},
"has_output": {
"@id": "TEMP:has_output"
},
"has_raw_value": {
"@id": "TEMP:has_raw_value"
},
"has_unit": {
"@id": "TEMP:has_unit"
},
"id": "@id",
"includes": {
"@id": "TEMP:includes"
},
"investigations": {
"@id": "TEMP:investigations"
},
"involved_in": {
"@id": "TEMP:involved_in"
},
"material_processings": {
"@id": "TEMP:material_processings"
},
"materials": {
"@id": "TEMP:materials"
},
"name": {
"@id": "TEMP:name"
},
"part_of": {
"@id": "TEMP:part_of"
},
"participations": {
"@id": "TEMP:participations"
},
"source": {
"@id": "TEMP:source"
},
"specimen_collection_processes": {
"@id": "TEMP:specimen_collection_processes"
},
"subjects": {
"@id": "TEMP:subjects"
},
"used_in": {
"@id": "TEMP:used_in"
},
"volume": {
"@id": "TEMP:volume"
},
"Container": {
"@id": "TEMP:Container"
},
"DataObject": {
"@id": "TEMP:DataObject"
},
"Investigation": {
"@id": "TEMP:Investigation"
},
"MaterialEntity": {
"@id": "TEMP:MaterialEntity"
},
"MaterialProcessing": {
"@id": "OBI:0000094"
},
"Participation": {
"@id": "TEMP:Participation"
},
"Process": {
"@id": "TEMP:Process"
},
"Quantity": {
"@id": "TEMP:Quantity"
},
"SpecimenCollectionProcess": {
"@id": "OBI:0000659"
},
"Subject": {
"@id": "TEMP:Subject"
}
}
}
469 changes: 278 additions & 191 deletions project/jsonld/cmdr.jsonld

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions project/jsonschema/cmdr.schema.json
Original file line number Diff line number Diff line change
@@ -61,7 +61,7 @@
"type": "string"
},
"part_of": {
"type": "string"
"type": "uriorcurie"
}
},
"required": [
@@ -84,11 +84,11 @@
"type": "string"
},
"source": {
"type": "string"
"type": "uriorcurie"
},
"used_in": {
"items": {
"type": "string"
"type": "uriorcurie"
},
"type": "array"
},
@@ -108,13 +108,13 @@
"properties": {
"has_input": {
"items": {
"type": "string"
"type": "uriorcurie"
},
"type": "array"
},
"has_output": {
"items": {
"type": "string"
"type": "uriorcurie"
},
"type": "array"
},
@@ -139,11 +139,11 @@
"type": "string"
},
"includes": {
"type": "string"
"type": "uriorcurie"
},
"involved_in": {
"items": {
"type": "string"
"type": "uriorcurie"
},
"type": "array"
},
@@ -183,13 +183,13 @@
"properties": {
"has_input": {
"items": {
"type": "string"
"type": "uriorcurie"
},
"type": "array"
},
"has_output": {
"items": {
"type": "string"
"type": "uriorcurie"
},
"type": "array"
},
@@ -227,6 +227,7 @@
"$id": "https://w3id.org/linkml/cmdr",
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": true,
"description": "",
"metamodel_version": "1.7.0",
"properties": {
"investigations": {
277 changes: 147 additions & 130 deletions project/owl/cmdr.owl.ttl

Large diffs are not rendered by default.

27 changes: 1 addition & 26 deletions project/prefixmap/cmdr.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,15 @@
{
"OBI": "http://purl.obolibrary.org/obo/OBI_",
"OBI": "http://example.org/UNKNOWN/OBI/",
"PATO": "http://purl.obolibrary.org/obo/PATO_",
"TEMP": "https://example.org/TEMP/",
"biolink": "https://w3id.org/biolink/",
"cmdr": "https://w3id.org/linkml/cmdr/",
"example": "https://example.org/",
"linkml": "https://w3id.org/linkml/",
"schema": "http://schema.org/",
"Container": {
"@id": "TEMP:Container"
},
"DataObject": {
"@id": "TEMP:DataObject"
},
"Investigation": {
"@id": "TEMP:Investigation"
},
"MaterialEntity": {
"@id": "TEMP:MaterialEntity"
},
"MaterialProcessing": {
"@id": "OBI:0000094"
},
"Participation": {
"@id": "TEMP:Participation"
},
"Process": {
"@id": "TEMP:Process"
},
"Quantity": {
"@id": "TEMP:Quantity"
},
"SpecimenCollectionProcess": {
"@id": "OBI:0000659"
},
"Subject": {
"@id": "TEMP:Subject"
}
}
203 changes: 102 additions & 101 deletions project/shacl/cmdr.shacl.ttl
Original file line number Diff line number Diff line change
@@ -1,193 +1,194 @@
@prefix cmdr: <https://w3id.org/linkml/cmdr/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

<https://example.org/TEMP/Container> a sh:NodeShape ;
cmdr:Container a sh:NodeShape ;
sh:closed true ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:class <https://example.org/TEMP/Subject> ;
sh:property [ sh:class cmdr:MaterialEntity ;
sh:nodeKind sh:IRI ;
sh:order 5 ;
sh:path <https://example.org/TEMP/subjects> ],
[ sh:class <https://example.org/TEMP/Investigation> ;
sh:order 0 ;
sh:path cmdr:materials ],
[ sh:class cmdr:Investigation ;
sh:nodeKind sh:IRI ;
sh:order 4 ;
sh:path <https://example.org/TEMP/investigations> ],
[ sh:class <https://example.org/TEMP/MaterialEntity> ;
sh:path cmdr:investigations ],
[ sh:class cmdr:Participation ;
sh:nodeKind sh:IRI ;
sh:order 0 ;
sh:path <https://example.org/TEMP/materials> ],
[ sh:class <http://purl.obolibrary.org/obo/OBI_0000094> ;
sh:order 1 ;
sh:path cmdr:participations ],
[ sh:class cmdr:Subject ;
sh:nodeKind sh:IRI ;
sh:order 2 ;
sh:path <https://example.org/TEMP/material_processings> ],
[ sh:class <https://example.org/TEMP/Participation> ;
sh:order 5 ;
sh:path cmdr:subjects ],
[ sh:class <OBI:0000094> ;
sh:nodeKind sh:IRI ;
sh:order 1 ;
sh:path <https://example.org/TEMP/participations> ],
[ sh:class <http://purl.obolibrary.org/obo/OBI_0000659> ;
sh:order 2 ;
sh:path cmdr:material_processings ],
[ sh:class <OBI:0000659> ;
sh:nodeKind sh:IRI ;
sh:order 3 ;
sh:path <https://example.org/TEMP/specimen_collection_processes> ] ;
sh:targetClass <https://example.org/TEMP/Container> .
sh:path cmdr:specimen_collection_processes ] ;
sh:targetClass cmdr:Container .

<https://example.org/TEMP/DataObject> a sh:NodeShape ;
cmdr:DataObject a sh:NodeShape ;
sh:closed true ;
sh:description "A DataFile Associated with a Subject or Investigation or MaterialEntity" ;
sh:ignoredProperties ( rdf:type ) ;
sh:targetClass <https://example.org/TEMP/DataObject> .
sh:targetClass cmdr:DataObject .

<https://example.org/TEMP/Process> a sh:NodeShape ;
cmdr:Process a sh:NodeShape ;
sh:closed false ;
sh:description "A planned process resulting in a material or data" ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:order 3 ;
sh:path <https://example.org/TEMP/has_output> ],
sh:path cmdr:has_output ],
[ sh:order 2 ;
sh:path <https://example.org/TEMP/has_input> ],
sh:path cmdr:has_input ],
[ sh:maxCount 1 ;
sh:order 0 ;
sh:path <https://example.org/TEMP/id> ],
sh:path cmdr:id ],
[ sh:maxCount 1 ;
sh:order 1 ;
sh:path <https://example.org/TEMP/name> ] ;
sh:targetClass <https://example.org/TEMP/Process> .
sh:path cmdr:name ] ;
sh:targetClass cmdr:Process .

<http://purl.obolibrary.org/obo/OBI_0000094> a sh:NodeShape ;
<OBI:0000094> a sh:NodeShape ;
sh:closed true ;
sh:description "A planned process which results in physical changes in a specified input material" ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:maxCount 1 ;
sh:order 3 ;
sh:path <https://example.org/TEMP/name> ],
[ sh:class <https://example.org/TEMP/MaterialEntity> ;
sh:property [ sh:class cmdr:MaterialEntity ;
sh:nodeKind sh:IRI ;
sh:order 0 ;
sh:path <https://example.org/TEMP/has_input> ],
[ sh:class <https://example.org/TEMP/MaterialEntity> ;
sh:path cmdr:has_input ],
[ sh:class cmdr:MaterialEntity ;
sh:nodeKind sh:IRI ;
sh:order 1 ;
sh:path <https://example.org/TEMP/has_output> ],
sh:path cmdr:has_output ],
[ sh:maxCount 1 ;
sh:order 2 ;
sh:path <https://example.org/TEMP/id> ] ;
sh:targetClass <http://purl.obolibrary.org/obo/OBI_0000094> .
sh:path cmdr:id ],
[ sh:maxCount 1 ;
sh:order 3 ;
sh:path cmdr:name ] ;
sh:targetClass <OBI:0000094> .

<http://purl.obolibrary.org/obo/OBI_0000659> a sh:NodeShape ;
<OBI:0000659> a sh:NodeShape ;
sh:closed true ;
sh:description "A planned process with the objective of collecting a specimen" ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:class <https://example.org/TEMP/Subject> ;
sh:property [ sh:class cmdr:MaterialEntity ;
sh:nodeKind sh:IRI ;
sh:order 1 ;
sh:path cmdr:has_output ],
[ sh:class cmdr:Subject ;
sh:nodeKind sh:IRI ;
sh:order 0 ;
sh:path <https://example.org/TEMP/has_input> ],
[ sh:maxCount 1 ;
sh:order 3 ;
sh:path <https://example.org/TEMP/name> ],
sh:path cmdr:has_input ],
[ sh:maxCount 1 ;
sh:order 2 ;
sh:path <https://example.org/TEMP/id> ],
[ sh:class <https://example.org/TEMP/MaterialEntity> ;
sh:nodeKind sh:IRI ;
sh:order 1 ;
sh:path <https://example.org/TEMP/has_output> ] ;
sh:targetClass <http://purl.obolibrary.org/obo/OBI_0000659> .
sh:path cmdr:id ],
[ sh:maxCount 1 ;
sh:order 3 ;
sh:path cmdr:name ] ;
sh:targetClass <OBI:0000659> .

<https://example.org/TEMP/Participation> a sh:NodeShape ;
cmdr:Participation a sh:NodeShape ;
sh:closed true ;
sh:description "Subject/Study participation information" ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:maxCount 1 ;
sh:order 1 ;
sh:path cmdr:name ],
[ sh:maxCount 1 ;
sh:order 0 ;
sh:path <https://example.org/TEMP/id> ],
[ sh:class <https://example.org/TEMP/Subject> ;
sh:path cmdr:id ],
[ sh:class cmdr:Subject ;
sh:maxCount 1 ;
sh:nodeKind sh:IRI ;
sh:order 3 ;
sh:path <https://example.org/TEMP/includes> ],
[ sh:class <https://example.org/TEMP/Investigation> ;
sh:path cmdr:includes ],
[ sh:class cmdr:Investigation ;
sh:nodeKind sh:IRI ;
sh:order 2 ;
sh:path <https://example.org/TEMP/involved_in> ],
[ sh:maxCount 1 ;
sh:order 1 ;
sh:path <https://example.org/TEMP/name> ] ;
sh:targetClass <https://example.org/TEMP/Participation> .
sh:path cmdr:involved_in ] ;
sh:targetClass cmdr:Participation .

<https://example.org/TEMP/Quantity> a sh:NodeShape ;
cmdr:Quantity a sh:NodeShape ;
sh:closed true ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:maxCount 1 ;
sh:order 1 ;
sh:path <https://example.org/TEMP/has_numeric_value> ],
sh:order 0 ;
sh:path cmdr:has_raw_value ],
[ sh:maxCount 1 ;
sh:order 3 ;
sh:path <https://example.org/TEMP/comparator> ],
sh:order 1 ;
sh:path cmdr:has_numeric_value ],
[ sh:maxCount 1 ;
sh:order 2 ;
sh:path <https://example.org/TEMP/has_unit> ],
sh:path cmdr:has_unit ],
[ sh:maxCount 1 ;
sh:order 0 ;
sh:path <https://example.org/TEMP/has_raw_value> ] ;
sh:targetClass <https://example.org/TEMP/Quantity> .
sh:order 3 ;
sh:path cmdr:comparator ] ;
sh:targetClass cmdr:Quantity .

<https://example.org/TEMP/Investigation> a sh:NodeShape ;
cmdr:Investigation a sh:NodeShape ;
sh:closed true ;
sh:description "General information about the Investigation" ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:maxCount 1 ;
sh:order 0 ;
sh:path <https://example.org/TEMP/id> ],
[ sh:maxCount 1 ;
sh:order 1 ;
sh:path <https://example.org/TEMP/name> ],
[ sh:class <https://example.org/TEMP/Investigation> ;
sh:path cmdr:id ],
[ sh:class cmdr:Investigation ;
sh:maxCount 1 ;
sh:nodeKind sh:IRI ;
sh:order 2 ;
sh:path <https://example.org/TEMP/part_of> ] ;
sh:targetClass <https://example.org/TEMP/Investigation> .
sh:path cmdr:part_of ],
[ sh:maxCount 1 ;
sh:order 1 ;
sh:path cmdr:name ] ;
sh:targetClass cmdr:Investigation .

<https://example.org/TEMP/MaterialEntity> a sh:NodeShape ;
cmdr:MaterialEntity a sh:NodeShape ;
sh:closed true ;
sh:description "Physical entity that is an input our output of a process from a Subject" ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:class <https://example.org/TEMP/Investigation> ;
sh:nodeKind sh:IRI ;
sh:order 2 ;
sh:path <https://example.org/TEMP/used_in> ],
[ sh:class <https://example.org/TEMP/Quantity> ;
sh:property [ sh:maxCount 1 ;
sh:order 1 ;
sh:path cmdr:name ],
[ sh:class cmdr:Subject ;
sh:maxCount 1 ;
sh:nodeKind sh:BlankNode ;
sh:order 5 ;
sh:path <https://example.org/TEMP/concentration> ],
[ sh:class <https://example.org/TEMP/Quantity> ;
sh:nodeKind sh:IRI ;
sh:order 3 ;
sh:path cmdr:source ],
[ sh:class cmdr:Quantity ;
sh:maxCount 1 ;
sh:nodeKind sh:BlankNode ;
sh:order 4 ;
sh:path <https://example.org/TEMP/volume> ],
[ sh:maxCount 1 ;
sh:order 1 ;
sh:path <https://example.org/TEMP/name> ],
sh:path cmdr:volume ],
[ sh:maxCount 1 ;
sh:order 0 ;
sh:path <https://example.org/TEMP/id> ],
[ sh:class <https://example.org/TEMP/Subject> ;
sh:maxCount 1 ;
sh:path cmdr:id ],
[ sh:class cmdr:Investigation ;
sh:nodeKind sh:IRI ;
sh:order 3 ;
sh:path <https://example.org/TEMP/source> ] ;
sh:targetClass <https://example.org/TEMP/MaterialEntity> .
sh:order 2 ;
sh:path cmdr:used_in ],
[ sh:class cmdr:Quantity ;
sh:maxCount 1 ;
sh:nodeKind sh:BlankNode ;
sh:order 5 ;
sh:path cmdr:concentration ] ;
sh:targetClass cmdr:MaterialEntity .

<https://example.org/TEMP/Subject> a sh:NodeShape ;
cmdr:Subject a sh:NodeShape ;
sh:closed true ;
sh:description "Demographic and clinical information about the subject" ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:maxCount 1 ;
sh:order 0 ;
sh:path <https://example.org/TEMP/id> ],
[ sh:maxCount 1 ;
sh:order 1 ;
sh:path <https://example.org/TEMP/name> ] ;
sh:targetClass <https://example.org/TEMP/Subject> .
sh:path cmdr:name ],
[ sh:maxCount 1 ;
sh:order 0 ;
sh:path cmdr:id ] ;
sh:targetClass cmdr:Subject .

120 changes: 63 additions & 57 deletions project/shex/cmdr.shex
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ BASE <https://w3id.org/linkml/cmdr/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX linkml: <https://w3id.org/linkml/>
PREFIX TEMP: <https://example.org/TEMP/>
PREFIX OBI: <http://example.org/UNKNOWN/OBI/>


linkml:String xsd:string
@@ -17,7 +17,7 @@ linkml:Double xsd:double

linkml:Decimal xsd:decimal

linkml:Time xsd:dateTime
linkml:Time xsd:time

linkml:Date xsd:date

@@ -37,98 +37,104 @@ linkml:Objectidentifier IRI

linkml:Nodeidentifier NONLITERAL

TEMP:Container CLOSED {
( $TEMP:Container_tes ( TEMP:materials @TEMP:MaterialEntity * ;
TEMP:participations @TEMP:Participation * ;
TEMP:material_processings @TEMP:MaterialProcessing * ;
TEMP:specimen_collection_processes @TEMP:SpecimenCollectionProcess * ;
TEMP:investigations @TEMP:Investigation * ;
TEMP:subjects @TEMP:Subject *
linkml:Jsonpointer xsd:string

linkml:Jsonpath xsd:string

linkml:Sparqlpath xsd:string

<Container> CLOSED {
( $<Container_tes> ( <materials> @<MaterialEntity> * ;
<participations> @<Participation> * ;
<material_processings> @<MaterialProcessing> * ;
<specimen_collection_processes> @<SpecimenCollectionProcess> * ;
<investigations> @<Investigation> * ;
<subjects> @<Subject> *
) ;
rdf:type [ TEMP:Container ] ?
rdf:type [ <Container> ] ?
)
}

TEMP:DataObject CLOSED {
( $TEMP:DataObject_tes rdf:type . * ;
rdf:type [ TEMP:DataObject ] ?
<DataObject> CLOSED {
( $<DataObject_tes> rdf:type . * ;
rdf:type [ <DataObject> ] ?
)
}

TEMP:Investigation CLOSED {
( $TEMP:Investigation_tes ( TEMP:name @linkml:String ? ;
TEMP:part_of @TEMP:Investigation ?
<Investigation> CLOSED {
( $<Investigation_tes> ( <name> @linkml:String ? ;
<part_of> @<Investigation> ?
) ;
rdf:type [ TEMP:Investigation ]
rdf:type [ <Investigation> ]
)
}

TEMP:MaterialEntity CLOSED {
( $TEMP:MaterialEntity_tes ( TEMP:name @linkml:String ? ;
TEMP:used_in @TEMP:Investigation * ;
TEMP:source @TEMP:Subject ? ;
TEMP:volume @TEMP:Quantity ? ;
TEMP:concentration @TEMP:Quantity ?
<MaterialEntity> CLOSED {
( $<MaterialEntity_tes> ( <name> @linkml:String ? ;
<used_in> @<Investigation> * ;
<source> @<Subject> ? ;
<volume> @<Quantity> ? ;
<concentration> @<Quantity> ?
) ;
rdf:type [ TEMP:MaterialEntity ]
rdf:type [ <MaterialEntity> ]
)
}

TEMP:MaterialProcessing CLOSED {
( $TEMP:MaterialProcessing_tes ( &TEMP:Process_tes ;
rdf:type [ TEMP:Process ] ? ;
TEMP:has_input @TEMP:MaterialEntity * ;
TEMP:has_output @TEMP:MaterialEntity *
<MaterialProcessing> CLOSED {
( $<MaterialProcessing_tes> ( &<Process_tes> ;
rdf:type [ <Process> ] ? ;
<has_input> @<MaterialEntity> * ;
<has_output> @<MaterialEntity> *
) ;
rdf:type [ <http://purl.obolibrary.org/obo/OBI_0000094> ]
rdf:type [ OBI:0000094 ]
)
}

TEMP:Participation CLOSED {
( $TEMP:Participation_tes ( TEMP:name @linkml:String ? ;
TEMP:involved_in @TEMP:Investigation * ;
TEMP:includes @TEMP:Subject ?
<Participation> CLOSED {
( $<Participation_tes> ( <name> @linkml:String ? ;
<involved_in> @<Investigation> * ;
<includes> @<Subject> ?
) ;
rdf:type [ TEMP:Participation ]
rdf:type [ <Participation> ]
)
}

TEMP:Process (
@TEMP:MaterialProcessing OR @TEMP:SpecimenCollectionProcess
<Process> (
@<MaterialProcessing> OR @<SpecimenCollectionProcess>
)

TEMP:Process_struct {
( $TEMP:Process_tes ( TEMP:name @linkml:String ? ;
TEMP:has_input @linkml:String * ;
TEMP:has_output @linkml:String *
<Process_struct> {
( $<Process_tes> ( <name> @linkml:String ? ;
<has_input> @linkml:String * ;
<has_output> @linkml:String *
) ;
rdf:type [ TEMP:Process ]
rdf:type [ <Process> ]
)
}

TEMP:Quantity CLOSED {
( $TEMP:Quantity_tes ( TEMP:has_raw_value @linkml:String ? ;
TEMP:has_numeric_value @linkml:Float ? ;
TEMP:has_unit @linkml:String ? ;
TEMP:comparator @linkml:String ?
<Quantity> CLOSED {
( $<Quantity_tes> ( <has_raw_value> @linkml:String ? ;
<has_numeric_value> @linkml:Float ? ;
<has_unit> @linkml:String ? ;
<comparator> @linkml:String ?
) ;
rdf:type [ TEMP:Quantity ] ?
rdf:type [ <Quantity> ] ?
)
}

TEMP:SpecimenCollectionProcess CLOSED {
( $TEMP:SpecimenCollectionProcess_tes ( &TEMP:Process_tes ;
rdf:type [ TEMP:Process ] ? ;
TEMP:has_input @linkml:String ? ;
TEMP:has_output @linkml:String ?
<SpecimenCollectionProcess> CLOSED {
( $<SpecimenCollectionProcess_tes> ( &<Process_tes> ;
rdf:type [ <Process> ] ? ;
<has_input> @linkml:String ? ;
<has_output> @linkml:String ?
) ;
rdf:type [ <http://purl.obolibrary.org/obo/OBI_0000659> ]
rdf:type [ OBI:0000659 ]
)
}

TEMP:Subject CLOSED {
( $TEMP:Subject_tes TEMP:name @linkml:String ? ;
rdf:type [ TEMP:Subject ]
<Subject> CLOSED {
( $<Subject_tes> <name> @linkml:String ? ;
rdf:type [ <Subject> ]
)
}

69 changes: 0 additions & 69 deletions project/sqlschema/cmdr.sql

This file was deleted.

138 changes: 68 additions & 70 deletions src/cmdr/datamodel/cmdr.py

Large diffs are not rendered by default.

105 changes: 52 additions & 53 deletions src/cmdr/schema/cmdr.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
---
id: https://w3id.org/linkml/cmdr
name: cmdr
title: cmdr
@@ -56,51 +55,51 @@ classes:
multivalued: true
range: Subject
slots:
- materials
- participations
- material_processings
- specimen_collection_processes
- investigations
- subjects
- materials
- participations
- material_processings
- specimen_collection_processes
- investigations
- subjects
tree_root: true
DataObject:
aliases:
- File
- Data
- DataFile
- File
- Data
- DataFile
description: A DataFile Associated with a Subject or Investigation or MaterialEntity
from_schema: TEMP
see_also:
- include:DataFile
- include:DataFile
Investigation:
aliases:
- Study
- Proposal
- Study
- Proposal
description: General information about the Investigation
from_schema: TEMP
see_also:
- include:Study
- include:Study
slot_usage:
id:
identifier: true
range: uriorcurie
part_of:
range: Investigation
slots:
- id
- name
- part_of
- id
- name
- part_of
MaterialEntity:
aliases:
- Substance
- Specimen
- Sample
- Biospecimen
- Biosample
- Substance
- Specimen
- Sample
- Biospecimen
- Biosample
description: Physical entity that is an input our output of a process from a Subject
from_schema: TEMP
see_also:
- include:Biospecimen
- include:Biospecimen
slot_usage:
concentration:
range: Quantity
@@ -109,20 +108,20 @@ classes:
range: uriorcurie
source:
comments:
- this is a shortcut. to be expanded later.
- this is a shortcut. to be expanded later.
range: Subject
used_in:
multivalued: true
range: Investigation
volume:
range: Quantity
slots:
- id
- name
- used_in
- source
- volume
- concentration
- id
- name
- used_in
- source
- volume
- concentration
MaterialProcessing:
class_uri: OBI:0000094
description: A planned process which results in physical changes in a specified
@@ -137,13 +136,13 @@ classes:
multivalued: true
range: MaterialEntity
slots:
- has_input
- has_output
- has_input
- has_output
Participation:
description: Subject/Study participation information
from_schema: TEMP
see_also:
- include:Participant
- include:Participant
slot_usage:
id:
identifier: true
@@ -154,10 +153,10 @@ classes:
multivalued: true
range: Investigation
slots:
- id
- name
- involved_in
- includes
- id
- name
- involved_in
- includes
Process:
abstract: true
description: A planned process resulting in a material or data
@@ -171,10 +170,10 @@ classes:
identifier: true
range: uriorcurie
slots:
- id
- name
- has_input
- has_output
- id
- name
- has_input
- has_output
Quantity:
from_schema: TEMP
slot_usage:
@@ -187,13 +186,13 @@ classes:
has_unit:
range: string
slots:
- has_raw_value
- has_numeric_value
- has_unit
- comparator
- has_raw_value
- has_numeric_value
- has_unit
- comparator
SpecimenCollectionProcess:
aliases:
- MaterialCollectionProcess
- MaterialCollectionProcess
class_uri: OBI:0000659
description: A planned process with the objective of collecting a specimen
from_schema: TEMP
@@ -206,23 +205,23 @@ classes:
multivalued: true
range: MaterialEntity
slots:
- has_input
- has_output
- has_input
- has_output
Subject:
aliases:
- Site
- Participant
- Site
- Participant
description: Demographic and clinical information about the subject
from_schema: TEMP
see_also:
- include:Participant
- include:Participant
slot_usage:
id:
identifier: true
range: uriorcurie
slots:
- id
- name
- id
- name
slots:
comparator:
from_schema: TEMP
19 changes: 10 additions & 9 deletions src/data/examples/Container-material-entities.yaml
Original file line number Diff line number Diff line change
@@ -37,12 +37,13 @@ subjects:
name: "subject one"
- id: "omicsrus:su2"
name: "subject two"
#processes:
# - id: "omicsrus:mp1"
# name: "Material Processing 1"
# has_input: "omicsrus:m1"
# has_output: "omicsrus:m1"
# - id: "omicsrus:scp1"
# name: "Specimen Collection Process 1"
# has_input: "omicsrus:su1"
# has_output: "omicsrus:m3"
material_processings:
- id: "omicsrus:mp1"
name: "Material Processing 1"
has_input: "omicsrus:m1"
has_output: "omicsrus:m1"
specimen_collection_processes:
- id: "omicsrus:scp1"
name: "Specimen Collection Process 1"
has_input: "omicsrus:su1"
has_output: "omicsrus:m3"

0 comments on commit 9cf7ac2

Please sign in to comment.