Which Python library to use to create OWL file

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

Which Python library to use to create OWL file

jblaya
Hi everyone,
We're looking to export our ontology from our internal format to OWL using python and django, and I'd like to get people's opinions about what is the best python library to use for OWL because I've found Owlready 0.3.1 (https://pypi.python.org/pypi/Owlready) and OWL API for Python (https://github.com/joshhanna/owllib). It seems Owlready is the most used, but I wanted to check here.

Thanks,

Joaquin

--
The Human Diagnosis Project.
One open system.
For all of humankind.
Together.

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Which Python library to use to create OWL file

Chris Mungall-2

Hi Joaquin,

I too am interested in the answer to this question. I think there is a potentially large community here.

There is no python lib I'm aware of that comes close to the functionality of the OWLAPI in Python - especially when it comes to support for all of the different concrete syntaxes. Additionally, rdflib tends to be very slow for parsing ttl or rdf/xml, which can limit it's use in some circumstances.

You mentioned owlready - looks like this has been superseded by owlready2:
https://pypi.python.org/pypi/Owlready2

It seems your use case is generation only. And I guess if you have an internal format, it doesn't have high expressivity. Sounds hacky but print to manchester syntax might not be a terrible option (especially if this is a one time export and you intend to abandon your own format).

There are also a ton of templating libraries. You could always dump intermediate tsvs and use dosdp/robot/webulous etc to generate the OWL. Again for inexpressive formats this may be OK.

There is always jython, but I've been down that road and wouldn't go down it again.

Longer term, what I think the solution is, is YET ANOTHER concrete syntax for OWL, one in JSON. I've been asking about this in various fora for years, and eventually we decided to come up with our own:

https://douroucouli.wordpress.com/2016/10/04/a-developer-friendly-json-exchange-format-for-ontologies/

It's somewhat biases towards easy structuring of things found commonly in bio-ontologies, like GO and HPO (the latter of which I am sure is of interest to you)

We have a python library for working with this format:

http://pypi.python.org/pypi/ontobio
http://ontobio.readthedocs.org

We also have a java lib that generates JSON from from OWL using the OWLAPI:
https://mvnrepository.com/artifact/org.geneontology/obographs

The catch is we have yet to write the converse direction, which is exactly what you want!

It looks like your question was asked on SO
https://stackoverflow.com/questions/1719812/is-there-a-python-library-to-handle-owl
but the top rated answer is from 2011. The top hit is for FuXi, which links to defunct google code. This project seemed promising but is abadoned: https://github.com/RDFLib/FuXi

On 1 Sep 2017, at 14:10, Joaquin Blaya wrote:

Hi everyone,
We're looking to export our ontology from our internal format to OWL using python and django, and I'd like to get people's opinions about what is the best python library to use for OWL because I've found Owlready 0.3.1 (https://pypi.python.org/pypi/Owlready) and OWL API for Python (https://github.com/joshhanna/owllib). It seems Owlready is the most used, but I wanted to check here.

Thanks,

Joaquin

--
The Human Diagnosis Project.
One open system.
For all of humankind.
Together.

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Which Python library to use to create OWL file

Chris Mungall-2


On 1 Sep 2017, at 16:14, Chris Mungall wrote:

> It looks like your question was asked on SO
> <https://stackoverflow.com/questions/1719812/is-there-a-python-library-to-handle-owl>
> but the top rated answer is from 2011. The top hit is for FuXi, which
> links to defunct google code. This project seemed promising but is
> abadoned: <https://github.com/RDFLib/FuXi>

It's really frustrating that this question was closed on SO. It's a
really important question, I don't think it attracts opinionated
answers. Closing the question locks things into a confusing out of date
state. Unfortunately I don't have enough rep to vote for it to re-open.
If there are stackexchange gurus here maybe we could get this re-opened?
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Which Python library to use to create OWL file

Ghislain ATEMEZING
Hi Joaquin,
If you want to work OWL, which somehow is to deal with RDF in Python you can use RDFLib https://github.com/RDFLib/rdflib
It's my favorite.

Just give it a trial for your use case.

Best,
Ghislain 

Sent from my iPhone, may include typos

Le 2 sept. 2017 à 01:19, Chris Mungall <[hidden email]> a écrit :



On 1 Sep 2017, at 16:14, Chris Mungall wrote:

It looks like your question was asked on SO
<https://stackoverflow.com/questions/1719812/is-there-a-python-library-to-handle-owl>
but the top rated answer is from 2011. The top hit is for FuXi, which links to defunct google code. This project seemed promising but is abadoned: <https://github.com/RDFLib/FuXi>

It's really frustrating that this question was closed on SO. It's a really important question, I don't think it attracts opinionated answers. Closing the question locks things into a confusing out of date state. Unfortunately I don't have enough rep to vote for it to re-open. If there are stackexchange gurus here maybe we could get this re-opened?
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Which Python library to use to create OWL file

Lorenz Buehmann
Working with plain RDF is not the same as working with OWL.

RDF -> set of RDF triples
OWL -> set of OWL axioms, OWL class expressions, etc.

Especially the complex OWL axioms and OWL class expressions are encoded via a set of RDF triples, thus, you're lost with a plain RDF API.

Hi Joaquin,
If you want to work OWL, which somehow is to deal with RDF in Python you can use RDFLib https://github.com/RDFLib/rdflib
It's my favorite.

Just give it a trial for your use case.

Best,
Ghislain 

Sent from my iPhone, may include typos

Le 2 sept. 2017 à 01:19, Chris Mungall <[hidden email]> a écrit :



On 1 Sep 2017, at 16:14, Chris Mungall wrote:

It looks like your question was asked on SO
<https://stackoverflow.com/questions/1719812/is-there-a-python-library-to-handle-owl>
but the top rated answer is from 2011. The top hit is for FuXi, which links to defunct google code. This project seemed promising but is abadoned: <https://github.com/RDFLib/FuXi>

It's really frustrating that this question was closed on SO. It's a really important question, I don't think it attracts opinionated answers. Closing the question locks things into a confusing out of date state. Unfortunately I don't have enough rep to vote for it to re-open. If there are stackexchange gurus here maybe we could get this re-opened?
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Which Python library to use to create OWL file

Lorenz Buehmann
In reply to this post by Chris Mungall-2
The reason for closing this question on StackOverflow makes perfectly sense as this platform is not aimed to ask for tools software etc, see [1]:


  1. Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.



The most obvious choice would be to ask this question on the Semantic Web mailing list [2]


Cheers,

Lorenz


[1] https://stackoverflow.com/help/on-topic
[2] https://lists.w3.org/Archives/Public/semantic-web/



On 1 Sep 2017, at 16:14, Chris Mungall wrote:

It looks like your question was asked on SO
<https://stackoverflow.com/questions/1719812/is-there-a-python-library-to-handle-owl>
but the top rated answer is from 2011. The top hit is for FuXi, which links to defunct google code. This project seemed promising but is abadoned: <https://github.com/RDFLib/FuXi>

It's really frustrating that this question was closed on SO. It's a really important question, I don't think it attracts opinionated answers. Closing the question locks things into a confusing out of date state. Unfortunately I don't have enough rep to vote for it to re-open. If there are stackexchange gurus here maybe we could get this re-opened?
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user
Reply | Threaded
Open this post in threaded view
|

Re: Which Python library to use to create OWL file

Ghislain ATEMEZING
@Lorenz: I understand your point.
But if the use case is "lightweight" ontology, such tool can be helpful. Of course a final validation with an OWL API can make sense.
Btw there is a W3C REC on mappings between OWL and RDF https://www.w3.org/TR/owl2-mapping-to-rdf/

My 2 cents ..
Best,
Ghislain

Sent from my iPhone, may include typos

Le 2 sept. 2017 à 15:38, Lorenz B. <[hidden email]> a écrit :

The reason for closing this question on StackOverflow makes perfectly sense as this platform is not aimed to ask for tools software etc, see [1]:


  1. Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.



The most obvious choice would be to ask this question on the Semantic Web mailing list [2]


Cheers,

Lorenz


[1] https://stackoverflow.com/help/on-topic
[2] https://lists.w3.org/Archives/Public/semantic-web/



On 1 Sep 2017, at 16:14, Chris Mungall wrote:

It looks like your question was asked on SO
<https://stackoverflow.com/questions/1719812/is-there-a-python-library-to-handle-owl>
but the top rated answer is from 2011. The top hit is for FuXi, which links to defunct google code. This project seemed promising but is abadoned: <https://github.com/RDFLib/FuXi>

It's really frustrating that this question was closed on SO. It's a really important question, I don't think it attracts opinionated answers. Closing the question locks things into a confusing out of date state. Unfortunately I don't have enough rep to vote for it to re-open. If there are stackexchange gurus here maybe we could get this re-opened?
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user


-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center
_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user