{"id":49453592,"url":"https://github.com/tomgrek/zincbase","last_synced_at":"2026-06-02T05:00:40.461Z","repository":{"id":52417251,"uuid":"183831265","full_name":"tomgrek/zincbase","owner":"tomgrek","description":"A batteries-included kit for knowledge graphs","archived":false,"fork":false,"pushed_at":"2021-04-29T20:06:53.000Z","size":12575,"stargazers_count":278,"open_issues_count":5,"forks_count":61,"subscribers_count":10,"default_branch":"master","last_synced_at":"2023-11-07T14:20:31.538Z","etag":null,"topics":["graph-neural-networks","knowledge-base","knowledge-graph","neural-network","prolog"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tomgrek.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-04-27T23:34:55.000Z","updated_at":"2023-10-31T07:04:05.000Z","dependencies_parsed_at":"2022-09-01T04:30:56.453Z","dependency_job_id":null,"html_url":"https://github.com/tomgrek/zincbase","commit_stats":null,"previous_names":[],"tags_count":6,"template":null,"template_full_name":null,"purl":"pkg:github/tomgrek/zincbase","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomgrek%2Fzincbase","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomgrek%2Fzincbase/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomgrek%2Fzincbase/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomgrek%2Fzincbase/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tomgrek","download_url":"https://codeload.github.com/tomgrek/zincbase/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tomgrek%2Fzincbase/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33806987,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-02T02:00:07.132Z","response_time":109,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graph-neural-networks","knowledge-base","knowledge-graph","neural-network","prolog"],"created_at":"2026-04-30T04:01:03.701Z","updated_at":"2026-06-02T05:00:40.392Z","avatar_url":"https://github.com/tomgrek.png","language":"Python","funding_links":[],"categories":["📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"readme":"[![CircleCI](https://circleci.com/gh/tomgrek/zincbase.svg?style=svg)](https://circleci.com/gh/tomgrek/zincbase)\n[![DOI](https://zenodo.org/badge/183831265.svg)](https://zenodo.org/badge/latestdoi/183831265)\n[![Documentation Status](https://readthedocs.org/projects/zincbase/badge/?version=latest)](https://zincbase.readthedocs.io/en/latest/?badge=latest)\n\n# Hello!\n\nThe tech behind parts of ZincBase was acquired.\nThis repo is still here for reference, but it is deprecated.\n\nFortunately, work still goes on. Apart from a couple of fringe bits, the [active repo lives here](https://github.com/complexdb/zincbase).\n\nThe new owner of ZincBase as it is today is [ComplexDB](https://complexdb.com).\n\n## Alright, you still want to continue\n\n\u003cimg src=\"https://user-images.githubusercontent.com/2245347/57199440-c45daf00-6f33-11e9-91df-1a6a9cae6fb7.png\" width=\"140\" alt=\"Zincbase logo\"\u003e\n\nZincBase is a state of the art knowledge base. It does the following:\n\n* Extract facts (aka triples and rules) from unstructured data/text\n* Store and retrieve those facts efficiently\n* Build them into a graph\n* Provide ways to query the graph, including via bleeding-edge graph neural networks.\n\nZincbase exists to answer questions like \"what is the probability that Tom likes LARPing\", or \"who likes LARPing\", or \"classify people into LARPers vs normies\":\n\n\u003cimg src=\"https://user-images.githubusercontent.com/2245347/57595488-2dc45b80-74fa-11e9-80f4-dc5c7a5b22de.png\" width=\"320\" alt=\"Example graph for reasoning\"\u003e\n\nIt combines the latest in neural networks with symbolic logic (think expert systems and prolog) and graph search.\n\nView full documentation [here](https://zincbase.readthedocs.io).\n\n## Quickstart\n\n```\nfrom zincbase import KB\nkb = KB()\nkb.store('eats(tom, rice)')\nfor ans in kb.query('eats(tom, Food)'):\n    print(ans['Food']) # prints 'rice'\n\n...\n# The included assets/countries_s1_train.csv contains triples like:\n# (namibia, locatedin, africa)\n# (lithuania, neighbor, poland)\n\nkb = KB()\nkb.from_csv('./assets/countries.csv')\nkb.build_kg_model(cuda=False, embedding_size=40)\nkb.train_kg_model(steps=2000, batch_size=1, verbose=False)\nkb.estimate_triple_prob('fiji', 'locatedin', 'melanesia')\n0.8467\n```\n\n# Requirements\n\n* Python 3\n* Libraries from requirements.txt\n* GPU preferable for large graphs but not required\n\n# Installation\n\n`pip install -r requirements.txt`\n\n_Note:_ Requirements might differ for PyTorch depending on your system.\n\n# Testing\n\n```\npython test/test_main.py\npython test/test_graph.py\npython test/test_lists.py\npython test/test_nn_basic.py\npython test/test_nn.py\npython test/test_neg_examples.py\npython test/test_truthiness.py\npython -m doctest zincbase/zincbase.py\n```\n\n# Validation\n\n\"Countries\" and \"FB15k\" datasets are included in this repo.\n\nThere is a script to evaluate that ZincBase gets at least as good\nperformance on the Countries dataset as the original (2019) RotatE paper. From the repo's\nroot directory:\n\n```\npython examples/eval_countries_s3.py\n```\n\nIt tests the hardest Countries task and prints out the AUC ROC, which should be\n~ 0.95 to match the paper. It takes about 30 minutes to run on a modern GPU.\n\nThere is also a script to evaluate performance on FB15k: `python examples/fb15k_mrr.py`.\n\n## Building documentation\n\nFrom docs/ dir: `make html`. If something changed a lot: `sphinx-apidoc -o . ..`\n\n# TODO\n\n* Add documentation\n* to_csv method\n* utilize postgres as backend triple store\n* The to_csv/from_csv methods do not yet support node attributes.\n* Add relation extraction from arbitrary unstructured text\n* Add context to triple - that is interpreted by BERT/ULM/GPT-2 similar and\nput into an embedding that's concat'd to the KG embedding.\n* Reinforcement learning for graph traversal.\n\n# References \u0026 Acknowledgements\n\n[Theo Trouillon. Complex-Valued Embedding Models for Knowledge Graphs. Machine Learning[cs.LG]. Université Grenoble Alpes, 2017. English. ffNNT : 2017GREAM048](https://tel.archives-ouvertes.fr/tel-01692327/file/TROUILLON_2017_archivage.pdf)\n\n[L334: Computational Syntax and Semantics -- Introduction to Prolog, Steve Harlow](http://www-users.york.ac.uk/~sjh1/courses/L334css/complete/complete2li1.html)\n\n[Open Book Project: Prolog in Python, Chris Meyers](http://www.openbookproject.net/py4fun/prolog/intro.html)\n\n[Prolog Interpreter in Javascript](https://curiosity-driven.org/prolog-interpreter)\n\n[RotatE: Knowledge Graph Embedding by Relational Rotation in Complex Space, Zhiqing Sun and Zhi-Hong Deng and Jian-Yun Nie and Jian Tang, International Conference on Learning Representations, 2019](https://openreview.net/forum?id=HkgEQnRqYQ)\n\n# Citing\n\nIf you use this software, please consider citing:\n\n```\n@software{zincbase,\n  author = {{Tom Grek}},\n  title = {ZincBase: A state of the art knowledge base},\n  url = {https://github.com/tomgrek/zincbase},\n  version = {0.1.1},\n  date = {2019-05-12}\n}\n\n```\n\n# Contributing\n\nSee CONTRIBUTING. And please do!","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomgrek%2Fzincbase","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomgrek%2Fzincbase","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomgrek%2Fzincbase/lists"}