forked from finos/morphir
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/stephengoldbaum/morphir i…
…nto docs-build
- Loading branch information
Showing
8 changed files
with
355 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Morphir Documentation | ||
The purpose of the document is to provide a detailed explanation of how various Morphir code artefacts work. | ||
It also documents the standard coding practices adopted for the Morphir project. | ||
Finally, it provides a step by step walk-throughs on how various Morphir components are build. | ||
|
||
## Who this Guide Designed For | ||
Morphir has different components for different users. | ||
|
||
1. **[Morphir User's Guide](users-guide)** - Business users who would like to learn how to use Morphir for modelling business logic. | ||
2. **[Morphir Developer's Guide](developers-guide)** - New joiners to the Morphir project to get up to speed the various building blocks of Morphir. | ||
3. **[Morphir Contributor's Guide](contribution-guide)** - Existing team members intending to improve their abilities on Language Design concepts. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Media About Morphir | ||
|
||
If you're interested in learning more about the project, [Morphir Resource Centre](https://resources.finos.org/morphir/), has many links. | ||
|
||
| Episode | Description | | ||
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTYx"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/introduction-to-the-morphir-show.jpg"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTYx">Introduction to the Morphir Showcase</a> | | ||
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTYz"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/what-morphir-is-with-stephen-gol.jpg"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTYz">What Morphir is with Stephen Goldbaum</a> | | ||
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTY2"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/how-morphir-works-with-attila-mi-1.jpg"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTY2">How Morphir works with Attila Mihaly</a> | | ||
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTY4"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/why-morphir-is-important-with-co.jpg"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTY4">Why Morphir is Important – with Colin, James & Stephen</a> | | ||
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTcw"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/Screenshot-2022-03-02-at-14.35.18.png"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTcw">The Benefits & Use Case of Morphir with Jane, Chris & Stephen</a> | | ||
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTcy"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/how-to-get-involved-closing-pane.jpg"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTcy">How to get involved – Closing Panel Q&A</a> | | ||
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTU5"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/morphir-showcase-full-show.jpg"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTU5">Morphir Showcase – Full Show</a> | | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Custom attributes user guide | ||
The contents of this document detail how to structure and load optional "sidecar" files for the purposes of adding custom attributes to Morphir types and values. Custom attributes can assign extra information to business concepts that is otherwise not included in the Morphir IR. | ||
|
||
**Contents:** | ||
- [File format and naming convention](#file-format-and-naming-convention) | ||
- [Config file](#config-file) | ||
- [Attribute file](#attribute-file) | ||
- [Loading and updating the attribute files](#loading-and-updating-the-attribute-files) | ||
|
||
|
||
|
||
|
||
## File format, and naming convention | ||
To define a custom attribute, we need at least three JSON files. | ||
|
||
1. A config file named `attribute.conf.json` that lists the attribute ID's, and maps them to display names. | ||
2. At least one attribute file named `<someAttributeId>.json` in the `attributes`. | ||
3. An IR containing a type definitions | ||
|
||
### Config file | ||
``` | ||
{ | ||
"test-id-1": { | ||
"displayName" : "MS.Sensitivity" | ||
, "entryPoint" : "Morphir.Attribute.Model.Sensitivity.Sensitivity" | ||
, "ir" : "attributes/sensitivity.ir.json" | ||
} | ||
"test-id-2": { | ||
... | ||
} | ||
} | ||
``` | ||
The above example is a sample config file structure. The config file should contain key-value pairs in a JSON format, where the key is the attribute name, and the value is the attribute description. | ||
The attribute description should include an entrypoint in the form of an [FQName](https://package.elm-lang.org/packages/finos/morphir-elm/latest/Morphir.IR.FQName) (this is the type describing your custom attribute), a display name, and a path to the IR file containing your type model | ||
|
||
### Attribute file | ||
``` | ||
{ | ||
"Morphir.Reference.Model.Issues.Issue401:bar": { | ||
"MNPI": false, | ||
"PII": true | ||
}, | ||
"Morphir.Reference.Model.Issues.Issue401:foo": { | ||
"MNPI": false, | ||
"PII": false | ||
} | ||
} | ||
``` | ||
The above example is a sample attribute file structure. The attribute file should be a dictionary in a JSON format, where the keys are Morphir [FQName](https://package.elm-lang.org/packages/finos/morphir-elm/latest/Morphir.IR.FQName)s, and the values are any valid JSON object. | ||
|
||
|
||
## Loading and updating the attribute files | ||
We currently provide the following APIs. | ||
|
||
***GET /server/attributes/*** | ||
Returns the a JSON file with a very similar structure to the config file, but amended with `data` fields containing the actual custom attribute values, and the `ir` field containing the actual IR instead of a path pointing to it | ||
|
||
``` | ||
{ | ||
"test-id-1": { | ||
"displayName" : <displayName> | ||
, "entryPoint" : <FQName> | ||
, "ir" : "<a Morphir IR>" | ||
, "data" : <custom attribute dictionary> | ||
} | ||
"test-id-2": { | ||
... | ||
} | ||
} | ||
``` | ||
|
||
***POST /server/updateattribute/\<yourattributename>*** | ||
``` | ||
{ | ||
"nodeId" : <fqname>, | ||
"newAttribute: <JSON> | ||
} | ||
``` | ||
Updates the given node with the given new attribute. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# Morphir Users' Guide | ||
Morphir's core purpose is to collect and store the vital business logic of an application. To fulfull that goal, | ||
Morphir provides tools to write business logic, visualize and interac with it, and use it to generate useful things. | ||
|
||
## Who this Guide Designed For | ||
This guide is for business users, analysts, and developers who want to use Morphir to tap the potential in their business logic. | ||
|
||
## Content | ||
1. [Getting Setup](#) | ||
1. [Installation](installation.md) | ||
1. [Editor Setup](editor_setup.md) | ||
1. [The Morphir Tools](command_line_tools.md) | ||
1. [Compile](command_line_tools.md#Compile) | ||
1. [Visualize](command_line_tools.md#Visualize) | ||
1. [Generate](command_line_tools.md#Generate) | ||
<br/> | ||
<br/> | ||
|
||
[//]: # (1. [Quick Start]()) | ||
|
||
[//]: # ( 1. [Thinking in Morphir]()) | ||
|
||
[//]: # ( 1. [Describing the Business Domain]()) | ||
|
||
[//]: # ( 1. [Adding Logic]()) | ||
|
||
[//]: # ( 1. [Ensuring Correctness]()) | ||
|
||
[//]: # ( 1. [Testing]()) | ||
|
||
[//]: # ( 1. [Building, Executing, and Deploying]()) | ||
|
||
[//]: # (<br/>) | ||
|
||
[//]: # (<br/>) | ||
|
||
[//]: # () | ||
[//]: # (1. [Advanced Topics](#)) | ||
|
||
[//]: # ( 1. [More On Writing Business Logic](#)) | ||
|
||
[//]: # ( 1. [What Makes a Good Model](#)) | ||
|
||
[//]: # ( 1. [Modelling an Application](#)) | ||
|
||
[//]: # ( 1. [Modelling an API](#)) | ||
|
||
[//]: # ( 1. [Modelling the Local State](#)) | ||
|
||
[//]: # ( 1. [Modelling Remote State Dependencies](#)) | ||
|
||
[//]: # ( 1. [Modelling Decision Tables](#)) | ||
|
||
[//]: # ( 1. [Modelling for Database Developers](#)) | ||
|
||
[//]: # ( 1. [Execution](#)) | ||
|
||
[//]: # ( 1. [Complete Examples](#)) | ||
|
||
[//]: # ( 1. [A Simple Walkthrough - The Surfing Board Model](#)) | ||
|
||
[//]: # ( 1. [Overview](#)) | ||
|
||
[//]: # ( 1. [Installing Morphir](#)) | ||
|
||
[//]: # ( 1. [The First Logic](#)) | ||
|
||
[//]: # ( 1. [Generating Code](#)) | ||
|
||
[//]: # ( 1. [Use Case: US LCR](#)) | ||
|
||
[//]: # ( 1. [Modelling LCR](#)) | ||
|
||
[//]: # ( 1. [Modelling Calculations](#)) | ||
|
||
[//]: # ( 1. [Modelling Collection Operations](#)) | ||
|
||
[//]: # ( 1. [Modellng Structures](#)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
# Morphir Command Line Tools | ||
|
||
## Compile (Elm) | ||
Morphir revolves around the Intermediate Representation (IR), which is the data format for storing logic. | ||
Morphir users compile their business logic into the IR using morphir's compiler tools. For Elm-authored logic, | ||
is done through the following: | ||
|
||
```shell | ||
morphir-elm make | ||
``` | ||
|
||
Options include: | ||
```shell | ||
Usage: morphir-elm make [options] | ||
|
||
Translate Elm sources to Morphir IR | ||
|
||
Options: | ||
-p, --project-dir <path> Root directory of the project where morphir.json is located. (default: ".") | ||
-o, --output <path> Target file location where the Morphir IR will be saved. (default: "morphir-ir.json") | ||
-t, --types-only Only include type information in the IR, no values. (default: false) | ||
-f, --fallback-cli Full rebuild. (default: false) | ||
-h, --help display help for command | ||
``` | ||
|
||
## Visualize | ||
Morphir contains tools to interact with, learn, and test Morphir applications. This can be invoked via: | ||
|
||
```shell | ||
morphir-elm develop | ||
``` | ||
|
||
Options include: | ||
```shell | ||
Usage: morphir-elm develop [options] | ||
|
||
Start up a web server and expose developer tools through a web UI | ||
|
||
Options: | ||
-p, --port <port> Port to bind the web server to. (default: "3000") | ||
-o, --host <host> Host to bind the web server to. (default: "0.0.0.0") | ||
-i, --project-dir <path> Root directory of the project where morphir.json is located. (default: ".") | ||
-h, --help display help for command | ||
``` | ||
|
||
Note that the default http://0.0.0.0:3000 sometimes needs to be replaced with http://localhost:3000 | ||
depending on the host environment. | ||
|
||
|
||
## Generate | ||
Morphir provides tools to generate useful things from a Morphir IR. | ||
|
||
```shell | ||
morphir-elm gen | ||
``` | ||
|
||
Options include: | ||
```shell | ||
Usage: morphir-elm gen [options] | ||
|
||
Generate code from Morphir IR | ||
|
||
Options: | ||
-i, --input <path> Source location where the Morphir IR will be loaded from. (default: "morphir-ir.json") | ||
-o, --output <path> Target location where the generated code will be saved. (default: "./dist") | ||
-t, --target <type> Language to Generate (Scala | SpringBoot | cypher | triples | TypeScript). (default: "Scala") | ||
-m, --modules-to-include <comma.separated,list.of,module.names> Limit the set of modules that will be included. | ||
-h, --help display help for command | ||
``` | ||
|
||
### Generate Scala | ||
```shell | ||
morphir-elm gen -t Scala | ||
``` | ||
|
||
Options include: | ||
```shell | ||
-e, --target-version <version> Scala language version to Generate. (default: "2.11") | ||
-c, --copy-deps Copy the dependencies used by the generated code to the output path. (default: false) | ||
``` | ||
|
||
### Generate Json Schema | ||
```shell | ||
morphir-elm gen -t JsonSchema | ||
``` | ||
|
||
Options include: | ||
```shell | ||
-s, --include-codecs Generate JSON codecs (default: false) | ||
-f, --filename <filename> Filename of the generated JSON Schema. (default: "") | ||
``` | ||
|
||
### Generate TypeScript | ||
```shell | ||
morphir-elm gen -t TypeScript | ||
``` | ||
|
||
### Generate Turtle for semantic web technologies | ||
```shell | ||
morphir-elm gen -t semantic | ||
``` | ||
|
||
### Generate Cypher for graph databases | ||
```shell | ||
morphir-elm gen -t cypher | ||
``` |
Oops, something went wrong.