Skip to content

hestiaAI/Argonodes

Repository files navigation

Argonodes

Binder example workflow Technical documentation

Introduction

This package aims to facilitate the analysis of large data sets from various sources. The main objective is to allow to efficiently augment datasets, and to create models of them, in the form of JSON-LD frames, to then transform the raw data into JSON-LD, with notably the augmentation of information with semantics.

Why the name?

Because JSON explores with Argonodes!

Setup

This project requires Python 3.7+.

Quickstart: I directly want to use Argonodes

Note: In general, it is recommended to create a virtual environment before using Python packages. You can use python -m venv ./env then source ./env/bin/activate if needed.

  • You can simply use pip install -e git+ssh://git@github.com/hestiaAI/Argonodes.git#egg=argonodes. That's it.
  • You can also directly add -e git+ssh://git@github.com/hestiaAI/Argonodes.git#egg=argonode in the requirements.txt of your project.

Quickstart: I want to play with the examples of Argonodes

  1. Clone that repository and cd into it.
  2. (If not done already) Create a virtual environment: python -m venv ./env
  3. (If not done already) Activate that virtual environment: source ./env/bin/activate
  4. Install what is needed: pip install -r requirements/examples.txt
  5. Go inside the examples directory: cd examples
  6. Drink water, because it is important to stay hydrated.

Quickstart: I want to work on Argonodes

Note: Please read the Contributing part!

  1. Clone that repository and cd into it.
  2. (If not done already) Create a virtual environment: python -m venv ./env
  3. (If not done already) Activate that virtual environment: source ./env/bin/activate
  4. Install what is needed: pip install -r requirements/dev.txt
  5. Activate pre-commits: pre-commit install
  6. Remember that you probably have a cup of tea or coffee getting cold.

Usage example

You can find more information on how to use Argonodes in our wiki.

A worked example is available here. Make sure you followed the Quickstart if you want to play with it directly.

import json

filename = "/path/to/json/file.json"

# Load your raw data
with open(filename, "r") as jsonfile:
    json_data = json.loads(jsonfile.read())

# Create a Tree for exploration
from json_ld_semantics.semantics import Tree
tree = Tree(json_data)

# ... Do some work on the Tree

# Create a Model from the Tree
from json_ld_semantics.models import Model
model = Model(name="My model", trees=tree)

# ... Do some work on the Model

model.export_traversal(scheme="markdown")

Ugly working one liner

# This will create a Model to play with directly from raw data.
with open("input.json", "r") as json_file:
    model = Model(Tree(json.load(json_file)))

Contributing

First of all, thank you for taking the time to help this project, it means a lot.

Please read our CONTRIBUTING file, which contains guidelines, information on what you can do to help the project, and good practices to apply.

To sum-up: