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

Error using the BioLink model #22

Open
vemonet opened this issue Mar 31, 2023 · 3 comments
Open

Error using the BioLink model #22

vemonet opened this issue Mar 31, 2023 · 3 comments
Labels
template A request for a new or modified template

Comments

@vemonet
Copy link
Contributor

vemonet commented Mar 31, 2023

Hi, I tried to use the BioLink model as base to run the SPIRES engine (as it was recommended in the readme!), but faced some issue.

Generating the .py file from the biolink_model.yaml put in src/ontogpt/templates/ worked well with make

But we encounter an error when trying to extract a class:

poetry run ontogpt extract -t biolink_model.ChemicalToDiseaseOrPhenotypicFeatureAssociation treatment.txt

We are getting the error ValueError: Template biolink_model.ChemicalToDiseaseOrPhenotypicFeatureAssociation not found because the classes name defined in the BioLink model are in the format chemical to disease or phenotypic feature association

If we try to provide the class name with spaces:

poetry run ontogpt -v extract -t "biolink_model.chemical to disease or phenotypic feature association" treatment.txt

There is an error due to the python classes name not matching:

  File "/home/vemonet/develop/translator/ontogpt/src/ontogpt/engines/knowledge_engine.py", line 230, in _get_template_class
    self.template_pyclass = mod.__dict__[class_name]
KeyError: 'chemical to disease or phenotypic feature association'

I could easily implement a fix I think, but I wonder if anyone here with a better knowledge of LinkML than me has a quick fix for this problem? @cmungall

@cmungall
Copy link
Member

cmungall commented Apr 6, 2023

I think it should be a quick fix to allow the non-conventional names used in biolink (all other linkml schemas have switched to camelcase + snake case)

however, there will likely be some degree of customization required such as prompt hints, describing preferred annotators, etc. Ideally these would be in a separate configuration file to have separation of concerns but for now it's necessary to do a bit of copy and pasting to get the desired behavior. this should be something we can fix with the linkml-transformer framework!

@caufieldjh caufieldjh added the template A request for a new or modified template label Jul 23, 2023
@nlharris
Copy link
Member

nlharris commented Dec 4, 2023

Just wondering if this has been fixed yet.

@caufieldjh
Copy link
Member

No, not yet - the workaround is to replace the offending class name with something equivalent to the Python class, like chemical to disease or phenotypic feature association -> ChemicalToDiseaseOrPhenotypicFeatureAssociation.
But ideally that shouldn't be necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
template A request for a new or modified template
Projects
None yet
Development

No branches or pull requests

4 participants