HUPO-PSI / psi-tools

Previous https://sourceforge.net/p/psidev/svn/HEAD/tree/psi/tools/ folder
2 stars 2 forks source link

Adding support for expressing structural encoding of CV terms in XML formats #1

Open mobiusklein opened 2 years ago

mobiusklein commented 2 years ago

In PSI-MS, we want to create CV terms that overlap with XML attributes of schemata that use PSI-MS, but to express that in the formats where those attributes are present that the CV term is not allowed to be used. To do that, we've added a new typedef to PSI-MS has_structured_representation_in_format which relates a term to a file format in which it cannot be used. In order to use that information in the semantic validator, the semantic validator needs to be able to view more than just the name, accession, and synonyms of the CV terms.

I'm creating this issue to track progress on my attempt to revise ontology-manager to access this extra information:

mobiusklein commented 2 years ago

It looks like the OLS REST API doesn't expose OBO features like relationship or property-value.

[Term]
id: MS:1000005
name: sample volume
def: "Total volume of solution used." [PSI:MS]
xref: value-type:xsd\:float "The allowed value-type for this CV term."
is_a: MS:1000548 ! sample attribute
relationship: has_units UO:0000098 ! milliliter
relationship: has_value_type xsd\:float ! The allowed value-type for this CV term

https://www.ebi.ac.uk/ols/api/ontologies/ms/terms?iri=http://purl.obolibrary.org/obo/MS_1000005 ->

{'_embedded': {'terms': [{'iri': 'http://purl.obolibrary.org/obo/MS_1000005',
    'lang': 'en',
    'description': ['Total volume of solution used.'],
    'synonyms': [],
    'annotation': {'database_cross_reference': ['value-type:xsd:float'],
     'has_obo_namespace': ['MS'],
     'id': ['MS:1000005']},
    'label': 'sample volume',
    'ontology_name': 'ms',
    'ontology_prefix': 'MS',
    'ontology_iri': 'http://purl.obolibrary.org/obo/ms.owl',
    'is_obsolete': False,
    'term_replaced_by': None,
    'is_defining_ontology': True,
    'has_children': False,
    'is_root': False,
    'short_form': 'MS_1000005',
    'obo_id': 'MS:1000005',
    'in_subset': None,
    'obo_definition_citation': [{'definition': 'Total volume of solution used.',
      'oboXrefs': [{'database': 'PSI',
        'id': 'MS',
        'description': None,
        'url': None}]}],
    'obo_xref': [{'database': None, # <-- This covers the xref declaration, but not the relationship declarations
      'id': 'value-type:xsd:float',
      'description': 'The allowed value-type for this CV term.',
      'url': None}],
    'obo_synonym': None,
    'is_preferred_root': False,
    '_links': {'self': {'href': 'https://www.ebi.ac.uk/ols/api/ontologies/ms/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FMS_1000005?lang=en'},
     'parents': {'href': 'https://www.ebi.ac.uk/ols/api/ontologies/ms/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FMS_1000005/parents'},
     'ancestors': {'href': 'https://www.ebi.ac.uk/ols/api/ontologies/ms/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FMS_1000005/ancestors'},
     'hierarchicalParents': {'href': 'https://www.ebi.ac.uk/ols/api/ontologies/ms/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FMS_1000005/hierarchicalParents'},
     'hierarchicalAncestors': {'href': 'https://www.ebi.ac.uk/ols/api/ontologies/ms/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FMS_1000005/hierarchicalAncestors'},
     'jstree': {'href': 'https://www.ebi.ac.uk/ols/api/ontologies/ms/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FMS_1000005/jstree'},
     'graph': {'href': 'https://www.ebi.ac.uk/ols/api/ontologies/ms/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FMS_1000005/graph'},
     'has_value_type': {'href': 'https://www.ebi.ac.uk/ols/api/ontologies/ms/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FMS_1000005/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252Fms%2523has_value_type'},
     'has_units': {'href': 'https://www.ebi.ac.uk/ols/api/ontologies/ms/terms/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252FMS_1000005/http%253A%252F%252Fpurl.obolibrary.org%252Fobo%252Fms%2523has_units'}}}]},
 '_links': {'self': {'href': 'https://www.ebi.ac.uk/ols/api/ontologies/ms/terms?iri=http://purl.obolibrary.org/obo/MS_1000005'}},
 'page': {'size': 0, 'totalElements': 1, 'totalPages': 1, 'number': 0}}