Skip to main content

momapy_kb

License

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

momapy_kb-0.4.0.tar.gz (340.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

momapy_kb-0.4.0-py3-none-any.whl (30.4 kB view details)

Uploaded Python 3

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

Hashes for momapy_kb-0.4.0.tar.gz
Algorithm Hash digest
SHA256 1130e74677f92387d21ba55095d3a481ea7695e18dab0737619a9db59d1bb40b
MD5 c1722ca7b16766ad2e19be701eb57812
BLAKE2b-256 20357dcfa9bb59735cc051537cba514cd51df6e8cb8653bc50b78e3fef6e7831

See more details on using hashes here.

Provenance

The following attestation bundles were made for momapy_kb-0.4.0.tar.gz:

Publisher: release.yml on adrienrougny/momapy_kb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for momapy_kb-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 00d902bae47e4771bad98e9952234ee1f2c92d8a59a700465abf4b4d7bdb3864
MD5 3f7a95081ddc1503d7d79eb5ed3b1b7d
BLAKE2b-256 9cdadea82cf24b3a28a5dbcc386d9121fcb3228bda0a6eb9332bdae3c4d9f92f

See more details on using hashes here.

Provenance

The following attestation bundles were made for momapy_kb-0.4.0-py3-none-any.whl:

Publisher: release.yml on adrienrougny/momapy_kb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.5.0

2 files

0.4.1

2 files

This release

0.4.0 This release

2 files

0.3.0

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page