Giter Site home page Giter Site logo

best-practices's Introduction

best-practices

A repo where we share/explore best/common/recommended practices when using ALPS

State

A semantic descriptor that is a web page contains other semantic descriptors and they are linked to each other. Such a page semantic descriptor is represented by an upper camel case.

  "id": "BlogPosting", "type": "semantic", "def": "https://schema.org/BlogPosting",
  "descriptor": [
    {"href": "#id"}, 
    {"href": "#articleBody"}, 
    {"href": "#dateCreated"},
    {"href": "#blog"}
  ]

Safe state transition

A simple safe request is represented by appending a go prefix to the descriptor of the next transition destination.

  {"id": "goHome", "type": "safe", "rt": "#Home"},
  {"id": "goFirst", "type": "safe", "rt": "#TodoList"},
  {"id": "goPrevious", "type": "safe", "rt": "#TodoList"},

@mamund -- I also use "doCreate" and "doUpdate" for unsafae and idempotent actions"

ALPS file structure

The description of the ALPS descriptor is divided into the following three blocks, which are represented in the following order.

  1. semantic descriptors for word definitions with def or doc (ontology)
  2. semantic descriptor group for inclusion relations (taxonomy)
  3. semantic descriptors for state transitions (coreography)
descriptor" : [
    {"id" : "name", "type" : "semantic", "def": "http://schema.org/identifier"},
    {"id" : "age", "type" : "semantic", "def": "http://schema.org/title"},

    {"id" : "Person", "type": "semantic", "descriptor":
        [
          {"href": "#name"},
          {"href": "#age"}
        ]
    }
    
    {"id": "goPerson", "type": "safe", "rt": "#Person"},
]

Hierarchical structures outside ALPS

ALPS can represent hierarchical meanings by position.

"descriptor": [
    {"id": "name", "def": "https://schema.org/name"},
    {"id": "product", "descriptor":[{"href": "#name"}]}
    {"id": "person", "descriptor":[{"href": "#name"}]}
]

In the above example, name is shared with product/name and person/name. The basic rule is to follow the practices of each format when representing such words in a format with only a flat hierarchy.

  • In the html case, it is represented by the Lower camel case.
<form>
    <input name="productName" type="text">
    <input name="personName" type="text">
</form>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.