@@ -0,0 +1,1295 @@
+from rdflib.graph import ConjunctiveGraph, URIRef%0Afrom rdflib import util as rdflib_util%0Aimport argparse%0Aimport logging%0A%0A%22%22%22%0AOMIA requires integration across three sources:%0AOMIA, OMIM, and NCBI%0A%0AThere are some odd bugs, see https://github.com/monarch-initiative/dipper/issues/417%0A%0AThis script ensures we are getting the full set of model_of relationships%0A%22%22%22%0A%0Alogger = logging.getLogger(__name__)%0AEXPECTED_PAIRS = 175%0A%0Adef main():%0A    parser = argparse.ArgumentParser(%0A        description='OMIA integration test',%0A        formatter_class=argparse.RawTextHelpFormatter)%0A%0A    parser.add_argument(%0A        '--input', '-i', type=str, required=True,%0A        help='Location of input ttl file')%0A%0A    args = parser.parse_args()%0A%0A    graph = ConjunctiveGraph()%0A    graph.parse(args.input, format=rdflib_util.guess_format(args.input))%0A%0A    model_of = URIRef('http://purl.obolibrary.org/obo/RO_0003301')%0A%0A    models = graph.subject_objects(model_of)%0A    model_len = len(list(models))%0A%0A    if model_len %3C EXPECTED_PAIRS:%0A        logger.error(%22Not enough model_of predicates in graph:%22%0A                     %22 %7B%7D expected %7B%7D check omia log for%22%0A                     %22 warnings%22.format(model_len, EXPECTED_PAIRS))%0A        exit(1)%0A    else:%0A        logger.info(%22PASSED%22)%0A%0Aif __name__ == %22__main__%22:%0A    main()%0A%0A

add omia integration test