microbiomedata / nmdc-schema

National Microbiome Data Collaborative (NMDC) unified data model
https://microbiomedata.github.io/nmdc-schema/
Creative Commons Zero v1.0 Universal
26 stars 8 forks source link

create nmdc.owl.ttl with no errors reported by Protege #1467

Open turbomam opened 7 months ago

turbomam commented 7 months ago

for materializing with relation-graph

turbomam commented 7 months ago

start by commenting out all attributes of Biosample except for is_a: MaterialEntity

turbomam commented 7 months ago
 gen-owl src/schema/nmdc.yaml > nmdc_minimal.owl.ttl
turbomam commented 7 months ago
gen-owl --help

Only two errors, about OmicsProcessing

image

image

turbomam commented 7 months ago

comment out all attributes of OmicsProcessing except is_a: PlannedProcess

still two similar errors

turbomam commented 7 months ago
INFO:root:Importing annotation as annotation from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Importing basic_slots as basic_slots from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Importing core as core from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Importing external_identifiers as external_identifiers from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Importing linkml:annotations as /home/mark/.cache/pypoetry/virtualenvs/nmdc-schema-_1824IzR-py3.9/lib/python3.9/site-packages/linkml_runtime/linkml_model/model/schema/annotations from source None; base_dir=None
INFO:root:Importing linkml:extensions as /home/mark/.cache/pypoetry/virtualenvs/nmdc-schema-_1824IzR-py3.9/lib/python3.9/site-packages/linkml_runtime/linkml_model/model/schema/extensions from source None; base_dir=None
INFO:root:Importing linkml:mappings as /home/mark/.cache/pypoetry/virtualenvs/nmdc-schema-_1824IzR-py3.9/lib/python3.9/site-packages/linkml_runtime/linkml_model/model/schema/mappings from source None; base_dir=None
INFO:root:Importing linkml:types as /home/mark/.cache/pypoetry/virtualenvs/nmdc-schema-_1824IzR-py3.9/lib/python3.9/site-packages/linkml_runtime/linkml_model/model/schema/types from source None; base_dir=None
INFO:root:Importing linkml:types as /home/mark/.cache/pypoetry/virtualenvs/nmdc-schema-_1824IzR-py3.9/lib/python3.9/site-packages/linkml_runtime/linkml_model/model/schema/types from source src/schema/nmdc.yaml; base_dir=None
INFO:root:Importing linkml:units as /home/mark/.cache/pypoetry/virtualenvs/nmdc-schema-_1824IzR-py3.9/lib/python3.9/site-packages/linkml_runtime/linkml_model/model/schema/units from source None; base_dir=None
INFO:root:Importing mixs as mixs from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Importing portal/emsl as portal/emsl from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Importing portal/jgi_metagenomics as portal/jgi_metagenomics from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Importing portal/jgi_metatranscriptomics as portal/jgi_metatranscriptomics from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Importing portal/mixs_inspired as portal/mixs_inspired from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Importing portal/sample_id as portal/sample_id from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Importing prov as prov from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Importing sample_prep as sample_prep from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Importing workflow_execution_activity as workflow_execution_activity from source src/schema/nmdc.yaml; base_dir=src/schema
INFO:root:Using SchemaView with im=None
WARNING:root:Ambiguous type for: type
WARNING:root:from_schema not populated for element ... x45
WARNING:root:ignoring equals_string=award_doi as unable to tell if literal
WARNING:root:ignoring equals_string=dataset_doi as unable to tell if literal
WARNING:root:Multiple owl types {rdflib.term.URIRef('http://www.w3.org/2002/07/owl#Thing'), rdflib.term.URIRef('http://www.w3.org/2000/01/rdf-schema#Literal')}
WARNING:root:Null expr in: [None, None] for http://www.w3.org/2002/07/owl#unionOf None
WARNING:root:Null expr in: [None] for http://www.w3.org/2002/07/owl#intersectionOf None
turbomam commented 7 months ago

comment out all of OmicsProcessing

comment out definition of omics_processing_set and association with Database

no errors

turbomam commented 7 months ago

start adding Biosample attributes back in

this

    unique_keys:
      samp_name_unique_key:
        notes:
          - "id is already required to be unique because it is the identifier in Biosample's parent class, NamedThing. Remember, notes like this could be exposed to end users. CJM suggested YAML # comment"
        unique_key_slots:
          - samp_name

causes this

   WARN  11:01:42  Property https://w3id.org/mixs/samp_name has been punned illegally: found declaration as OWLObjectProperty
   WARN  11:01:42  Property https://w3id.org/mixs/samp_name has been punned illegally: found declaration as OWLDataProperty  
turbomam commented 7 months ago

it appears that slot_usages that change a range or add examples cause the owl generation errors

turbomam commented 7 months ago

or when a slot usage has an object range but also asserts a (string) pattern

turbomam commented 7 months ago

actually it seems like there is very litter that is safe in a slot_usage for OWL generation

turbomam commented 7 months ago

but there are so many slot_usages in other classes that don't seem to bother the OWL generator