Skip to main content

A Metric Temporal Reasoner

Project description


PyPI License

Overview

The Metric Temporal Reasoner (MeTeoR) is a scalable reasoner for full DatalogMTL, an extension of Datalog with operators from Metric Temporal Logic (MTL). In MeTeoR, we provide lots of pluggable functional modules that can be directly reused by other researchers for their research work in the DatalogMTL domain. Besides, we will keep continuous maintenance and updates to MeTeoR and provide more implementations from the latest research in DatalogMTL. Currently, MeTeoR mainly consists of the following six modules:

Besides, MeTeoR provides the implementation for the following papers:

Streaming Reasoning with DatalogMTL Under review for Journal of Web Semantics.

Materialisation-based Reasoning in DatalogMTL with Bounded Intervals Under review for KR 2022.

MeTeoR: Practical Reasoning in Datalog with Metric Temporal Operators Published in AAAI 2022.

Finitely Materialisable Datalog Programs with Metric Temporal Operators Published in KR 2021.

MeTeoR is an on-going effort, and we are planning to increase our coverage in the future.

Installation

You can install MeTeoR using Python's package manager pip.

Requirements

  • Python>=3.7
  • Numpy>=1.16.0
  • pandas>=0.24.0
  • urllib3>=1.24.0
  • scikit-learn>=0.20.0
  • networkx
  • outdated>=0.2.0

Pip install

The recommended way to install MeTeoR is using Python's package manager pip:

pip install meteor_reasoner
python -c "import meteor_reasoner; print(meteor_reasoner.__version__)"
# This should print "1.0.1". Otherwise, please update the version by
pip install -U meteor_reasoner

From source

You can also install MeTeoR from source. This is recommended if you want to contribute to MeTeoR.

git clone https://github.com/wdimmy/MeTeoR
cd MeTeoR
pip install -e .

Package Usage

We showcase one features of MeTeoR, namely, easy-to-use data parser.

(1) Data parser

The format of the datasets and the program could be found in the example foler.

from meteor_reasoner.utils.loader import *
import argparse

parser = argparse.ArgumentParser()
parser.add_argument("--datapath", type=str)
parser.add_argument("--rulepath", type=str)
args = parser.parse_args()

# load the dataset and the program
with open(args.datapath) as file:
        data = file.readlines()
with open(args.rulepath) as file:
        program = file.readlines()
D = load_dataset(data)
D_index = defaultdict(lambda: defaultdict(list))
program = load_program(program)

Citing MeTeoR

If you use MeTeoR in your work, please cite our papers (Bibtex below).

@article{wang2022meteor,
  title={MeTeoR: Practical Reasoning in Datalog with Metric Temporal Operators},
  author={Wang, Dingmin and Hu, Pan and Wa{\l}{\k{e}}ga, Przemys{\l}aw Andrzej and Grau, Bernardo Cuenca},
  journal={arXiv preprint arXiv:2201.04596},
  year={2022}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

meteor_reasoner-1.0.6.tar.gz (720.6 kB view hashes)

Uploaded Source

Built Distribution

meteor_reasoner-1.0.6-py3-none-any.whl (77.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page