momapy_kb
A library to integrate momapy maps into graph databases and logic programming backends.
Features
- Multiple LPG backends -- Neo4j, FalkorDB, FalkorDBLite (embedded), via fieldz_kb
- Clingo/ASP backend -- convert maps to logic programming facts
- File-based loading -- save maps directly from CellDesigner, SBGN, and SBML files
- Collection management -- organize maps into named collections
- Custom type plugins -- handles momapy-specific types (LayoutModelMapping, NoneValue, FrozenSurjectionDict)
- Layout element queries -- query model elements and retrieve corresponding layout elements for rendering
Installation
pip install momapy-kb[neo4j] # Neo4j support
pip install momapy-kb[falkordb] # FalkorDB support
pip install momapy-kb[falkordblite] # FalkorDBLite (embedded) support
pip install momapy-kb[clingo] # Clingo/ASP support
pip install momapy-kb[all] # Everything
Quick example
import momapy_kb.lpg.session
import momapy_kb.lpg.backends.neo4j
backend = momapy_kb.lpg.backends.neo4j.Neo4jBackend(
hostname="localhost",
username="neo4j",
password="password",
)
with momapy_kb.lpg.session.Session(backend) as session:
# Save a map from a CellDesigner file
session.save_from_file("model.xml", integration_mode="hash")
# Query model elements
results = session.execute_query_as_objects(
"MATCH (n:Macromolecule) RETURN n"
)
# Get layout elements for rendering
layout_results = session.execute_query_as_layout_elements(
"MATCH (n:GenericProcess) RETURN n"
)
Demo
A Jupyter notebook walking through storing, querying, and rendering maps with Neo4j is available at demos/neo4j/main.ipynb. It requires a running Neo4j server:
docker run -p 7474:7474 -p 7687:7687 -e NEO4J_AUTH=neo4j/password neo4j:5
To run the demo locally:
git clone https://github.com/adrienrougny/momapy_kb.git
cd momapy_kb
pip install .[neo4j] momapy[notebook] jupyter
jupyter notebook demos/neo4j/main.ipynb
The demo includes example data (demos/neo4j/data/) that is only available in the repository.
Documentation
Full documentation is available at https://adrienrougny.github.io/momapy_kb/.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file momapy_kb-0.4.0.tar.gz.
File metadata
- Download URL: momapy_kb-0.4.0.tar.gz
- Upload date:
- Size: 340.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1130e74677f92387d21ba55095d3a481ea7695e18dab0737619a9db59d1bb40b
|
|
| MD5 |
c1722ca7b16766ad2e19be701eb57812
|
|
| BLAKE2b-256 |
20357dcfa9bb59735cc051537cba514cd51df6e8cb8653bc50b78e3fef6e7831
|
Provenance
The following attestation bundles were made for momapy_kb-0.4.0.tar.gz:
Publisher:
release.yml on adrienrougny/momapy_kb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
momapy_kb-0.4.0.tar.gz -
Subject digest:
1130e74677f92387d21ba55095d3a481ea7695e18dab0737619a9db59d1bb40b - Sigstore transparency entry: 2360578009
- Sigstore integration time:
-
Permalink:
adrienrougny/momapy_kb@c8c3611a1571d6d9510b309cfc896c98e00738fc -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/adrienrougny
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c8c3611a1571d6d9510b309cfc896c98e00738fc -
Trigger Event:
push
-
Statement type:
File details
Details for the file momapy_kb-0.4.0-py3-none-any.whl.
File metadata
- Download URL: momapy_kb-0.4.0-py3-none-any.whl
- Upload date:
- Size: 30.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
00d902bae47e4771bad98e9952234ee1f2c92d8a59a700465abf4b4d7bdb3864
|
|
| MD5 |
3f7a95081ddc1503d7d79eb5ed3b1b7d
|
|
| BLAKE2b-256 |
9cdadea82cf24b3a28a5dbcc386d9121fcb3228bda0a6eb9332bdae3c4d9f92f
|
Provenance
The following attestation bundles were made for momapy_kb-0.4.0-py3-none-any.whl:
Publisher:
release.yml on adrienrougny/momapy_kb
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
momapy_kb-0.4.0-py3-none-any.whl -
Subject digest:
00d902bae47e4771bad98e9952234ee1f2c92d8a59a700465abf4b4d7bdb3864 - Sigstore transparency entry: 2360578060
- Sigstore integration time:
-
Permalink:
adrienrougny/momapy_kb@c8c3611a1571d6d9510b309cfc896c98e00738fc -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/adrienrougny
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@c8c3611a1571d6d9510b309cfc896c98e00738fc -
Trigger Event:
push
-
Statement type: