'path': '/repos/drosophila-anatomy-developmental-ontology/fbbt/releases/fbbt-simple.owl'
                },
                'fb_feature' :
                { 'url' : 'http://purl.obolibrary.org/obo/fbbt/vfb/fb_features.owl',
                  'path' : '/repos/VFB_owl/src/owl/fb_features.owl'
                }
}               

## Switch to owl_pdm_tools to deal with obsoletes?
for k, v in onts_2_learn.items():
    b.learn(v[sys.argv[1]])
    
    
# Get all classes

sc = b.getSubClasses('Thing', 0)

# set constraints

# Add nodes

statements = []
for c in sc:
    label = ''
    try:
        label = b.getLabel(c)
        label = re.sub("'", "\\'", label)
    except:
        pass
    is_obsolete = False
    try:
#!/usr/bin/env jython
import json
from uk.ac.ebi.brain.core import Brain
import sys

"""Takes a list of ontology URIs as args, writes a JSON lookup of ID:name."""

out = {}

for path in sys.argv[1:]:
    entities = []
    o = Brain()
    o.learn(path)
    entities.extend(list(o.getSubClasses('Thing', 0)))
    entities.extend(list(o.getInstances('Thing', 0)))
    for e in entities:
        # Need check for if label exists.  Should be able to do that by iterating over all annotations on class to check.  Will slow things down a lot...
        out[e] = o.getLabel(e)
    o.sleep()


OUT = open('id_name.json', 'w')    
OUT.write(json.dumps(out))
from uk.ac.ebi.brain.core import Brain
import json


all_ont = Brain()
all_ont.learn = ("") # fbbi
all_ont.learn = ("") # fbbt
all_ont.learn = ("") # fbdv

classlist = all_ont.getSubClasses("Thing", 0)

id_name = {}

for c in classlist:
    id_name[c] = all_ont.getLabel(c)
    
lookup = open("lookup", "w")
    
lookup.write(json.dump(id_name))