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.13.tar.gz (720.0 kB view details)

Uploaded Source

File details

Details for the file meteor_reasoner-1.0.13.tar.gz.

File metadata

  • Download URL: meteor_reasoner-1.0.13.tar.gz
  • Upload date:
  • Size: 720.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.12

File hashes

Hashes for meteor_reasoner-1.0.13.tar.gz
Algorithm Hash digest
SHA256 d501486ddee2dded403c3d8e1a5397d0b874584b1ca59935653be0fbd19af9b4
MD5 e7a4bbf7d1b98d2b8ad3389fd6f429e7
BLAKE2b-256 4ea3a85937df0657189e0b449524403990b3ec45dfe9dae1b065ee704e08d2e0

See more details on using hashes here.

Supported by

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