Saving only elements of the ontology used by the individuals

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

Saving only elements of the ontology used by the individuals

Javier de la Rosa
Hi, thanks for this library!

I was trying to create some individuals for a fairly large ontology, but after running
```
onto.save(file="output.n3", format="ntriples")
```
I see that the entire ontology is also in the saved file. Is there a way to only dump the elements that are actually used by the individuals?

Cheers.
Reply | Threaded
Open this post in threaded view
|

Re: Saving only elements of the ontology used by the individuals

Jiba
Administrator
Hi,

I don't think there is this functionality yet.

If you want to separate RDF triples for individuals from those for classes, you need to create two distinct ontologies, and to create classes and individuals in separate ontologies.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Saving only elements of the ontology used by the individuals

Javier de la Rosa
Hi,

Thanks for the reply. I've created a fork of your repo and added the feature. I have also created a pull request in case you want the feature in owlready2: https://github.com/pwin/owlready2/pull/2

Hope you find it useful.
Cheers.
Reply | Threaded
Open this post in threaded view
|

Re: Saving only elements of the ontology used by the individuals

Jiba
Administrator
Hi,

Thank you very much!
I've added your contribution in the development version of Owlready.

Best regards,
Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Saving only elements of the ontology used by the individuals

Javier de la Rosa
Hi,

Thank you so much! It works like a charm.

Cheers.