Common Format Automated Check

Discussion on this check can be found here.

Requirements

  1. Released ontology must be in RDF/XML format

Fixes

See the Common Format Recommendations. ROBOT offers functionality to convert a variety of formats, including OBO, to RDF/XML. Protégé allows you to save ontologies in RDF/XML, as well. The Ontology 101 Tutorial has directions on starting and saving in Protégé.

Implementation

Current implementation attempts to load the ontology using OWL API. If the ontology is loaded, it is assumed that it is in a good format, although it may not be RDF/XML. For large ontologies, the ontology is a valid format (either RDF/XML or Turtle) if it can be loaded with Jena to run the ROBOT report over.

import dash_utils
from dash_utils import format_msg


def is_common_format(syntax):
   """Check FP 2 - Common Format.

   Args:
       syntax (str): the syntax as determined by ROBOT metrics

   Return:
       PASS if OWLOntology is not None, ERROR otherwise.
   """
   if syntax is None:
       return {'status': 'ERROR', 'comment': 'Unknown format'}
   elif syntax == "RDF/XML Syntax":
       return {'status': 'PASS'}
   else:
       return {'status': 'WARN', 'comment': f'OWL syntax ({syntax}), but should be RDF/XML'}