Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace funowl dependencies with py-horned-owl #40

Open
cmungall opened this issue Dec 4, 2023 · 12 comments
Open

Replace funowl dependencies with py-horned-owl #40

cmungall opened this issue Dec 4, 2023 · 12 comments

Comments

@cmungall
Copy link
Member

cmungall commented Dec 4, 2023

See:

Which will be in 0.3.0: https://github.com/jannahastings/py-horned-owl/releases/tag/v0.3.0rc1

@johardi
Copy link

johardi commented May 9, 2024

I wonder if this new dependency will make linkml-data2owl run faster because it's currently slow.

@cmungall
Copy link
Member Author

cmungall commented May 9, 2024

It should, I am not sure how much.

funowl is particularly slow for reading. But I am not sure the extent to which any slowness you perceive is due to the logic in linkml-owl or in the funowl writer. But I am fairly sure if it's the former we can optimize the code. Do you have examples?

@bherr2
Copy link

bherr2 commented May 10, 2024

Hi Chris! I've attached the schema (ds-graph.yaml) and data (normalized.yaml) Josef and I are running linkml-data2owl cli with (github wasn't happy with just attaching yaml, so attached a zip of the two). It takes hours to run this command. Any ideas?

schema-and-data.zip

@bherr2
Copy link

bherr2 commented May 10, 2024

Oops forgot we normalize the schema. This linkml schema should be better as it brings the imports into it: ds-graph.zip

@cmungall
Copy link
Member Author

Thanks! Yes, this is slow, but I'm confident we can make some changes here that should improve things a lot.

The majority of the time is spent in rendering objects, and switching funowl for py-horned-owl will definitely increase speed here

There are also some inefficiencies in owl_dumper that are upstream. We plan to switch out dataclasses for pydantic or plain json dicts (#44). You also make heavy use of jinja templates - which is fine - but funowl is used to parse the output of these, which adds additional inefficiencies. These will be faster with py-horned-owl based parsing.

But the majority of the slowness is in the rendering of the OWL itself, wow, funowl is really slow here. We need to swap this out soon!

@bherr2
Copy link

bherr2 commented May 13, 2024

Thanks for looking into this. We'll try to tweak a little bit, but it does finish so that's good. We'll be on the lookout for the py-horned-owl update!

@cmungall
Copy link
Member Author

I don't think the conversion should be so hard, but I want to run some more tests first.

One consequence of the change is that ontologies will be exported in OWL/XML, not functional syntax:

ontology-tools/py-horned-owl#18

This should not be a limitation, since it can be easily converted with robot (at least for ontologies that are not in multiple millions of classes). We could even have linkml-owl do the conversion on the fly by running robot (but this is awkward). However, there is a certain ergonomic advantage in being able to see the more conventional and readable functional syntax as the default. (OWL/XML is the most useless of OWL serializations IMO)

@bherr2
Copy link

bherr2 commented May 31, 2024

How does that effect the templates, which I believe are all functional syntax? Will we need to update those?

@cmungall
Copy link
Member Author

cmungall commented May 31, 2024 via email

@bherr2
Copy link

bherr2 commented May 31, 2024

Yeah, I'm happy to update our templates, but it would be a breaking change for those who have done the same. May need to bump major version (which is justified either way I think).

@cmungall
Copy link
Member Author

cmungall commented May 31, 2024 via email

@bherr2
Copy link

bherr2 commented Aug 2, 2024

Has their been any movement on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants