Languages used for writing SAMO metadata
Level: Catalog
Keywords: json, xml, JavaScript, Markdown
The result: overview of json notation, xml and Markdown language, JavaScript
For writing SAMO metadata you need to understand basics of the following languages (notations):
- JSON
- XML
- JavaScript
- Markdown
What is JSON?​
In SAMO, most of the implementation is done by writing a series of JSON files with specific configurations. JavaScript Object Notation (JSON) is an open-standard file format or data interchange format that uses human-readable text to transmit data objects consisting of key–value pairs and array data types (or any other serializable value).
{
"key" : "value",
"key" : {
"key2" : "value2"
},
"key" : [{
"key2" : "value"
}]
}
JSON's basic data types are:
- Number: a signed decimal number that may contain a fractional part and may use exponential E notation, but cannot include non-numbers such as NaN. The format makes no distinction between integer and floating-point.
- String: a sequence of zero or more Unicode characters. Strings are delimited with double-quotation marks and support a backslash escaping syntax. In SAMO Platform we also use more complicated Specific String Types
- Boolean: either of the values true or false
- Array: an ordered list of zero or more values, each of which may be of any type. Arrays use square bracket notation '[ ]' with comma-separated elements.
- Object: an unordered collection of name–value pairs where the names (also called keys) are strings. Objects are intended to represent associative arrays, where each key is unique within an object. Objects are delimited with curly brackets '{ }' and use commas to separate each pair, while within each pair the colon character ':' separates the key or name from its value.
- null: an empty value, using the word null
{
"firstName": "John",
"lastName": "Smith",
"isAlive": true,
"age": 27,
"address": {
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": "10021-3100"
},
"phoneNumbers": [
{
"type": "home",
"number": "212 555-1234"
},
{
"type": "office",
"number": "646 555-4567"
},
{
"type": "mobile",
"number": "123 456-7890"
}
],
"children": [],
"spouse": null
}
What is XML?​
Extensible Markup Language (XML) is a markup language and file format for storing, transmitting, and reconstructing arbitrary data.
You need to understand the basics of XML in order to write and edit LIDS metadata for SAMO Platform. We use our own XML schema and according validations (through LIDS Administrator Console), which is described in detail in the LIDS Metadata Reference Manual.
What is JavaScript?​
JavaScript is a high-level, often just-in-time compiled language that conforms to the ECMAScript standard. It has dynamic typing, prototype-based object-orientation, and first-class functions. It is multi-paradigm, supporting event-driven, functional, and imperative programming styles.
You need to understand the basics of JavaScript in order to write business actions for SAMO Platform. For this purpose we don't use simple JavaScript, but our Business Scripting API, a library consisting of predefined functions and calls.
What is Markdown?​
For a very nice introduction on Markdown you can read this Markdown Guide.
In SAMO Platform we use Markdown markup language to write release notes, or other web page contents. For example User Guides (such as this Cookbook) are also written in Markdown using a technology called Docusaurus, which in addition enables extension of simple Markdown with interactive elements and builds up the whole site structure.