pszufe / HIF-standard

Hypergraph Exchange Format (HIF) definition and validator libraries
MIT License
9 stars 2 forks source link

The Hypergraph Interchange Format (HIF) standard

(Work-in-progress)

The Hypergraph Interchange Format (HIF) is a forthcoming standard for higher-order network data to facilitate seamless data exchange between existing higher-order network libraries.

Table of contents for this folder

This repository is organized into the following folders:

Initial assumptions about the core of the HIF standard:

{
"network-type": "undirected", # will indicate if directed or an asc
"metadata": {"name": "test"}, # library specific metadata to store with object
"incidences":[{"edge":edge_id, "node":node_id,...},...], # incidences are lists of records of edge node pairs along with the edge dependent node properties
"nodes":[{"node":node_id,...},...] # nodes and edges are lists of records
"edges":[{"edge":edge_id,...},...],
}

Validate files against the HIF standard

validate_hif.py is an executable that checks whether a file follows the HIF standard. It can be run as follows:

python validate_hif.py <filename> [OPTIONS]

The only option is --silent, which suppresses all detailed warnings. Regardless, the script prints a 0 if the JSON file passes the HIF standard and 1 otherwise.

Validate files using HIF standard with fastjsonschema in python module

import fastjsonschema
import json
import requests

schema = requests.get("https://raw.githubusercontent.com/pszufe/HIF-standard/main/schemas/hif_schema_v0.1.0.json").json()
validator = fastjsonschema.compile(schema)
hiftext = json.load(open(filename,'r'))
validator(hiftext)

Hypergraph tools and packages represented

The authors, co-authors or contributors of the following software libraries are represented:

Contributors

This project is an ongoing colaborative work of the following people (alphabetical order):