biolink / kgx

KGX is a Python library for exchanging Knowledge Graphs
https://kgx.readthedocs.io
BSD 3-Clause "New" or "Revised" License
116 stars 27 forks source link

Add for transformer for BEL #83

Closed cthoyt closed 2 years ago

cthoyt commented 6 years ago

I'm the maintainer of PyBEL which compiles knowledge stored in Biological Expression Language into a NetworkX MultiDiGraph. I don't think it would be so hard to transform the graphs it produces to match your schema so you could incorporate them. There's quite a bit of publicly available content that only exists in BEL, and we're also working at converting several biological knowledge repositories to BEL automatically (see: Bio2BEL).

I would be happy to try and make a PR if you can point me in the right direction where to get started! If you're unaware of BEL I can share some more resources and examples too :)

cmungall commented 6 years ago

Great to hear for you, I am aware of BEL, and I have been meaning to try PyBEL for a while. Dexter mentioned your name a while ago and I have been meaning to get in contact.

I wasn't aware of Bio2BEL, awesome!!

PR most welcome.

Note the primary driver for KGX is what I would call simple non-contextual triples. E.g. geneX involved_in processY, geneX interacts_with geneY. To represent contextual associations such as those found in OpenBEL or GO-CAMs a number of different design patterns present themselves, I'm going to have a look at your mapping to nx and may get back with questions.

cc @goodb

cthoyt commented 6 years ago

Is there any controlled vocabulary for relations I should use? I started down the rabbit hole of the OBO Relations (ontology?) when I was thinking about that.

I think we can do some post-processing on BEL to take some of the relations that have the context on the edges and make them more simple

Example: p(A) increases p(B, pmod(Ph)) can be converted to p(A) phosphorylates p(B) and so on

We're actually working this week with some other Fraunhofer colleagues to make the Bio2BEL repos more amenable for representation learning / other ML approaches for knowledge graphs. I will be sure to update you on the results, since they would likely be directly applicable here too

goodb commented 6 years ago

I believe the RO is exactly the correct rabbit hole to crawl into for this one. Perhaps I can help navigate it? Do you have a list of the relations you want to map tp RO? (I suggest opening it in Protege for an easier time navigating and understanding it.)

cthoyt commented 6 years ago

@goodb thanks for the tip. I actually had some fun looking through RO in the OLS at what's possible!

I've begun to write unit tests (no implementation, yet) on how BEL graphs (encoded in PyBEL's internal DSL) would be converted to RO relationships: https://github.com/cthoyt/pybel-obo/blob/master/tests/test_convert.py.

Hopefully the code is self-explanatory, and if it's not trouble I would appreciate feedback in case I missed something important.

sierra-moxon commented 2 years ago

Hi @cthoyt - just doing some triage of issues here, is this still a priority for you?

cthoyt commented 2 years ago

this is sort of done, but not a priority since kgx went in a very different direction