devicemap-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Apache Wiki <wikidi...@apache.org>
Subject [Devicemap Wiki] Update of "DataSpec2" by rezan
Date Mon, 03 Aug 2015 23:03:28 GMT
Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Devicemap Wiki" for change notification.

The "DataSpec2" page has been changed by rezan:
https://wiki.apache.org/devicemap/DataSpec2?action=diff&rev1=60&rev2=61

  <<TableOfContents(2)>>
  
  = Data Specification 2.0 =
- Draft 1, 2015-08-01
+ Draft 1, 2015-08-03
  
  This is the Device``Map Data specification for patterns and attributes.
  
@@ -431, +431 @@

  
  Clients can be contributed to the Device``Map project. They will be reviewed, tested, and
then voted on.
  There will only be 1 official client per language/platform. If a client does not exist for
a given language/platform,
- then contributing one is highly encouraged. If a client exists, then bugs, improvements,
and features should be directed
+ then contributing one is highly encouraged. If a client exists, then bugs, improvements,
features, and/or rewrites should be directed
  to said client.
  
  
  
  = Format =
  
- The pattern and attribute files are JSON objects. These files will contain:
+ The pattern, attribute, and test files are JSON objects. All files will contain:
  
   * Specification version
-  * Type (pattern, attribute, etc)
+  * Type (pattern, attribute, test)
   * Domain name
   * Domain version
   * Description
   * Publish date
  
+ 
- === Pattern File ===
+ == Pattern File ==
  
  {{{
  {
    "specVersion": 2.0,
-   "type": "pattern|attribute",
+   "type": "pattern|patternPatch",
    "domain": "example",
    "domainVersion": "1.0",
-   "description": "this is an example",
+   "description": "this is an example pattern file",
    "publishDate": "2015-06-19T09:17:37Z",
    "inputParser": { InputParser },
    "patternSet": { PatternSet },
-   "attributes": [ { Attribute } ]
+   "attributes": [ { Attribute }, { Attribute }, ... ]
  }
  }}}
  
@@ -471, +472 @@

  
  {{{
  {
-   "transformers": [ { Transformer } ],
+   "transformers": [ { Transformer }, { Transformer }, ... ],
    "tokenSeperators": [ "1", "two", "3" ],
    "ngramConcatSize": 2
  }
@@ -484, +485 @@

  {
    "defaultId": "someid",
    "simpleHashCount": 1400,
-   "patterns" [ { Pattern } ]
+   "patterns" [ { Pattern }, { Pattern }, ... ]
  }
  }}}
  
@@ -499, +500 @@

    "rankType": "Strong|Weak|None",
    "rankValue": 150,
    "patternType": "SimpleOrderedAnd|SimpleAnd|Simple",
-   "patternTokens" [ "token1", "token2", "token3" ]
+   "patternTokens" [ "token1", "token2", "token3", ... ]
  }
  }}}
  
  
+ === Transformer ===
- NOTE: the JSON spec is a work in progress. Please see SVN for the latest.
- When the reference domains and reference client have been finalized, this document will
be updated.
  
+ {{{
+ {
+   "type": "UpperCase|LowerCase|IsNumber|ReplaceAll|...",
+   "parameters":
+   {
+     "param1": "value1",
+     "param2": "value2",
+     ...
+   }
+ }
+ }}}
+ 
+ 
+ == Attribute File ==
+ 
+ {{{
+ {
+   "specVersion": 2.0,
+   "type": "attribute|attributePatch",
+   "domain": "example",
+   "domainVersion": "1.0",
+   "description": "this is an example attribute file",
+   "publishDate": "2015-06-19T09:17:37Z",
+   "attributes": [ { Attribute }, { Attribute }, ... ]
+ }
+ }}}
+ 
+ 
+ === Attribute ===
+ 
+ {{{
+ {
+   "patternId": "somePatternId",
+   "parentId": "somePatternId",
+   "attributes":
+   {
+     "attribute1": "value1",
+     "attribute2": "value2",
+     ...
+   },
+   "attributeTransformers":
+   {
+     "transformedAttribute1": { TransformedAttribute },
+     "transformedAttribute2": { TransformedAttribute },
+     ...
+   }
+ }
+ }}}
+ 
+ 
+ === TransformedAttribute ===
+ 
+ {{{
+ {
+   "defaultValue": "some default value",
+   "transformers": [ { Transformer }, { Transformer }, ... ]
+ }
+ }}}
+ 
+ 
+ == Test File ==
+ 
+ {{{
+ {
+   "specVersion": 2.0,
+   "type": "test",
+   "domain": "example",
+   "domainVersion": "1.0",
+   "description": "this is an example test file",
+   "publishDate": "2015-06-19T09:17:37Z",
+   "tests": [ { Test }, { Test }, ... ]
+ }
+ }}}
+ 
+ 
+ === Test ===
+ 
+ {{{
+ {
+   "input": "some input string",
+   "resultPatternId": "somePatternId",
+   "resultAttributes":
+   {
+     "attribute1": "value1",
+     "attribute2": "value2",
+     ...
+   }
+ }
+ }}}
+ 

Mime
View raw message