thepeergroup / aspen

Aspen is a markup language for turning text into graph data (via Cypher for Neo4j).

Home Page:https://aspen-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add query manager

beechnut opened this issue · comments

I'd like to add someplace—a queries.yml in an appropriate location—that stores plain-language queries and their Cypher equivalents. The CLI could then be used to run them, either by number or by text. There's templating built into it, so you can write a query for a specific person, etc.

$ aspen queries:list

1)  Who supervises the most people?
2)  Who does { Person } supervise?
3)  Order teams by psychological safety metrics.

$ aspen query 1
    > MATCH ... # Cypher goes here

Hickory

$ aspen query Who does Holly supervise?
    > MATCH ... # Cypher goes here

Magnolia
Cottonwood
Apple

The queries would be defined sort of like this, I imagine:

-
  name: Who does { Person } supervise?
  intake: Who does { Person a } supervise?
  query: |
    WITH (Person { name: {{{a}}} }) as supervisor ...