Ink Model URI Scheme
The Ink Model specification defines a way to use Uniform Resource Identifiers (URI) to reference nodes of the InkModel's primary ink-tree or views by specifying a scheme in accordance with the guidelines in RFC 3986.
URI Scheme
The specification uses the following terms as they are defined in RFC 3986:
- scheme
- authority
- path
- segment
- unreserved characters
- pchar
- pct-encoded characters
- fragment
The Ink Model specification provides a specific URI scheme for identification of InkModel nodes and other elements, using the following grammar:
- URI = "uim:" [ //authority ] [path] [#fragment]
- authority = skipped
- path = 1 * ( "/" segment )
- segment = 1 * ( pchar )
- fragment = optional
Remarks:
The URI's authority component is skipped. All path definitions in the table below are considered path-rootless according to RFC 3986.
The path component may begin with a segment containing a percent-encoded URI (defined in RFC 3986, Section 2.1: https://tools.ietf.org/html/rfc3986#section-2.1) that uniquely identifies an Ink Model. In case the InkModel's identification segment is skipped, the URI is used for local node referencing on Ink Model level and the URI is treated as local URI.
Important note: Implementations must encode URIs of entities, which belong to the serialized model, only in their local form (using local URIs).
Ink Model
Path:
<pct-encoded InkModel URI>/node/<node-id>
Fragment: n/a
Description: URI of a node, contained within an Ink Model. The
<pct-encoded InkModel URI>
segment contains a percent-encoded URI of an InkModel. This segment is optional. The<node-id>
segment contains an > > InkNode identifier, encoded as a GUID string value.Example: Suppose we have an InkNode with GUID 5454710e-608d-4eee-9552-680f3349ab3e, contained within the main ink tree or a view of an InkModel with URI https://example.com/inkmodel/9b67babb-a2a3-491b-96ce-71c820ce0c64, (provided by the provider https://example.com/).
URI of the InkNode in the InkModel's scope (local ID): uim:node/5454710e-608d-4eee-9552-680f3349ab3e
URI of the InkNode (globally unique): uim:https%3A%2F%2Fexample.com%2Finkmodel%2F9b67babb-a2a3-491b-96ce-71c820ce0c64/node/5454710e-608d-4eee-9552-680f3349ab3e
Named entities
Path:
<pct-encoded InkModel URI/>ne/<ne-id>
Fragment: n/a
Description: URI of a named entity definition, usually used to group knowledge about a specific InkModel node.
The
<pct-encoded InkModel URI>
segment contains a percent-encoded URI of an InkModel. This segment is optional. The<ne-id>
segment contains an identifier of a named entity definition.
MD5-hash based Unique Identifier Generation Algorithm
The described algorithm allows generation of unique identifiers based on a tag (encoded as string value) and a collection of components.
The supported component types are:
- Integer number
- Floating-point number
- String
- List of properties defined as key-value pairs; the key and value of a pair are considered to be of type string.
The algorithm is expressed in pseudocode below. The described method takes a tag value and a list of components as arguments and generates a unique MD5 hash as an 8-byte array.
METHOD generateMD5Hash(tag, components): RETURNS byte[8]
SET buffer = new StringBuffer()
buffer.write(tag)
buffer.write("\n")
FOREACH component OF components
IF (component is defined)
buffer.write(component.convertToString())
buffer.write("\n")
RETURN MD5_HASH(buffer.toString())
The convertToString()
method used in the pseudocode snippet above should be implemented as follows per each component type:
-
Integer number -
convertToString()
returns the string representation of the integer number -
Floating-point number -
convertToString()
returns the string representation of the floating-point number using fixed-point number representation with 4 digits after the decimal point -
String -
convertToString()
returns the string value -
List of properties -
convertToString()
pseudocode implementation:
METHOD convertToString(properties): RETURNS string
SET buffer = new StringBuffer()
properties = SORT(properties) // sort the properties list by ascending alphabetical name order
FOREACH pair OF properties
buffer.write(pair.name)
buffer.write("\n")
buffer.write(pair.value)
buffer.write("\n")
RETURN buffer.toString()
Vocabulary
Sensor Channel Types
The table below describes a list of common sensor channel types, defined as URIs, which are used to distinguish between different sensor characteristics.
URI | Description |
---|---|
will://input/3.0/channel/X | Sensor channel storing the x-coordinates on a surface or within 3D space. |
will://input/3.0/channel/Y | Sensor channel storing the y-coordinates on a surface or within 3D space. |
will://input/3.0/channel/Z | Sensor channel storing the y-coordinates within 3D space. |
will://input/3.0/channel/Timestamp | Sensor channel storing the time difference to the previous sample. |
will://input/3.0/channel/Pressure | Sensor channel storing the pressure applied on the pen tip. |
will://input/3.0/channel/RadiusX | Sensor channel storing the x-radius of a touch event. |
will://input/3.0/channel/RadiusY | Sensor channel storing the y-radius of a touch event. |
will://input/3.0/channel/Azimuth | Sensor channel storing the azimuth angle of a pen device. |
will://input/3.0/channel/Altitude | Sensor channel storing the altitude angle of a pen device. |
will://input/3.0/channel/Rotation | Sensor channel storing the barrel rotation of the pen device. |
Core Elements
The table below describes a list of WILL Core element types, defined as URIs.
URI | Description |
---|---|
will://core/3.0/core/Path | Ink stroke |
will://core/3.0/core/Sensordata | Sensor data |
will://core/3.0/core/Brush | Brush |
Common InkModel Views
The table below describes a list of known InkModel views.
URI | Description |
---|---|
will://views/3.0/HWR | Currently provided by the Semantic Ink Services. |
will://views/3.0/NER | Currently provided by the Semantic Ink Services. |
Remark This section is still in experimental state and the listed definitions may change.
Semantic
The table below describes a list of types and entities, used to store ontological knowledge definitions into the ink model's knowledge graph.
URI | Description |
---|---|
will://semantic/3.0/hasNamedEntityDefinition | Predicate the defines a dedicated entity storing named entity recognition (NER) results. |
will://semantic/3.0/hasSource | Predicate for the source of the knowledge graph. |
will://semantic/3.0/hasUri | Predicate for the URI within the knowledge graph. |
will://semantic/3.0/hasAbstract | Predicate for a short abstract to describe the entity. |
will://semantic/3.0/hasImage | Predicate for the image describing the semantic entity. |
will://semantic/3.0/hasThumb | Predicate for a thumbnail to the concept type. |
will://semantic/3.0/hasArticle | Predicate for a URL pointing to article about a semantic entity. |
will://semantic/3.0/hasType | Predicate for describing the type of the concept. |
will://semantic/3.0/hasCategory | Predicate for the category of the semantic entity. |
will://semantic/3.0/hasLabel | Predicate for label of the semantic entity. |
will://semantic/3.0/is | Predicate for best math from handwriting recogntion. |
will://semantic/3.0/hasAlt | Predicate for alternative recognition results. |
will://semantic/3.0/hasBBox | Predicate for bounding box of the recognized word. |
will://semantic/3.0/hasRelevantConcept | Predicate for relevant concept type if there are multiple types found by NER. |
Remark This section is still in experimental state and the listed definitions may change.
Content Segmentation
The table below describes a list of types and entities used to describe an ink model's structure in terms of content segmentation.
URI | Description |
---|---|
will://segmentation/3.0/TextRegion | Defining a larger region with text. |
will://segmentation/3.0/Paragraph | Groups text lines in a paragraph. |
will://segmentation/3.0/TextLine | Groups words in a text line. |
will://segmentation/3.0/Word | Groups ink strokes in a word. |
will://segmentation/3.0/Phrase | Groups words in a logical in a unit. |
will://segmentation/3.0/LineBreak | Defining a linebreak. |
will://segmentation/3.0/MathBlock | Grouping ink strokes to a math formula. |
will://segmentation/3.0/Shape | Grouping ink strokes to a shape. |
Remark This section is still in experimental state and the listed definitions may change.
Shapes
The table below describes a list of types and entities in terms of shape recognition and definition.
URI | Description |
---|---|
will://shapes/3.0/Rectangle | Groups ink strokes as a rectangle. |
will://shapes/3.0/Circle | Groups ink strokes as a circle. |
will://shapes/3.0/Ellipse | Groups ink strokes as a ellispe. |
will://shapes/3.0/Triangle | Groups ink strokes as a triangle. |
will://shapes/3.0/Doodle | Groups ink strokes as a doodle. |
will://shapes/3.0/Arc | Groups ink strokes as an arc. |
will://shapes/3.0/Line | Groups ink strokes as a line. |
will://shapes/3.0/Polygon | Groups ink strokes as a polygon. |
will://shapes/3.0/Parallelogram | Groups ink strokes as a parallelogram. |
will://shapes/3.0/Rhombus | Groups ink strokes as a rhombus. |
will://shapes/3.0/attr/points | Attribute describing a list of points. |
will://shapes/3.0/attr/pt | Attribute describing a single point. |
will://shapes/3.0/attr/pt1 | Attribute descibing the first point. |
will://shapes/3.0/attr/pt2 | Attribute descibing the second point. |
will://shapes/3.0/attr/pt3 | Attribute descibing the third point. |
will://shapes/3.0/attr/radius | Attribute describing the radius. |
will://shapes/3.0/attr/radiusX | Attribute describing the radius x. |
will://shapes/3.0/attr/radiusY | Attribute describing the radius y. |
will://shapes/3.0/attr/rect | Attribute describing a rectangle. |
will://shapes/3.0/attr/centerPoint | Attribute describing the center point. |
will://shapes/3.0/attr/angle | Attribute describing an angle. |
will://shapes/3.0/attr/phiAngle | Attribute describing a phi angle. |
will://shapes/3.0/attr/startAngle | Attribute describing a start angle. |
will://shapes/3.0/attr/sweepAngle | Attribute describing a sweep angle. |
Remark This section is still in experimental state and the listed definitions may change.