Skip to main content

Setup

Install knowledge-graph using these commands:

git clone https://github.com/hyroai/knowledge-graph.git
pip install -e ./knowledge-graph
pip install cloud-utils@https://github.com/hyroai/cloud-utils/tarball/master

Publish to PyPI

After merging your new branch to the main branch, You need to publish a new version to PyPI. On the repo's main view go to the "Code" tab on top and then press on releases. Click "Draft a new release" and create you new release with semantic version that follows the rules here: https://semver.org/. Publishing your new release will create a new version on PyPI using the latest commit on main.

When to use querying.py vs querying_raw.py

Both modules provide querying abilities, but querying.py relies on a global store of kgs, storred by their hash value. The code retrieves the kg instance from this map ad hoc. This was built so we can have a serializable representation of a node in the kg, Node, which has graph_id and node_id, and not have to serialize the entire kg any time we serialize an object containing them (e.g. if we're serializing or hashing a NounPhrase for some reason).

The global store is an impure component that can make some code have different behaviours depending on what happened before (whether or not the kg was loaded).

Consequently, in contexts where you have a Element and KnowledgeGraph, prefer using querying_raw.py, giving the graph instance explicitly. This is mainly when creating graphs or enriching them.

In contexts where all you have is Node, use querying.py.

If you implement new querying functions, you can implement them in querying_raw.py, and lift them to querying.py using storage.run_on_kg_and_node.

Do not use the internal modules inside the knowledge_graph directory

Instead, rely on the imports in knowledge_graph/__init__.py, possibly add what you need there (in rare cases this is required).

Relations naming conventions

Relation are the middle part of the triplet. Although they can safely be named anything, we use a naming convention that serves as mnemonic device. For example the relation person/gender implies the left hand side is an entity representing a person, whereas the right hand side is a gender, so we can expect a triplet like Alice,person/gender,female.

Release files for knowledge-graph 0.0.35

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for knowledge-graph 0.0.35
File Size Uploaded
knowledge_graph-0.0.35.tar.gz 17.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for knowledge-graph 0.0.35
File Interpreter ABI Platform
knowledge_graph-0.0.35-py3-none-any.whl Python 3 none any Details

Total release size: 36.8 kB

Release files / knowledge_graph-0.0.35.tar.gz

Download URL knowledge_graph-0.0.35.tar.gz
Size 17.0 kB
Tags Source
SHA-256 checksum
How to use checksums
936def5c880a668e0ae38aea8f0b1bfcac237fd11a59e9fcf0d509e68cf169d9
BLAKE2b-256 checksum
How to use checksums
51ff98d56eaf93dce59ce028eea4647a091863bf482773e667702d1ce79a3b7f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release files / knowledge_graph-0.0.35-py3-none-any.whl

Download URL knowledge_graph-0.0.35-py3-none-any.whl
Size 19.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c7e35553085023c09afcc94c7d42a3b3bae0969db6b1576df61d6fe630f799d1
BLAKE2b-256 checksum
How to use checksums
4066289d6f7785678f4b567eee8cde0e3f7ab4696144fb448c596a918aa377d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

0.0.35 This release

2 release files

0.0.34

2 release files

0.0.33

2 release files

0.0.32

2 release files

0.0.30

2 release files

0.0.29

2 release files

0.0.28

2 release files

0.0.27

2 release files

0.0.26

2 release files

0.0.25

2 release files

0.0.24

2 release files

0.0.23

2 release files

0.0.22

2 release files

0.0.21

2 release files

0.0.20

2 release files

0.0.18

2 release files

0.0.16

2 release files

0.0.15

2 release files

0.0.14

2 release files

0.0.12

2 release files

0.0.11

2 release files

0.0.10

2 release files

0.0.9

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page