Skip to content

Commit

Permalink
Add rdf to prefixes on templates to avoid extra warnings (#339)
Browse files Browse the repository at this point in the history
OWL export produces warnings when rdf prefix isn't defined, so now it's
in the YAML templates.
  • Loading branch information
caufieldjh authored Feb 27, 2024
2 parents 5640686 + 19b3f82 commit ee67f35
Show file tree
Hide file tree
Showing 59 changed files with 312 additions and 236 deletions.
1 change: 1 addition & 0 deletions src/ontogpt/templates/biological_process.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: >-
A template for GO-CAMs
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
CHEBI: http://purl.obolibrary.org/obo/CHEBI_
CL: http://purl.obolibrary.org/obo/CL_
GO: http://purl.obolibrary.org/obo/GO_
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/biotic_interaction.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: >-
A template for biotic interactions
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
MESH: http://identifiers.org/mesh/
NCBITaxon: http://purl.obolibrary.org/obo/NCBITAXON_
RO: http://purl.obolibrary.org/obo/RO_
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/cell_type.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: >-
A template for representing cell types
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
AUTO: http://w3id.org/ontogpt/auto/
BFO: http://purl.obolibrary.org/obo/BFO_
CHEBI: http://purl.obolibrary.org/obo/CHEBI_
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/class_enrichment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: >-
license: https://creativecommons.org/publicdomain/zero/1.0/

prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
OBI: http://purl.obolibrary.org/obo/OBI_
STATO: http://purl.obolibrary.org/obo/STATO_
bpa: https://bioportal.bioontology.org/annotator/
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/composite_disease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: >-
A template for representing composite disease concepts
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
CHEBI: http://purl.obolibrary.org/obo/CHEBI_
HGNC: http://identifiers.org/hgnc/
HP: http://purl.obolibrary.org/obo/HP_
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: core
title: AI core Template
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
NCIT: http://purl.obolibrary.org/obo/NCIT_
RO: http://purl.obolibrary.org/obo/RO_
biolink: https://w3id.org/biolink/vocab/
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/ctd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ see_also:
source: https://biocreative.bioinformatics.udel.edu/tasks/biocreative-v/track-3-cdr/
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
MESH: http://identifiers.org/mesh/
drug: http://w3id.org/ontogpt/drug/
linkml: https://w3id.org/linkml/
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/ctd_ner.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ source: >-
https://biocreative.bioinformatics.udel.edu/tasks/biocreative-v/track-3-cdr/
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
MESH: http://identifiers.org/mesh/
ctdner: http://w3id.org/ontogpt/ctd_ner
linkml: https://w3id.org/linkml/
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/data_sheets_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ see_also:
- https://bridge2ai.github.io/data-sheets-schema

prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
biolink: https://w3id.org/biolink/
csvw: http://www.w3.org/ns/csvw#
data_sheets_schema: https://w3id.org/bridge2ai/data-sheets-schema/
Expand Down
24 changes: 13 additions & 11 deletions src/ontogpt/templates/datasheet.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations
from datetime import datetime, date
from enum import Enum

from typing import List, Dict, Optional, Any, Union
from pydantic import BaseModel as BaseModel, ConfigDict, Field, field_validator
import re
Expand All @@ -21,6 +22,7 @@ class ConfiguredBaseModel(BaseModel):
extra = 'forbid',
arbitrary_types_allowed=True,
use_enum_values = True)
pass


class NullDataOptions(str, Enum):
Expand All @@ -46,14 +48,14 @@ class ExtractionResult(ConfiguredBaseModel):
extracted_object: Optional[Any] = Field(None, description="""The complex objects extracted from the text""")
named_entities: Optional[List[Any]] = Field(default_factory=list, description="""Named entities extracted from the text""")



class NamedEntity(ConfiguredBaseModel):

id: str = Field(..., description="""A unique identifier for the named entity""")
label: Optional[str] = Field(None, description="""The label (name) of the named thing""")



class Dataset(NamedEntity):
"""
Expand All @@ -72,20 +74,20 @@ class Dataset(NamedEntity):
id: str = Field(..., description="""A unique identifier for the named entity""")
label: Optional[str] = Field(None, description="""The label (name) of the named thing""")



class Organization(NamedEntity):

id: str = Field(..., description="""A unique identifier for the named entity""")
label: Optional[str] = Field(None, description="""The label (name) of the named thing""")



class CompoundExpression(ConfiguredBaseModel):

None



class Triple(CompoundExpression):
"""
Expand All @@ -98,7 +100,7 @@ class Triple(CompoundExpression):
subject_qualifier: Optional[str] = Field(None, description="""An optional qualifier or modifier for the subject of the statement, e.g. \"high dose\" or \"intravenously administered\"""")
object_qualifier: Optional[str] = Field(None, description="""An optional qualifier or modifier for the object of the statement, e.g. \"severe\" or \"with additional complications\"""")



class TextWithTriples(ConfiguredBaseModel):
"""
Expand All @@ -107,7 +109,7 @@ class TextWithTriples(ConfiguredBaseModel):
publication: Optional[Publication] = Field(None)
triples: Optional[List[Triple]] = Field(default_factory=list)



class TextWithEntity(ConfiguredBaseModel):
"""
Expand All @@ -116,14 +118,14 @@ class TextWithEntity(ConfiguredBaseModel):
publication: Optional[Publication] = Field(None)
entities: Optional[List[str]] = Field(default_factory=list)



class RelationshipType(NamedEntity):

id: str = Field(..., description="""A unique identifier for the named entity""")
label: Optional[str] = Field(None, description="""The label (name) of the named thing""")



class Publication(ConfiguredBaseModel):

Expand All @@ -133,15 +135,15 @@ class Publication(ConfiguredBaseModel):
combined_text: Optional[str] = Field(None)
full_text: Optional[str] = Field(None, description="""The full text of the publication""")



class AnnotatorResult(ConfiguredBaseModel):

subject_text: Optional[str] = Field(None)
object_id: Optional[str] = Field(None)
object_text: Optional[str] = Field(None)




# Model rebuild
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/datasheet.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ description: >-
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
linkml: https://w3id.org/linkml/
d4d: http://w3id.org/ontogpt/datasheet

Expand Down
28 changes: 15 additions & 13 deletions src/ontogpt/templates/desiccation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations
from datetime import datetime, date
from enum import Enum

from typing import List, Dict, Optional, Any, Union
from pydantic import BaseModel as BaseModel, ConfigDict, Field, field_validator
import re
Expand All @@ -21,6 +22,7 @@ class ConfiguredBaseModel(BaseModel):
extra = 'forbid',
arbitrary_types_allowed=True,
use_enum_values = True)
pass


class NullDataOptions(str, Enum):
Expand All @@ -46,14 +48,14 @@ class ExtractionResult(ConfiguredBaseModel):
extracted_object: Optional[Any] = Field(None, description="""The complex objects extracted from the text""")
named_entities: Optional[List[Any]] = Field(default_factory=list, description="""Named entities extracted from the text""")



class NamedEntity(ConfiguredBaseModel):

id: str = Field(..., description="""A unique identifier for the named entity""")
label: Optional[str] = Field(None, description="""The label (name) of the named thing""")



class EntityContainingDocument(NamedEntity):

Expand All @@ -63,34 +65,34 @@ class EntityContainingDocument(NamedEntity):
id: str = Field(..., description="""A unique identifier for the named entity""")
label: Optional[str] = Field(None, description="""The label (name) of the named thing""")



class EnvironmentalCondition(NamedEntity):

id: str = Field(..., description="""A unique identifier for the named entity""")
label: Optional[str] = Field(None, description="""The label (name) of the named thing""")



class Taxon(NamedEntity):

id: str = Field(..., description="""A unique identifier for the named entity""")
label: Optional[str] = Field(None, description="""The label (name) of the named thing""")



class Trait(NamedEntity):

id: str = Field(..., description="""A unique identifier for the named entity""")
label: Optional[str] = Field(None, description="""The label (name) of the named thing""")



class CompoundExpression(ConfiguredBaseModel):

None



class Triple(CompoundExpression):
"""
Expand All @@ -103,7 +105,7 @@ class Triple(CompoundExpression):
subject_qualifier: Optional[str] = Field(None, description="""An optional qualifier or modifier for the subject of the statement, e.g. \"high dose\" or \"intravenously administered\"""")
object_qualifier: Optional[str] = Field(None, description="""An optional qualifier or modifier for the object of the statement, e.g. \"severe\" or \"with additional complications\"""")



class TextWithTriples(ConfiguredBaseModel):
"""
Expand All @@ -112,7 +114,7 @@ class TextWithTriples(ConfiguredBaseModel):
publication: Optional[Publication] = Field(None)
triples: Optional[List[Triple]] = Field(default_factory=list)



class TextWithEntity(ConfiguredBaseModel):
"""
Expand All @@ -121,14 +123,14 @@ class TextWithEntity(ConfiguredBaseModel):
publication: Optional[Publication] = Field(None)
entities: Optional[List[str]] = Field(default_factory=list)



class RelationshipType(NamedEntity):

id: str = Field(..., description="""A unique identifier for the named entity""")
label: Optional[str] = Field(None, description="""The label (name) of the named thing""")



class Publication(ConfiguredBaseModel):

Expand All @@ -138,15 +140,15 @@ class Publication(ConfiguredBaseModel):
combined_text: Optional[str] = Field(None)
full_text: Optional[str] = Field(None, description="""The full text of the publication""")



class AnnotatorResult(ConfiguredBaseModel):

subject_text: Optional[str] = Field(None)
object_id: Optional[str] = Field(None)
object_text: Optional[str] = Field(None)




# Model rebuild
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/desiccation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: >-
A template for extracting ChEBI, GO, NCBITAXON, PO, TO, PECO
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
linkml: https://w3id.org/linkml/
desiccation: http://w3id.org/ontogpt/desiccation

Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/diagnostic_procedure.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: >-
phenotypes they may contribute to.
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
HP: http://purl.obolibrary.org/obo/HP_
LOINC: http://loinc.org/rdf/
OBA: http://purl.obolibrary.org/obo/OBA_
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/dietitian_notes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ description: >-
and Alyson Lawrence, RD, CNSC
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
EFO: http://www.ebi.ac.uk/efo/EFO_
FOODON: http://purl.obolibrary.org/obo/FOODON_
HP: http://purl.obolibrary.org/obo/HP_
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/drug.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: >-
A template for Drugs and drug mechanism
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
HGNC: http://identifiers.org/hgnc/
MESH: http://identifiers.org/mesh/
drug: http://w3id.org/ontogpt/drug/
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/emapa_simple.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: >-
Simple Mouse Developmental Anatomy Ontology Extraction Template
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
EMAPA: http://purl.obolibrary.org/obo/EMAPA_
GO: http://purl.obolibrary.org/obo/GO_
emapa_simple: http://w3id.org/ontogpt/emapa_simple
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/environmental_metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ description: >-
data entries. See https://github.com/EDIorg/EDIorg-repository-index
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
ENVO: http://purl.obolibrary.org/obo/ENVO_
envmd: http://w3id.org/ontogpt/environmental-metadata
linkml: https://w3id.org/linkml/
Expand Down
1 change: 1 addition & 0 deletions src/ontogpt/templates/environmental_sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ description: >-
A template for Environmental Samples
license: https://creativecommons.org/publicdomain/zero/1.0/
prefixes:
rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
ENVO: http://purl.obolibrary.org/obo/ENVO_
PATO: http://purl.obolibrary.org/obo/PATO_
UO: http://purl.obolibrary.org/obo/UO_
Expand Down
Loading

0 comments on commit ee67f35

Please sign in to comment.