thepeergroup / aspen

Aspen is a markup language for turning text into graph data (via Cypher for Neo4j).
https://aspen-lang.org
MIT License
62 stars 7 forks source link

Aspen Watch #3

Open beechnut opened 4 years ago

beechnut commented 4 years ago

Asking someone to compile a file over and over is...too much.

The CLI (Command Line Interface) should support two operations:

These commands might be available as:

$ aspen watch [file or directory] [-o --output file or directory to output to]
$ aspen watch [file or directory] [-d --database URL to Neo4j instance]

For database connections, if users want to iterate on their data, they may want to clear out the previous data so the database doesn't get cluttered with defunct entities. In order to populate the database idempotently without having to drop all the data every time, aspen watch should add a special attribute to every node and edge that indicates the element was created in an aspen watch session.

Whether data is linked to aspen watch as a whole, or a specific aspen watch session, that's up for discussion.

From Ansible:

Idempotency An operation is idempotent if the result of performing it once is exactly the same as the result of performing it repeatedly without any intervening actions.

Aspen Watch sounds like a forest safety thing, so here's a pretty image of a fire lookout watchtower from Firewatch:

Firewatch watchtower

beechnut commented 4 years ago

I've added an aspen watch command that watches files, compiles them, and optionally publishes them to a database.

To simulate idempotence, the --drop option deletes all the data in the database. So, as long as the instance data doesn't matter and everything is coming from Aspen, cool.

I'd like to have attributes added behind the scenes so that entities are linked to Aspen, a given aspen watch session, and/or perhaps specific source files. Linking to files may get tricky if you have a node coming from multiple files—you don't want to delete it, you just want to update it.