{"action":"created","comment":{"url":"https://api.github.com/repos/refractproject/refract-spec/pulls/comments/24626461","id":24626461,"diff_hunk":"@@ -0,0 +1,503 @@\n+# MSON Namespace\n+\n+This document extends [Refract][]'s [JSON Namespace][] with elements necessary to\n+build [MSON][] DOM.\n+\n+# Content\n+\n+This namespace defines following elements:\n+\n+1. General-use elements\n+    1. [Id Element](#id-element-distinct-element)\n+    1. [Distinct Element](#distinct-element-element)\n+    1. [Select](#select-distinct-element)\n+    1. [Option](#option-distinct-element)\n+\n+1. MSON DOM-specific elements\n+    1. [MSON Element](#mson-element-distinct-element)\n+    1. [Boolean Type](#boolean-type-jsonboolean-type)\n+    1. [String Type](#string-type-jsonstring-type)\n+    1. [Number Type](#number-type-jsonnumber-type)\n+    1. [Array Type](#array-type-jsonarray-type)\n+    1. [Object Type](#object-type-jsonobject-type)\n+    1. [Property Type](#property-type-jsonproperty-type)\n+    1. [Enum Type](#enum-type-mson-element)\n+\n+# Terminology\n+\n+This specification uses terminology from [MSON Specification][], in addition, bellow you can find the explanation of terms defined in this namespace.\n+\n+## Expanded Element\n+\n+MSON is built around the idea of defining recursive data structures. To provide abstraction, for convenience reasons and to not repeat ourselves these structures can be named (using an _identifier_) and reused. In MSON, the reusable data structures are called _Named Types_.\n+\n+Often, before an MSON DOM can be processed referenced _Named Types_ have to be resolved. Resolving references to _Named Types_ is tedious and error prone. As such parser can resolve references and produce a complete MSON DOM, that is a DOM that does not include unresolved references to other data structures. This is referred to as _reference expansion_ or simply _expansion_.\n+\n+In other words, an expanded element is such an element that does not contain _Identifier_ (defined bellow) to any other elements but those defined in JSON or MSON namespaces.\n+\n+The expanded DOM MUST, however, keeps the track of what data structure was expanded and what from where.\n+\n+## Base Element\n+\n+In MSON, every data structure is a sub-type of another data structure, and, in transition, it is directly or indirectly derived from one of the MSON _Base Types_. This is expressed as an inheritance of elements in MSON DOM. Where the predecessor of an element is referred to as element's _Base Element_.\n+\n+Note not every MSON _Base Type_ is presented in JSON namespace primitive types and vice versa, see the table bellow:\n+\n+### JSON Namespace vs. MSON built-in types\n+\n+| JSON primitive |   JSON Namespace   | MSON Base Type |   MSON Namespace   |\n+|:--------------:|:------------------:|:--------------:|:------------------:|\n+|     boolean    |  JSON:Boolean Type |     boolean    |  MSON:Boolean Type |\n+|     string     |  JSON:String Type  |     string     |  MSON:String Type  |\n+|     number     |  JSON:Number Type  |     number     |  MSON:Number Type  |\n+|      array     |   JSON:Array Type  |      array     |   MSON:Array Type  |\n+|        -       |          -         |      enum      |   MSON:Enum Type   |\n+|     object     |  JSON:Object Type  |     object     |  MSON:Object Type  |\n+|      null      |   JSON:Null Type   |        -       |          -         |\n+|        -       | JSON:Property Type |        -       | MSON:Property Type |\n+\n+\n+# General Elements Definition\n+\n+General elements defined inside MSON namespaces but possibly reusable in another domain.\n+\n+## Identifier (Enum)\n+\n+Identifier of an element in the MSON namespace. The identifier MUST be either directly a `string` value or an `Id Element` element.\n+\n+### Members\n+\n+- (string)\n+- (Id Element)\n+\n+## Id Element (Distinct Element)\n+\n+Element representing an identifier in the MSON namespace.\n+\n+### Properties\n+\n+- `element`: id (string, required, fixed)\n+- `content` (string, required)\n+\n+## Distinct Element (Element)\n+\n+Abstract element representing an element that can be referenced or is a reference to another element.\n+\n+### Properties\n+\n+- `element` (Identifier, required) - identifier of this element's base element\n+- `attributes`\n+    - `id` (Identifier) - identifier of this element\n+    - `ref` (Identifier) - reference to expanded element\n+\n+### Example\n+\n+```json\n+{\n+    \"element\": \"number\",\n+    \"attributes\": {\n+        \"id\": \"my-number\"\n+    },\n+    \"content\": 42\n+}\n+```\n+\n+which is identical to:\n+\n+```json\n+{\n+    \"element\": {\n+        \"element\": \"id\",\n+        \"content\": \"number\"\n+    },\n+    \"attributes\": {\n+        \"id\": \"my-number\"\n+    },\n+    \"content\": 42\n+}\n+```\n+\n+and can be referred to as a _base element_:\n+\n+```json\n+{\n+    \"element\": \"my-number\"\n+}\n+```\n+\n+which _expands_ to:\n+\n+```json\n+{\n+    \"element\": \"number\",\n+    \"attributes\": {\n+        \"ref\": \"my-number\"\n+    },\n+    \"content\": 42\n+}\n+```\n+\n+## Select (Distinct Element)\n+\n+Element representing selection of options. Every item of content array represents one possible option.\n+\n+### Properties\n+\n+- `element`: select (string, required, fixed)\n+- `content` (array[Option])\n+\n+## Option (Distinct Element)","path":"namespaces/mson-namespace.md","position":149,"original_position":149,"commit_id":"3973907ff4f250e969a5e843f67938d4b83c566b","original_commit_id":"3973907ff4f250e969a5e843f67938d4b83c566b","user":{"login":"fosrias","id":73336,"avatar_url":"https://avatars.githubusercontent.com/u/73336?v=3","gravatar_id":"","url":"https://api.github.com/users/fosrias","html_url":"https://github.com/fosrias","followers_url":"https://api.github.com/users/fosrias/followers","following_url":"https://api.github.com/users/fosrias/following{/other_user}","gists_url":"https://api.github.com/users/fosrias/gists{/gist_id}","starred_url":"https://api.github.com/users/fosrias/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fosrias/subscriptions","organizations_url":"https://api.github.com/users/fosrias/orgs","repos_url":"https://api.github.com/users/fosrias/repos","events_url":"https://api.github.com/users/fosrias/events{/privacy}","received_events_url":"https://api.github.com/users/fosrias/received_events","type":"User","site_admin":false},"body":"Lazy on formatting :p ","created_at":"2015-02-12T22:21:06Z","updated_at":"2015-02-12T22:21:06Z","html_url":"https://github.com/refractproject/refract-spec/pull/4#discussion_r24626461","pull_request_url":"https://api.github.com/repos/refractproject/refract-spec/pulls/4","_links":{"self":{"href":"https://api.github.com/repos/refractproject/refract-spec/pulls/comments/24626461"},"html":{"href":"https://github.com/refractproject/refract-spec/pull/4#discussion_r24626461"},"pull_request":{"href":"https://api.github.com/repos/refractproject/refract-spec/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/refractproject/refract-spec/pulls/4","id":29167971,"html_url":"https://github.com/refractproject/refract-spec/pull/4","diff_url":"https://github.com/refractproject/refract-spec/pull/4.diff","patch_url":"https://github.com/refractproject/refract-spec/pull/4.patch","issue_url":"https://api.github.com/repos/refractproject/refract-spec/issues/4","number":4,"state":"open","locked":false,"title":"MSON Namespace origin","user":{"login":"zdne","id":613617,"avatar_url":"https://avatars.githubusercontent.com/u/613617?v=3","gravatar_id":"","url":"https://api.github.com/users/zdne","html_url":"https://github.com/zdne","followers_url":"https://api.github.com/users/zdne/followers","following_url":"https://api.github.com/users/zdne/following{/other_user}","gists_url":"https://api.github.com/users/zdne/gists{/gist_id}","starred_url":"https://api.github.com/users/zdne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zdne/subscriptions","organizations_url":"https://api.github.com/users/zdne/orgs","repos_url":"https://api.github.com/users/zdne/repos","events_url":"https://api.github.com/users/zdne/events{/privacy}","received_events_url":"https://api.github.com/users/zdne/received_events","type":"User","site_admin":false},"body":"This PR introduces MSON namespace – a minimal set of elements needed to replace existing [MSON AST](https://github.com/apiaryio/mson-ast) with the element-based MSON DOM. \r\n\r\nThe Namespace is split into two parts: \r\n\r\n1. General used elements – elements that, in my opinion, may be used outside of the MSON domain\r\n2. MSON DOM specific elements.\r\n\r\nPlease pay close attention to the `Distinct Element` as I believe this is the \"future proof\" element type concept that enables us to do referencing including namespaces. Note it is out of the scope of this specification to solve the namespaces of element identifiers. The `Distinct Element` element, however, is designed with future element identifier namespaces in mind. It should be possible to solve it by adding `namespace`, `prefix` and possibly `class` attributes to the `Distinct Element` attributes. I am open to discuss this as part of this PR, but it is not as important as providing SDKs based on this new MSON DOM structure.\r\n\r\n","created_at":"2015-02-12T10:35:35Z","updated_at":"2015-02-12T22:21:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"79de11ad08262cfbc855a494d3cfc0fc4da7625d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/refractproject/refract-spec/pulls/4/commits","review_comments_url":"https://api.github.com/repos/refractproject/refract-spec/pulls/4/comments","review_comment_url":"https://api.github.com/repos/refractproject/refract-spec/pulls/comments/{number}","comments_url":"https://api.github.com/repos/refractproject/refract-spec/issues/4/comments","statuses_url":"https://api.github.com/repos/refractproject/refract-spec/statuses/3973907ff4f250e969a5e843f67938d4b83c566b","head":{"label":"refractproject:zdne/mson-namespace","ref":"zdne/mson-namespace","sha":"3973907ff4f250e969a5e843f67938d4b83c566b","user":{"login":"refractproject","id":10877387,"avatar_url":"https://avatars.githubusercontent.com/u/10877387?v=3","gravatar_id":"","url":"https://api.github.com/users/refractproject","html_url":"https://github.com/refractproject","followers_url":"https://api.github.com/users/refractproject/followers","following_url":"https://api.github.com/users/refractproject/following{/other_user}","gists_url":"https://api.github.com/users/refractproject/gists{/gist_id}","starred_url":"https://api.github.com/users/refractproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refractproject/subscriptions","organizations_url":"https://api.github.com/users/refractproject/orgs","repos_url":"https://api.github.com/users/refractproject/repos","events_url":"https://api.github.com/users/refractproject/events{/privacy}","received_events_url":"https://api.github.com/users/refractproject/received_events","type":"Organization","site_admin":false},"repo":{"id":30396674,"name":"refract-spec","full_name":"refractproject/refract-spec","owner":{"login":"refractproject","id":10877387,"avatar_url":"https://avatars.githubusercontent.com/u/10877387?v=3","gravatar_id":"","url":"https://api.github.com/users/refractproject","html_url":"https://github.com/refractproject","followers_url":"https://api.github.com/users/refractproject/followers","following_url":"https://api.github.com/users/refractproject/following{/other_user}","gists_url":"https://api.github.com/users/refractproject/gists{/gist_id}","starred_url":"https://api.github.com/users/refractproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refractproject/subscriptions","organizations_url":"https://api.github.com/users/refractproject/orgs","repos_url":"https://api.github.com/users/refractproject/repos","events_url":"https://api.github.com/users/refractproject/events{/privacy}","received_events_url":"https://api.github.com/users/refractproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/refractproject/refract-spec","description":"Specification Repository for Refract","fork":false,"url":"https://api.github.com/repos/refractproject/refract-spec","forks_url":"https://api.github.com/repos/refractproject/refract-spec/forks","keys_url":"https://api.github.com/repos/refractproject/refract-spec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/refractproject/refract-spec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/refractproject/refract-spec/teams","hooks_url":"https://api.github.com/repos/refractproject/refract-spec/hooks","issue_events_url":"https://api.github.com/repos/refractproject/refract-spec/issues/events{/number}","events_url":"https://api.github.com/repos/refractproject/refract-spec/events","assignees_url":"https://api.github.com/repos/refractproject/refract-spec/assignees{/user}","branches_url":"https://api.github.com/repos/refractproject/refract-spec/branches{/branch}","tags_url":"https://api.github.com/repos/refractproject/refract-spec/tags","blobs_url":"https://api.github.com/repos/refractproject/refract-spec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/refractproject/refract-spec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/refractproject/refract-spec/git/refs{/sha}","trees_url":"https://api.github.com/repos/refractproject/refract-spec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/refractproject/refract-spec/statuses/{sha}","languages_url":"https://api.github.com/repos/refractproject/refract-spec/languages","stargazers_url":"https://api.github.com/repos/refractproject/refract-spec/stargazers","contributors_url":"https://api.github.com/repos/refractproject/refract-spec/contributors","subscribers_url":"https://api.github.com/repos/refractproject/refract-spec/subscribers","subscription_url":"https://api.github.com/repos/refractproject/refract-spec/subscription","commits_url":"https://api.github.com/repos/refractproject/refract-spec/commits{/sha}","git_commits_url":"https://api.github.com/repos/refractproject/refract-spec/git/commits{/sha}","comments_url":"https://api.github.com/repos/refractproject/refract-spec/comments{/number}","issue_comment_url":"https://api.github.com/repos/refractproject/refract-spec/issues/comments/{number}","contents_url":"https://api.github.com/repos/refractproject/refract-spec/contents/{+path}","compare_url":"https://api.github.com/repos/refractproject/refract-spec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/refractproject/refract-spec/merges","archive_url":"https://api.github.com/repos/refractproject/refract-spec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/refractproject/refract-spec/downloads","issues_url":"https://api.github.com/repos/refractproject/refract-spec/issues{/number}","pulls_url":"https://api.github.com/repos/refractproject/refract-spec/pulls{/number}","milestones_url":"https://api.github.com/repos/refractproject/refract-spec/milestones{/number}","notifications_url":"https://api.github.com/repos/refractproject/refract-spec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/refractproject/refract-spec/labels{/name}","releases_url":"https://api.github.com/repos/refractproject/refract-spec/releases{/id}","created_at":"2015-02-06T05:26:21Z","updated_at":"2015-02-06T13:57:01Z","pushed_at":"2015-02-12T10:27:38Z","git_url":"git://github.com/refractproject/refract-spec.git","ssh_url":"git@github.com:refractproject/refract-spec.git","clone_url":"https://github.com/refractproject/refract-spec.git","svn_url":"https://github.com/refractproject/refract-spec","homepage":null,"size":0,"stargazers_count":2,"watchers_count":2,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":2,"default_branch":"master"}},"base":{"label":"refractproject:master","ref":"master","sha":"f94e76a2ccd83019782ec40519b93f9544934dae","user":{"login":"refractproject","id":10877387,"avatar_url":"https://avatars.githubusercontent.com/u/10877387?v=3","gravatar_id":"","url":"https://api.github.com/users/refractproject","html_url":"https://github.com/refractproject","followers_url":"https://api.github.com/users/refractproject/followers","following_url":"https://api.github.com/users/refractproject/following{/other_user}","gists_url":"https://api.github.com/users/refractproject/gists{/gist_id}","starred_url":"https://api.github.com/users/refractproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refractproject/subscriptions","organizations_url":"https://api.github.com/users/refractproject/orgs","repos_url":"https://api.github.com/users/refractproject/repos","events_url":"https://api.github.com/users/refractproject/events{/privacy}","received_events_url":"https://api.github.com/users/refractproject/received_events","type":"Organization","site_admin":false},"repo":{"id":30396674,"name":"refract-spec","full_name":"refractproject/refract-spec","owner":{"login":"refractproject","id":10877387,"avatar_url":"https://avatars.githubusercontent.com/u/10877387?v=3","gravatar_id":"","url":"https://api.github.com/users/refractproject","html_url":"https://github.com/refractproject","followers_url":"https://api.github.com/users/refractproject/followers","following_url":"https://api.github.com/users/refractproject/following{/other_user}","gists_url":"https://api.github.com/users/refractproject/gists{/gist_id}","starred_url":"https://api.github.com/users/refractproject/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/refractproject/subscriptions","organizations_url":"https://api.github.com/users/refractproject/orgs","repos_url":"https://api.github.com/users/refractproject/repos","events_url":"https://api.github.com/users/refractproject/events{/privacy}","received_events_url":"https://api.github.com/users/refractproject/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/refractproject/refract-spec","description":"Specification Repository for Refract","fork":false,"url":"https://api.github.com/repos/refractproject/refract-spec","forks_url":"https://api.github.com/repos/refractproject/refract-spec/forks","keys_url":"https://api.github.com/repos/refractproject/refract-spec/keys{/key_id}","collaborators_url":"https://api.github.com/repos/refractproject/refract-spec/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/refractproject/refract-spec/teams","hooks_url":"https://api.github.com/repos/refractproject/refract-spec/hooks","issue_events_url":"https://api.github.com/repos/refractproject/refract-spec/issues/events{/number}","events_url":"https://api.github.com/repos/refractproject/refract-spec/events","assignees_url":"https://api.github.com/repos/refractproject/refract-spec/assignees{/user}","branches_url":"https://api.github.com/repos/refractproject/refract-spec/branches{/branch}","tags_url":"https://api.github.com/repos/refractproject/refract-spec/tags","blobs_url":"https://api.github.com/repos/refractproject/refract-spec/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/refractproject/refract-spec/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/refractproject/refract-spec/git/refs{/sha}","trees_url":"https://api.github.com/repos/refractproject/refract-spec/git/trees{/sha}","statuses_url":"https://api.github.com/repos/refractproject/refract-spec/statuses/{sha}","languages_url":"https://api.github.com/repos/refractproject/refract-spec/languages","stargazers_url":"https://api.github.com/repos/refractproject/refract-spec/stargazers","contributors_url":"https://api.github.com/repos/refractproject/refract-spec/contributors","subscribers_url":"https://api.github.com/repos/refractproject/refract-spec/subscribers","subscription_url":"https://api.github.com/repos/refractproject/refract-spec/subscription","commits_url":"https://api.github.com/repos/refractproject/refract-spec/commits{/sha}","git_commits_url":"https://api.github.com/repos/refractproject/refract-spec/git/commits{/sha}","comments_url":"https://api.github.com/repos/refractproject/refract-spec/comments{/number}","issue_comment_url":"https://api.github.com/repos/refractproject/refract-spec/issues/comments/{number}","contents_url":"https://api.github.com/repos/refractproject/refract-spec/contents/{+path}","compare_url":"https://api.github.com/repos/refractproject/refract-spec/compare/{base}...{head}","merges_url":"https://api.github.com/repos/refractproject/refract-spec/merges","archive_url":"https://api.github.com/repos/refractproject/refract-spec/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/refractproject/refract-spec/downloads","issues_url":"https://api.github.com/repos/refractproject/refract-spec/issues{/number}","pulls_url":"https://api.github.com/repos/refractproject/refract-spec/pulls{/number}","milestones_url":"https://api.github.com/repos/refractproject/refract-spec/milestones{/number}","notifications_url":"https://api.github.com/repos/refractproject/refract-spec/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/refractproject/refract-spec/labels{/name}","releases_url":"https://api.github.com/repos/refractproject/refract-spec/releases{/id}","created_at":"2015-02-06T05:26:21Z","updated_at":"2015-02-06T13:57:01Z","pushed_at":"2015-02-12T10:27:38Z","git_url":"git://github.com/refractproject/refract-spec.git","ssh_url":"git@github.com:refractproject/refract-spec.git","clone_url":"https://github.com/refractproject/refract-spec.git","svn_url":"https://github.com/refractproject/refract-spec","homepage":null,"size":0,"stargazers_count":2,"watchers_count":2,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/refractproject/refract-spec/pulls/4"},"html":{"href":"https://github.com/refractproject/refract-spec/pull/4"},"issue":{"href":"https://api.github.com/repos/refractproject/refract-spec/issues/4"},"comments":{"href":"https://api.github.com/repos/refractproject/refract-spec/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/refractproject/refract-spec/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/refractproject/refract-spec/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/refractproject/refract-spec/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/refractproject/refract-spec/statuses/3973907ff4f250e969a5e843f67938d4b83c566b"}}}}