robvandenbogaard / elm-terminusdb / TerminusDb

This module provides types and helpers for building url paths to data on a TerminusDB server.

databasePath : Database -> List String

Constructs a list of url path segments for selecting the specified database.

graphPath : Graph -> List String

Helper function for contructing the graph segements of a db url.

graphType : GraphType -> String

Returns the name (string) of the GraphType provided.

reference : RepoReference -> List String

Helper for constructing repository reference url segments of a db url.

withRef : RepoReference -> List String -> List String

Helper for adding repository reference url segments to a list of url segments.


type Database
    = Terminus
    | System
    | Database String String

The Database type includes the system databases and user created ones. User databases are prefixed by an account name, often the name of the associated organisation.


type Graph
    = MainGraph GraphType
    | CustomGraph String GraphType

Within one database multiple data Graphs can coexist, defaulting to a single MainGraph with subgraphs for instances, the schema and inferences. Any additional graphs are described by CustomGraph values, taking a name String and a subgraph type (Instance, Schema or Inference).


type GraphType
    = Instance
    | Schema
    | Inference

Instance represents the instance graph which holds the actual content data in the graph database, where a Schema graph describes the constraints the data should adhere to (the types). I guess I need to read more on or ask around about Inference graphs, because I realise I don't exactly know their role.


type RepoReference
    = Local Reference
    | Remote String Reference

Represents a Local or Remote repository with branch/commit.


type Reference
    = Main
    | Branch String
    | Commit String

Represents a branch or specific commit.