Skip to content

dgg32/bayesian_kg

Repository files navigation

Introduction

This repository contains code and data for my article "How to build a Bayesian Knowledge Graph".

  1. The scripts are for data flow between Google Sheets, Neo4j and OpenMarkov.

  2. The source data folder contains the TSV downloaded from the Google Sheets for debugging purpose. The pgmx_output folder contains TSV files that are extracted from a pgmx file.

Prerequisite

Neo4j Desktop

OpenMarkov

Run

First, config the config.yaml to match your Google Sheets setup.

  1. Convert data from Google Sheets to a pgmx file
python google_to_pgmx.py [model_name] > [model].pgmx

For example:

python google_to_pgmx.py Asia > manmade_google.pgmx
  1. Convert data from Google Sheets to Neo4j
python tsv_to_neo4j.py

It generates a series of files in the ./neo4j folder.

  1. Other utility files.

pgmx_to_tsv.py is to parse a PGMX file and generate a node, a link and a potential TSV file. You use this script when you have modified data in OpenMarkov and want to overwrite the changes back into your TSV files.

And you can use upsert_tsv.py to upsert the new data into an old TSV file.

Authors

  • Sixing Huang - Concept and Coding

License

This project is licensed under the MIT License - see the LICENSE file for details

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages