def main(): print("Welcome:") p = OWLParser() mgr = p.parse("examples/mod.rdf") print(mgr) for i in mgr.all_individual(): print("IND: {:s} '{:s}'".format(str(i), i.label(""))) for f in i.facts_out(): print(" FACT: {:s}".format(str(f)))
def main(): print("Welcome:") p = OWLParser() mgr = p.parse("examples/ceph.owl") mgr.load_prefix_map("examples/curies.yaml") print(mgr) for p in mgr.all_property(): print("{:s} '{:s}' TR: '{:b}'".format(p.id, p.label, p.is_transitive)) for c in mgr.all_cls(): if not c.label: continue if c.definition: print("{:s} '{:s}' DEF: '{:s}'".format(c.id, c.label, c.definition)) else: print("{:s} '{:s}'".format(c.id, c.label)) for s in c.exactSynonyms: print(" AKA: {:s}".format(s)) for s in c.superclasses(): print(" SUPER: {:s} '{:s}'".format(s.id, s.label)) for s in c.svf_superclasses(partOf): print(" PARTOF: {:s} '{:s}'".format(str(s), s.label))
def setUp(self): p = OWLParser() self.manager = p.parse("examples/mod.rdf") self.manager.load_prefix_map("examples/curies.yaml") self.model = Model(self.manager) return
def setUp(self): p = OWLParser() self.manager = p.parse("examples/ceph.owl") self.manager.load_prefix_map("examples/curies.yaml") logger.info("LOADED") return
import unittest from legolib.rdf.OWLParser import OWLParser import rdflib from rdflib import Namespace from rdflib.namespace import RDF from rdflib.namespace import SKOS RO = Namespace('http://purl.obolibrary.org/obo/RO_') BFO = Namespace('http://purl.obolibrary.org/obo/BFO_') OBO = Namespace('http://purl.obolibrary.org/obo/') partOf = OBO.BFO_0000050 owlparser = OWLParser() def main(): parser = argparse.ArgumentParser(description='Lego' 'Client lib for Lego', formatter_class=argparse.RawTextHelpFormatter) parser.add_argument('-t', '--to', type=str, required=False, help='Renderer') parser.add_argument('-p', '--prefixes', type=str, required=False, help='Prefix map file') subparsers = parser.add_subparsers(dest='subcommand', help='sub-command help')