List ids from world object

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

List ids from world object

tomekldc
Hi,

I have several ontologies with different name and namespace.

Is there a way to return a dictionary with the name, base_uri, namespace for each ontology of a world ?
The method world.ontologies doesn't seem to fit the request.

Kind regards,

Tomek
Reply | Threaded
Open this post in threaded view
|

Re: List ids from world object

Jiba
Administrator
Hi,

You can use default_world.ontologies, which is a dictionary mapping base IRI to ontologies. You may also use default_world.ontologies.values() to obtain all ontologies and then build the dictionary of your choice, e.g.:

d = {ontology.name : ontology for ontology in default_world.ontologies.values()}

Jiba