Skip to content

Commit

Permalink
Merge pull request #3 from anak-velazquez/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
anak-velazquez authored Aug 5, 2024
2 parents 05c0f6a + 5f22976 commit ecd3a85
Show file tree
Hide file tree
Showing 18 changed files with 1,199 additions and 358 deletions.
38 changes: 38 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,44 @@ See also uris-and-mappings: https://linkml.io/linkml/schemas/models.html
* Chemical Entities Mixtures and Reactions Ontological Framework
* NeXus definitions?? -

# Conventions
ATM following the same conventions a Biolink. In Biolink Model YAML any class, slot, or type is defined in `sentence case` form. When this model is compiled to various forms (like JSON-Schema, OWL, Markdown) the representation is based on the following convention:

- classes are named in `CamelCase` form
- slots are named in `snake_case` form
- types are named in `snake_case` form

At a glance the structure is as follows,
- Classes

- Entities
- Associations
- Mixins
- Slots
- Predicates
- Node Properties
- Edge Properties
- Types

A `class` represents an entity or an association. A class can have one more `slots` (properties). Within the Biolink Model there are two hierarchies of classes: `Named Things` and `Associations`; Named Things are disjoint from Associations. They do share a common ancestor class: `entity`.

`Named Things`: classes that represent real world entities such as genes, diseases, chemical substances, etc. In a graph serialization, 'Named Things' are represented by nodes in a graph. Each class in the named thing has one or more slots (properties). The root of the "Named Things" hierarchy is the biolink:NamedThing class.

`Associations`: classes that represent an assertion or statement. In RDF sense, an association is an `rdf:Statement`. In a graph formalism, associations are represented using edges in a graph. In general, Associations have three main properties (or slots): subject: the subject of the association; predicate: the predicate or relationship between the subject and the object of the association; object: the object of the association These three properties (or slots) define what Biolink calls a "core triple".

A `slot` is similar to `rdf:Property` where it can link: i) an instance of a class to another instance of a class; ii) an instance of a class to a literal/data type. slot_usage slot can be used to specify how a particular slot ought to be used in a class.

The `mixin:true` setting is used to extend the properties (or slots) of a class, without changing its position in the class hierarchy. Mixins can be extremely helpful in a number of ways: 1) to generalize a set of attributes that can apply to classes in different parts of the class hierarchy, 2) reduce duplication of shared attributes between classes that do not inherit from one another.

The `aliases` slot can be used to define a list of aliases for a Model class (or slot). This is useful for adding synonymous names to your class (or slot).


The `slot_uri` slot can be used to define a canonical URI that is the true representation for that particular slot. That is, the value of slot_uri can be used interchangeably with the slot being defined.

`id_prefixes` slot can be used to define a list of valid ID prefixes that instances of this class ought to have as part of their CURIE. The order of the list matters since its a prioritized list with the ID prefix with the highest priority appearing at the top of the list.

Please check more details here: https://github.com/biolink/biolink-model/blob/master/src/docs/understanding-the-model.md

## Website

[https://anak-velazquez.github.io/hzb-metadata-schema](https://anak-velazquez.github.io/hzb-metadata-schema)
Expand Down
Binary file modified project/excel/hzb_metadata_schema.xlsx
Binary file not shown.
31 changes: 25 additions & 6 deletions project/graphql/hzb_metadata_schema.graphql
Original file line number Diff line number Diff line change
@@ -1,16 +1,35 @@
# metamodel_version: 1.7.0
type CatalysisSample
{
category: String!
primaryEmail: String
birthDate: Date
ageInYears: Integer
vitalStatus: PersonStatus
sampleEnvironment: String
}

interface ChemicalOrDrugOrTreatment
{
}

type Device
{
category: String!
}

interface Entity
{
}

type NamedThing
{
id: Uriorcurie!
name: String
description: String
category: String!
}

type Sample
{
id: Uriorcurie!
name: String
description: String
category: String!
primaryEmail: String
birthDate: Date
ageInYears: Integer
Expand Down
31 changes: 29 additions & 2 deletions project/jsonld/hzb_metadata_schema.context.jsonld
Original file line number Diff line number Diff line change
@@ -1,15 +1,24 @@
{
"comments": {
"description": "Auto generated by LinkML jsonld context generator",
"generation_date": "2024-07-23T13:57:41",
"generation_date": "2024-08-05T15:01:14",
"source": "hzb_metadata_schema.yaml"
},
"@context": {
"BFO": "http://example.org/UNKNOWN/BFO/",
"CHEBI": "http://example.org/UNKNOWN/CHEBI/",
"CHEMBL.COMPOUND": "http://example.org/UNKNOWN/CHEMBL.COMPOUND/",
"MAXO": "http://example.org/UNKNOWN/MAXO/",
"PATO": {
"@id": "http://purl.obolibrary.org/obo/PATO_",
"@prefix": true
},
"PUBCHEM.COMPOUND": "http://example.org/UNKNOWN/PUBCHEM.COMPOUND/",
"STY": "http://example.org/UNKNOWN/STY/",
"UMLSSG": "http://example.org/UNKNOWN/UMLSSG/",
"WIKIDATA": "http://example.org/UNKNOWN/WIKIDATA/",
"biolink": "https://w3id.org/biolink/",
"dcid": "http://example.org/UNKNOWN/dcid/",
"example": "https://example.org/",
"hzb_metadata_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema/",
"linkml": "https://w3id.org/linkml/",
Expand All @@ -24,6 +33,12 @@
"@type": "xsd:date",
"@id": "schema:birthDate"
},
"sample_environment": {
"@id": "sample_environment"
},
"category": {
"@id": "category"
},
"description": {
"@id": "schema:description"
},
Expand All @@ -47,8 +62,20 @@
},
"@id": "vital_status"
},
"CatalysisSample": {
"@id": "CatalysisSample"
},
"ChemicalOrDrugOrTreatment": {
"@id": "ChemicalOrDrugOrTreatment"
},
"Device": {
"@id": "Device"
},
"Entity": {
"@id": "Entity"
},
"NamedThing": {
"@id": "schema:Thing"
"@id": "NamedThing"
},
"Sample": {
"@id": "Sample"
Expand Down
165 changes: 136 additions & 29 deletions project/jsonld/hzb_metadata_schema.jsonld
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,18 @@
"default_prefix": "hzb_metadata_schema",
"default_range": "string",
"types": [
{
"name": "chemical_formula_value",
"definition_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/ChemicalFormulaValue",
"description": "A chemical formula",
"notes": [
"Should be implemented as a stronger type"
],
"from_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema",
"base": "str",
"uri": "http://www.w3.org/2001/XMLSchema#string",
"@type": "TypeDefinition"
},
{
"name": "string",
"definition_uri": "https://w3id.org/linkml/String",
Expand Down Expand Up @@ -385,10 +397,6 @@
],
"slot_uri": "http://schema.org/identifier",
"identifier": true,
"owner": "NamedThing",
"domain_of": [
"NamedThing"
],
"range": "uriorcurie",
"required": true,
"@type": "SlotDefinition"
Expand All @@ -402,10 +410,6 @@
"http://schema.org/name"
],
"slot_uri": "http://schema.org/name",
"owner": "NamedThing",
"domain_of": [
"NamedThing"
],
"range": "string",
"@type": "SlotDefinition"
},
Expand All @@ -418,10 +422,6 @@
"http://schema.org/description"
],
"slot_uri": "http://schema.org/description",
"owner": "NamedThing",
"domain_of": [
"NamedThing"
],
"range": "string",
"@type": "SlotDefinition"
},
Expand Down Expand Up @@ -483,6 +483,18 @@
"range": "PersonStatus",
"@type": "SlotDefinition"
},
{
"name": "catalysisSample__sample_environment",
"from_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema",
"slot_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/sample_environment",
"alias": "sample_environment",
"owner": "CatalysisSample",
"domain_of": [
"CatalysisSample"
],
"range": "string",
"@type": "SlotDefinition"
},
{
"name": "sampleCollection__entries",
"from_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema",
Expand All @@ -498,7 +510,15 @@
"@type": "SlotDefinition"
},
{
"name": "Sample_primary_email",
"name": "category",
"from_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema",
"slot_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/category",
"range": "string",
"required": true,
"@type": "SlotDefinition"
},
{
"name": "sample_primary_email",
"definition_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/primary_email",
"description": "The main email address of a person",
"from_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema",
Expand All @@ -518,24 +538,83 @@
"range": "string",
"pattern": "^\\S+@[\\S+\\.]+\\S+",
"@type": "SlotDefinition"
},
{
"name": "namedThing_category",
"from_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema",
"is_a": "category",
"domain": "NamedThing",
"slot_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/category",
"alias": "category",
"owner": "NamedThing",
"domain_of": [
"NamedThing"
],
"is_usage_slot": true,
"usage_slot_name": "category",
"range": "string",
"required": true,
"@type": "SlotDefinition"
}
],
"classes": [
{
"name": "NamedThing",
"definition_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/NamedThing",
"description": "A generic grouping for any identifiable entity",
"name": "ChemicalOrDrugOrTreatment",
"id_prefixes": [
"PUBCHEM.COMPOUND",
"CHEMBL.COMPOUND",
"CHEBI",
"MAXO"
],
"definition_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/ChemicalOrDrugOrTreatment",
"from_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema",
"mappings": [
"schema:Thing"
"mixin": true,
"slot_usage": {},
"class_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/ChemicalOrDrugOrTreatment",
"@type": "ClassDefinition"
},
{
"name": "Device",
"definition_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/Device",
"description": "A thing made or adapted for a particular purpose, especially a piece of mechanical or electronic equipment",
"from_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema",
"narrow_mappings": [
"UMLSSG:DEVI",
"STY:T074",
"STY:T075",
"STY:T203",
"STY:T122"
],
"is_a": "NamedThing",
"slots": [
"namedThing_category"
],
"slot_usage": {},
"class_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/Device",
"@type": "ClassDefinition"
},
{
"name": "CatalysisSample",
"definition_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/CatalysisSample",
"description": "core parameters of a catalysis sample #metadata terms (parameters) are mapped to nfdi voc4cat",
"from_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema",
"is_a": "Sample",
"slots": [
"id",
"name",
"description"
"namedThing_category",
"sample_primary_email",
"birth_date",
"age_in_years",
"vital_status",
"catalysisSample__sample_environment"
],
"slot_usage": {},
"class_uri": "http://schema.org/Thing",
"attributes": [
{
"name": "sample_environment",
"@type": "SlotDefinition"
}
],
"class_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/CatalysisSample",
"@type": "ClassDefinition"
},
{
Expand All @@ -545,10 +624,8 @@
"from_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema",
"is_a": "NamedThing",
"slots": [
"id",
"name",
"description",
"Sample_primary_email",
"namedThing_category",
"sample_primary_email",
"birth_date",
"age_in_years",
"vital_status"
Expand Down Expand Up @@ -578,13 +655,43 @@
"class_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/SampleCollection",
"tree_root": true,
"@type": "ClassDefinition"
},
{
"name": "Entity",
"definition_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/Entity",
"description": "Root Biolink Model class for all things and informational relationships, real or imagined.",
"from_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema",
"abstract": true,
"slot_usage": {},
"class_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/Entity",
"@type": "ClassDefinition"
},
{
"name": "NamedThing",
"definition_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/NamedThing",
"description": "a databased entity or concept/class",
"from_schema": "https://w3id.org/anak-velazquez/hzb-metadata-schema",
"exact_mappings": [
"BFO:0000001",
"WIKIDATA:Q35120",
"UMLSSG:OBJC",
"STY:T071",
"dcid:Thing"
],
"is_a": "Entity",
"slots": [
"namedThing_category"
],
"slot_usage": {},
"class_uri": "https://w3id.org/anak-velazquez/hzb-metadata-schema/NamedThing",
"@type": "ClassDefinition"
}
],
"metamodel_version": "1.7.0",
"source_file": "hzb_metadata_schema.yaml",
"source_file_date": "2024-07-23T13:56:55",
"source_file_size": 2243,
"generation_date": "2024-07-23T13:57:41",
"source_file_date": "2024-08-05T15:01:08",
"source_file_size": 4633,
"generation_date": "2024-08-05T15:01:15",
"@type": "SchemaDefinition",
"@context": [
"project/jsonld/hzb_metadata_schema.context.jsonld",
Expand Down
Loading

0 comments on commit ecd3a85

Please sign in to comment.