-
Notifications
You must be signed in to change notification settings - Fork 27
Comparison of ways to use vocabulary in content
This relates to the issue Does personalization semantics work as an ARIA module?. Below are proposed approaches to use personalization semantics in content, with pros and cons for host languages, authors, and user agents. At the bottom is a direct comparison of the approaches by various characteristics.
- RDFa
- HTML Microdata
- ARIA-* Attributes
- **AUI-* Attributes A change may be to have the same attributes without the prefex or will change the prefix - shortlist item **
- Single Attribute
- Single Attribute (alternative (CSS-style) notation) - was shortlist item - removed from short list from tpac
- Single Attribute for tokens plus extra attribute for text (alternative (CSS-style) notation and extra attributes for text or when needed) - was shortlist item - removed from short list from tpac
- **NEW 3 attributes - one for tokens, one for text, one for URI - similar too above but without the css notation **
- Value Pairs
- Native Host language Features - long term preference
- JavaScript Object
- **Dataset(s) (data-*) - shortlist item? removed from tpac **
Note that the Related-vocabularies page mentions microformats (which are distinct from microdata).
Use RDFa to attach personalization semantics to content. Requires a namespace URI which is proposed to be https://www.w3.org/ns/aui/
.
Associated Issue #53
Example: Action property in HTML using RDFa without prefix
<html>
<body vocab="https://www.w3.org/ns/aui/">
<button property="action" content="undo">Revert</button>
</body>
</html>
Example: Action property in HTML using RDFa with prefix
<html>
<body prefix="aui: https://www.w3.org/ns/aui/">
<button property="aui:action" content="undo">Revert</button>
</body>
</html>
Pros | Cons | |
---|---|---|
Host Languages |
|
|
Authors |
|
|
User Agents |
|
|
Support for different fetures |
|
|
Use HTML Microdata to attach personalization semantics to content. Requires a vocabulary identification URI which is proposed to be https://www.w3.org/ns/aui/
.
Example: Action property in HTML using HTML Microdata
<button itemscope itemtype="https://www.w3.org/ns/aui/"
itemprop="action" content="undo">Revert</button>
Pros | Cons | |
---|---|---|
Host Languages |
|
|
Authors |
|
|
User Agents |
|
|
Support for different features |
|
|
Apply properties to content with attributes whose name is the property name prefixed by "aria-". Requires approval from the ARIA Working Group to create these attributes.
Associated Issue 54
Example: Undo action with aria attribute
<button aria-action="undo">Revert</button>
Pros | Cons | |
---|---|---|
Host Languages |
|
|
Authors |
|
|
User Agents |
|
|
Support for different fetures |
|
|
Apply properties to content with attributes whose name is the property name prefixed by "aui-". Requires approval from the Web Platform Working Group to create these attributes in HTML.
Associated Issue #33 - I believe this Issue may be able to be closed.
Example: Undo action with aui attribute
<button aui-action="undo">Revert</button>
Pros | Cons | |
---|---|---|
Host Languages |
|
|
Authors |
|
|
User Agents |
|
|
Apply all properties to content via values of a single new attribute, placeholder name purpose
. In order to cram both properties and values into a single attribute value, property names and values would have to be concatenated, or the vocabulary rejiggered (directly or via mapping algorithm) to avoid use of values.
Example: Undo action in purpose attribute with concatenated value
<button purpose="action-undo">Revert</button>
Example: Undo action in purpose attribute with came case value
<button purpose="undoAction">Revert</button>
Example: Undo action in purpose attribute with valueless property as value
<button purpose="undo">Revert</button>
Example: Undo action in purpose attribute with valueless property as value, and prefix
<button purpose="aui-undo">Revert</button>
Pros | Cons | |
---|---|---|
Host Languages |
|
|
Authors |
|
|
User Agents |
|
|
User Agents |
|
|
Support for different features |
|
|
Apply all properties to content via values of a single new attribute, placeholder name purpose
.
To accommodate the different types of values (which can be one of "string value", "token" (from a fixed list), or "URI"), this ideas proposes to use notation similar to inline CSS. While a completely new idea, text strings would be enclosed in ('text string') as part of the proposed new notation, and urls would borrow from the same pattern as CSS: url('path to file')
; in either instance with or without the single '.
Example: Undo action in purpose attribute with concatenated values
<button purpose="action:undo; easylang:('Undo')">Return to the previous design</button>
Example: Form input(s)
<input type="text" name="telnum" aria-required="true"
purpose="field:password; moreinfo:url('PasswordFAQ.html');
symbol:url('images/helpicon.png'); importance:critical;"/>
Example: Link to more help (with alternative icon support)
<a href="" purpose="destination:help; easylang:('Get Help');
messageimportance:critical; symbol:url('images/helpicon.png');
extrahelp:url('extrahelp.html');">Still having trouble?</button>
Pros | Cons | |
---|---|---|
Host Languages |
|
|
Authors |
|
|
User Agents |
|
|
User Agents |
|
|
Single Attribute with extra attributes for text content
(alternative notation: CSS-Style declaration of key/value pairs)
Apply all properties that give tokens to content via values of a single new attribute, placeholder name purpose
.
purpose="simplification:critical; field:familyName" easylang="Last name"
To accommodate the different types of values fromm "token" (from a fixed list), or "URI"), this ideas proposes to use notation similar to inline CSS. Like the idea above, and urls would borrow from the same pattern as CSS: url('path to file')
; in either instance with or without the single '.
However, unlike the above option string values may have a separate attribute
This has the advatage of making it easy to add a simple text or number free equivelent text. (a concern for the single attribute is that it is easy to make errors - This may be more of a problem for content authors with learning disabilities
3 attributes: Attribute for tokens, attribute for URIs and attribute for text
Apply all properties that give tokens to content via values of a single new attribute, placeholder name context
.
All text is added in a second attribute placeholder name easylang
. more then one entery can be seperated by a space
URIs are in a a third attribute placeholder name refrences
.
context="critical fieldFamilyName" easylang="Last name" refrences="blis.org/1046236"
Issues: does it fit with all the bellow? Is it confusing and will make author errors
Tokens (from https://raw.githack.com/w3c/personalization-semantics/value-list/vocabulary-list/index.html )
- 2.1.1 action
- 2.1.2.destination
- 2.1.3field
- 2.1.4simplification
- 2.1.5distraction
- 2.2.1.1Values for alternative content and content accessibility support
- 2.2.1.2Values for types of help
- Status (from Step Indicator Usage)
- 2.3.2.1messageimportance
URI’s
- 2.1.6symbol
- 2.2.2.2.6moreinfo
- 2.2.2.2.7extrahelp
- 2.2.2.2.7.1Description
- Steplocation – could we use href instied? (from Step Indicator Usage)
Text
- 2.2.2.2.1literal
- 2.2.2.2.2numerfree
- 2.2.2.2.4explain
- 2.2.2.2.5feedback
- 2.2.2.2.3easylang
- 2.3.2.2messagefrom
- 2.3.2.3messagecontext
- 2.3.2.4messagetime (restricted)
- Step (from Step Indicator Usage) numeric
Apply properties to content via values of a value pairs , such as clarificationType = "easylang", clarificationValue= "xyz "
Pros | Cons | |
---|---|---|
Host Languages |
|
|
Authors |
|
|
User Agents |
|
|
Support for different features. |
|
|
Work with maintainers of host languages to add support for the personalization semantics vocabulary directly into the host language. Most simply this would involve creating attributes named for the personalization properties, but other approaches are possible.
Example: Undo action as native feature of button element in HTML
<button type="undo">Revert</button>
We discussed having this as a long term goal and making an additional note on how the vocabulary could be supported in host languages. However we do not expect to achieve the full use-cases in the native hosts and we will need implementation before we go to groups like HTML.
NOTE: This could be in JSON format as well (it'd look almost identical to the below code sample)
{
.foobar: {
field: "password";
moreinfo: url('PasswordFAQ.html');
symbol: url('images/helpicon.png');
importance: critical;
}
}
Pros | Cons | |
---|---|---|
Host Languages |
|
|
Authors |
|
|
User Agents |
<div
data-aui-field="password"
data-aui-moreinfo="PasswordFAQ.html"
data-aui-symbol="images/helpicon.png"
data-aui-importance="critical"
/>
Pros | Cons | |
---|---|---|
Host Languages |
|
|
Authors |
|
|
User Agents |
This is a contribed example of how a form might be marked up to allow for personalization. Here we show different possible approaches. With reference to the original form without any markup, the following examples all use the same personalization semantics:
- EasyLang: Replace Given name with "First name"
- EasyLang: Replace Surname with "Last name"
- EasyLang: Replace Revert with "Clear Information"
- EasyLang: Replace Submit with "Send Information"
- Symbols: provide link to a "discard" symbol
- Simplification: Set First/Last/Submit as Critical
Note: In the 3 attribute example 'aui' will still contain microSyntax for all other possible attributes, and only aui-numbersFree and aui-EasyLang are split out due to their potential complexity requiring multiple sentences. In my example I do have EasyLang but didn't include aui-numbersFree but it would match the same pattern.
<h2>Original - No Personalization</h2>
<form>
<label for="first">Given name:</label>
<input type="text" id="given" name="givenname"> <br>
<label for="last">Surname:</label>
<input type="text" id="sur" name="surname"> <br>
<input type="button" value="Revert">
<input type="submit" value="Submit">
</form>
<h2>Individual Attributes</h2>
<form>
<label for="given" aui-simplification="critical" aui-easylang="First name" aui-field="givenName">Given name:</label>
<input type="text" id="given" name="givenname">
<br>
<label for="sur" aui-simplification="critical" aui-easylang="Last name" aui-field="familyName">Surname name:</label>
<input type="text" id="sur" name="surname">
<br>
<input type="button" value="Revert" aui-easylang="Clear Information" aui-symbol="http://blisssymbolics.org/refnumber/18043" aui-action="undo">
<input type="submit" value="Submit" aui-simplification="critical" aui-easylang="Send Information" aui-action="submit">
</form>
<h2>1 Attribute + microSyntax (Without Quotes)</h2>
<form>
<label for="given" aui="simplification:critical; easylang:(First name); field:givenName">Given name:</label>
<input type="text" id="given" name="givenname">
<br>
<label for="sur" aui="simplification:critical; easylang:(Last name); field:familyName">Surname:</label>
<input type="text" id="sur" name="surname">
<br>
<input type="button" value="Revert" aui="easylang:(Clear Information); symbol=url(http://blisssymbolics.org/refnumber/18043); action:(undo)">
<input type="submit" value="Submit" aui="simplification:critical; easylang=(Send Information); action:(submit)">
</form>
<h2>1 Attribute + microSyntax (With Quotes)</h2>
<form>
<label for="given" aui="simplification:critical; easylang:('First name'); field:givenName">Given name:</label>
<input type="text" id="given" name="givenname">
<br>
<label for="sur" aui="simplification:critical; easylang:('Last name'); field:familyName">Surname:</label>
<input type="text" id="sur" name="surname">
<br>
<input type="button" value="Revert" aui="easylang:('Clear Information'); aui-symbol=url('http://blisssymbolics.org/refnumber/18043'); action:('undo')">
<input type="submit" value="Submit" aui="simplification:critical; easylang=('Send Information'); action('submit')">
</form>
<h2>3 Attributes</h2>
<form>
<label for="given" aui="simplification:critical; field:givenName" easylang="First name">Given name:</label>
<input type="text" id="given" name="givenname">
<br>
<label for="sur" aui="simplification:critical; field:familyName" easylang="Last name">Surname:</label>
<input type="text" id="sur" name="surname">
<br>
<input type="button" value="Revert" aui="symbol:url('http://blisssymbolics.org/refnumber/18043'); action=undo" easylang="Clear Information">
<input type="submit" value="Submit" aui="simplification:critical; action:submit" easylang="Send Information">
</form>
Pros | Cons | |
---|---|---|
Host Languages |
|
|
Authors |
|
|
User Agents |
|
|
Support for different features |
|
|
The table below compares approaches by various characteristics. The comparison is over-simplified to allow a binary "yes / no" for each feature, to facilitate overall coverage grokking. Features are worded, sometimes awkwardly, to result in a positive outcome being the one that gets an X for the feature.
Feature | RDFa | Microdata | aria- | aui- | attribute | attribute pair | native |
---|---|---|---|---|---|---|---|
Authoring | |||||||
Easy to author | x | x | x | x | x | ||
No ambiguity between personalization and other features | x | x | x | x | x | x | |
User Agents | |||||||
Easy for user agents to find properties | x | x | x | x | |||
Simple parsing of values | x | x | x | x | |||
Easy path to support via browser extensions | x | x | x | x | x | ||
Host Languages | |||||||
Does not require special host language support | x | x | x | ||||
Same approach works in multiple host languages | x | x | x | x | |||
Integration with ARIA | x | ||||||
Integration with HTML | x | x | |||||
Easy extensibility of vocabulary | x | x | x | x | x | x | |
Doesn't overload host language with many new features | x | x | x | x | |||
Functionality | |||||||
Multiple properties on same element | x | x | x | x | x | ||
Integration with other vocabularies | x | x | |||||
Likely search engine support for content alternatives | x | x | |||||
Multiple properties on different elements working together | x | x | x | x | x | ||
Typed value support | x | x | x | ||||
Strategy | |||||||
Avoid segration of "that accessibility stuff" | x | ||||||
Clear path to joining other W3C personalization efforts | x | x | x | ||||
Likely stable approach not requiring later change to authored content | x | x | x | x | x | x |
issue | RDFa | Microdata | aria- | aui- | attribute | attribute pair | native |
---|---|---|---|---|---|---|---|
require explicit support from host language | x - via aria | x | x | x | |||
bound to the dom - so will work with easy user agents like css | x | x | mid | mid | x | ||
multi platform support | x | x | x | x | x | ||
authors - mistake prone | XX | xx | x | x | |||
author effort | xx | xx | x | x | x | x | |
user agent error prone | xx | xx | |||||
full feture support | theroticaly possibe | XX | with pairs | X | theroticaly possibe |
Resolved (27/08/2018) that this discussion is not needed to decide how to put vocabulary in content. However, it should be discussed later and there is a request for clear usecases and demo implementations.
Decouples semantics from the DOM/presentation layer
Taken from Issue #73 Low level imperative API
Gives access to lower level APIs and enables the author to define bindings to HTML
Taken from Issue #73 Low level imperative API
Taken from Issue #84
Input from Jason White - "A tool (e.g., custom user agent, proxy, browser extension) could maintain a list of trusted annotation providers, and match each page that the user accesses with a list of URIs of pages for which annotations are available."
The following are interpreted to be suggested resources which may be of interest in the research of implementations. These references are more specific to defining taxonomy and/or semantics.
Taken from Issue #74