hetpy

A simple, strongly typed python package for heterogeneous information networks.

https://github.com/codingfabi/hetpy

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.0%) to scientific vocabulary
Last synced: 7 months ago · JSON representation ·

Repository

A simple, strongly typed python package for heterogeneous information networks.

Basic Info
Statistics
  • Stars: 7
  • Watchers: 1
  • Forks: 0
  • Open Issues: 4
  • Releases: 0
Created over 3 years ago · Last pushed over 2 years ago
Metadata Files
Readme Citation

README.md

HetPy

HetPy is a strongly typed python library for handling heterogeneous information networks.

Coverage

How to install

HetPy is installable via pip:

python pip install -i hetpy

The package is available for Python versions 3.7 - 3.10.

HetPy is and will always be free to use. If you use this package frequently for reasearch or business purposes, feel free to contribute to the project by giving feedback, raising issues or enhancing the documentation. If used for a publication, feel free to use the citation provided in the sidebar.

Quick Start

HetPy provides various strongly typed classes for typesafe handling of heterogeneous information networks (HINs). HINs in general are graphs with at least two node or two edge types. Node and edge types are a requirement for a HIN to exist. HetPy supports these type definitions by asserting and requiring these types. Further, it enables the user to define types of paths and meta paths on the graph.

To get started, import the main class HetGraph from the package and create one using a set of nodes and a set of edges.

```python from hetpy import HetGraph, Node, Edge

node = Node("MockType",{"Name": "node1"}) nodetwo = Node("MockType2",{"Name": "node2"}) nodethree = Node("MockType3",{"Name": "node3"})

edge = Edge(source=node, target=nodetwo, directed=True, type="EdgeType") edgetwo = Edge(source=node, target=node_three, directed=True, type="EdgeType2")

graph = HetGraph([node, nodetwo, nodethree], [edge, edge_two]) ```

It is further possible to define path types as a mapping of node type tuple to an edge type. A list of paths can then be defiend on the graph object in order to assert object type definitions.

edge_type_mappings = [(("MockType","MockType2"),"EdgeType"), (("MockType2", "MockType3"),"EdgeType2")] path_definitions = HetPaths(edge_type_mappings) As an extention to this path concept, we allow definitions of meta paths that guide the semantics of the underlying domain. Meta paths are defined as a concatenation of edge types and hence, concatenation of paths. Meta path objects are consequently defined by a path sequence and an abbreviation that works as a unique identifier. Further, they containa describtion. Both, paths and meta paths can be added to the graph either during creation or in hindsight.

```python exemplaryMetaPath = MetaPath(path=["EdgeType","EdgeType2"], description="A meta path do demonstrate meta path functionality.", abbreviation="mockMetaPath")

hinGraphWithPaths = HetGraph(nodes=[node, nodetwo, nodethree], edges=[edge, edgetwo] pathlist=pathdefinitions, metapaths=[exemplaryMetaPath]) ```

By specifying these semantic boundaries, the information network becomes easier to interpret w.r.t. its domain.

Meta Projection

To compress the information a heterogeneous graph contains and focus on a particular node type relation, it is possible to create a projection of the graph on basis of a meta path. Following along the concept of bipartite projections in a bipartite graph, this is called a "meta projection".

A meta projection connects to two nodes if there exists a path that is an instance of the meta path that the projection is based on. Consequently, the meta projection shows the relation between the node types of the source and the sink of the meta path.

For example, we can compress the information the previous defined graph by the meta path that we defined earlier.

python projection = create_meta_projection(graph=hinGraphWithPaths, meta_path=exemplaryMetaPath)

This results in a projeciton graph where node1 connects to node3 because they are connected by an instance of the meta path exemplaryMetaPath.

For more information, demos and detailed documentation see the API-Documentation.

Owner

  • Login: codingfabi
  • Kind: user

🤙

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 0.2.1
title: HetPy
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Fabian
    family-names: Kneissl
    email: fabian.kneissl@gmx.de
    affiliation: >-
      Heidelberg University - Database Systems Research
      Group
repository-code: 'https://github.com/codingfabi/hetpy'
url: 'https://codingfabi.github.io/hetpy/hetpy.html'
abstract: >-
  HetPy is a python graph library that simplifies handling
  of heterogeneous information networks by strongly typing
  nodes and edges. 

GitHub Events

Total
  • Watch event: 1
Last Year
  • Watch event: 1

Committers

Last synced: about 3 years ago

All Time
  • Total Commits: 37
  • Total Committers: 1
  • Avg Commits per committer: 37.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
codingfabi f****l@g****e 37
Committer Domains (Top 20 + Academic)
gmx.de: 1

Issues and Pull Requests

Last synced: almost 2 years ago

All Time
  • Total issues: 18
  • Total pull requests: 43
  • Average time to close issues: 12 days
  • Average time to close pull requests: about 8 hours
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 0.11
  • Average comments per pull request: 0.0
  • Merged pull requests: 43
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 5
  • Average time to close issues: 2 minutes
  • Average time to close pull requests: 30 minutes
  • Issue authors: 1
  • Pull request authors: 1
  • Average comments per issue: 0.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 5
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • codingfabi (18)
Pull Request Authors
  • codingfabi (43)
Top Labels
Issue Labels
enhancement (11) bug (3) documentation (2) good first issue (1) technical improvement (1)
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 6 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 7
  • Total maintainers: 1
pypi.org: hetpy

A package to handle heterogeneous information networks

  • Versions: 7
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 6 Last month
Rankings
Dependent packages count: 10.1%
Stargazers count: 20.3%
Dependent repos count: 21.6%
Average: 26.1%
Forks count: 29.8%
Downloads: 48.9%
Maintainers (1)
Last synced: 7 months ago

Dependencies

.github/workflows/docs.yml actions
  • actions/checkout v3 composite
  • actions/deploy-pages v1 composite
  • actions/setup-python v4 composite
  • actions/upload-pages-artifact v1 composite
.github/workflows/main.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v3 composite
Pipfile pypi
  • coverage *
  • coverage-badge *
  • hetpy *
  • matplotlib *
  • pandas *
  • pdoc *
  • python-igraph *
  • setuptools *
  • twine *
  • wheel *
Pipfile.lock pypi
  • bleach ==5.0.1
  • certifi ==2022.12.7
  • charset-normalizer ==2.1.1
  • commonmark ==0.9.1
  • contourpy ==1.0.6
  • coverage ==7.0.5
  • coverage-badge ==1.1.0
  • cycler ==0.11.0
  • docutils ==0.19
  • fonttools ==4.38.0
  • hetpy ==0.1.1b
  • idna ==3.4
  • igraph ==0.10.3
  • importlib-metadata ==6.0.0
  • jaraco.classes ==3.2.3
  • jinja2 ==3.1.2
  • keyring ==23.13.1
  • kiwisolver ==1.4.4
  • markupsafe ==2.1.1
  • matplotlib ==3.6.2
  • more-itertools ==9.0.0
  • numpy ==1.24.1
  • packaging ==23.0
  • pandas ==1.5.2
  • pdoc ==12.3.1
  • pillow ==9.4.0
  • pkginfo ==1.9.6
  • pygments ==2.14.0
  • pyparsing ==3.0.9
  • python-dateutil ==2.8.2
  • python-igraph ==0.10.3
  • pytz ==2022.7
  • readme-renderer ==37.3
  • requests ==2.28.1
  • requests-toolbelt ==0.10.1
  • rfc3986 ==2.0.0
  • rich ==13.0.1
  • setuptools ==65.7.0
  • six ==1.16.0
  • texttable ==1.6.7
  • twine ==4.0.2
  • urllib3 ==1.26.14
  • webencodings ==0.5.1
  • wheel ==0.38.4
  • zipp ==3.11.0
requirements.txt pypi
  • Babel ==2.11.0
  • Jinja2 ==3.1.2
  • Mako ==1.2.4
  • Markdown ==3.4.1
  • MarkupSafe ==2.1.1
  • Pillow ==9.4.0
  • Pygments ==2.14.0
  • alabaster ==0.7.12
  • attrs ==22.2.0
  • beautifulsoup4 ==4.11.1
  • bleach ==5.0.1
  • certifi ==2022.12.7
  • charset-normalizer ==2.1.1
  • commonmark ==0.9.1
  • contourpy ==1.0.6
  • coverage ==7.0.5
  • coverage-badge ==1.1.0
  • cycler ==0.11.0
  • defusedxml ==0.7.1
  • docopt ==0.6.2
  • docutils ==0.19
  • entrypoints ==0.4
  • fastjsonschema ==2.16.2
  • fonttools ==4.38.0
  • idna ==3.4
  • igraph ==0.10.3
  • imagesize ==1.4.1
  • importlib-metadata ==6.0.0
  • jaraco.classes ==3.2.3
  • jsonschema ==4.17.3
  • jupyter_client ==7.4.9
  • jupyter_core ==4.12.0
  • jupyterlab-pygments ==0.2.2
  • keyring ==23.13.1
  • kiwisolver ==1.4.4
  • matplotlib ==3.5.0
  • mistune ==2.0.4
  • more-itertools ==9.0.0
  • nbclient ==0.7.2
  • nbconvert ==7.2.7
  • nbformat ==5.7.3
  • nest-asyncio ==1.5.6
  • numpy ==1.21.4
  • packaging ==23.0
  • pandas ==1.3.3
  • pandocfilters ==1.5.0
  • pdoc ==12.3.1
  • pipreqs ==0.4.11
  • pkginfo ==1.9.6
  • platformdirs ==2.6.2
  • pycairo ==1.23.0
  • pyparsing ==3.0.9
  • pyrsistent ==0.19.3
  • python-dateutil ==2.8.2
  • python-igraph ==0.10.3
  • pytz ==2022.7
  • pyzmq ==25.0.0
  • readme-renderer ==37.3
  • requests ==2.28.1
  • requests-toolbelt ==0.10.1
  • rfc3986 ==2.0.0
  • rich ==13.0.1
  • six ==1.16.0
  • snowballstemmer ==2.2.0
  • soupsieve ==2.3.2.post1
  • texttable ==1.6.7
  • tinycss2 ==1.2.1
  • tornado ==6.2
  • traitlets ==5.8.1
  • twine ==4.0.2
  • urllib3 ==1.26.14
  • webencodings ==0.5.1
  • yarg ==0.1.9
  • zipp ==3.11.0
setup.py pypi
  • python-igraph *