idnits 2.17.1
draft-amundsen-richardson-foster-alps-02.txt:
Checking boilerplate required by RFC 5378 and the IETF Trust (see
https://trustee.ietf.org/license-info):
----------------------------------------------------------------------------
No issues found here.
Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt:
----------------------------------------------------------------------------
== No 'Intended status' indicated for this document; assuming Proposed
Standard
Checking nits according to https://www.ietf.org/id-info/checklist :
----------------------------------------------------------------------------
** There are 2 instances of too long lines in the document, the longest one
being 11 characters in excess of 72.
** The abstract seems to contain references ([1]), which it shouldn't.
Please replace those with straight textual mentions of the documents in
question.
Miscellaneous warnings:
----------------------------------------------------------------------------
== The copyright year in the IETF Trust and authors Copyright Line does not
match the current year
== The document seems to lack the recommended RFC 2119 boilerplate, even if
it appears to use RFC 2119 keywords -- however, there's a paragraph with
a matching beginning. Boilerplate error?
(The document does seem to have the reference to RFC 2119 which the
ID-Checklist requires).
== Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD',
or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please
use uppercase 'NOT' together with RFC 2119 keywords (if that is what you
mean).
Found 'MUST not' in this paragraph:
Since a state transition 'descriptor' may define a relation type
value, it is important to avoid creating conflicts with existing
IANA-registered values. If the resulting link relation type is the same
as a registered relation type, the descriptor MUST not change the meaning
of the IANA relation type.
-- The document date (August 24, 2015) is 3168 days in the past. Is this
intentional?
Checking references for intended status: Proposed Standard
----------------------------------------------------------------------------
(See RFCs 3967 and 4897 for information about using normative references
to lower-maturity documents in RFCs)
-- Looks like a reference, but probably isn't: '1' on line 26
== Missing Reference: 'TK' is mentioned on line 1224, but not defined
** Obsolete normative reference: RFC 1738 (Obsoleted by RFC 4248, RFC 4266)
** Obsolete normative reference: RFC 3023 (Obsoleted by RFC 7303)
** Obsolete normative reference: RFC 4627 (Obsoleted by RFC 7158, RFC 7159)
** Obsolete normative reference: RFC 5988 (Obsoleted by RFC 8288)
** Downref: Normative reference to an Informational RFC: RFC 6906
** Obsolete normative reference: RFC 7320 (Obsoleted by RFC 8820)
== Outdated reference: A later version (-12) exists of
draft-ietf-appsawg-text-markdown-05
Summary: 8 errors (**), 0 flaws (~~), 6 warnings (==), 2 comments (--).
Run idnits with the --verbose option for more detailed information about
the items above.
--------------------------------------------------------------------------------
2 Network Working Group M. Amundsen
3 Internet-Draft CA Technologies, Inc.
4 Expires: February 25, 2016 L. Richardson
6 M. Foster
8 August 24, 2015
10 Application-Level Profile Semantics (ALPS)
11 draft-amundsen-richardson-foster-alps-02
13 Abstract
15 This document describes ALPS, a data format for defining simple
16 descriptions of application-level semantics, similar in complexity to
17 HTML microformats. An ALPS document can be used as a profile to
18 explain the application semantics of a document with an application-
19 agnostic media type (such as HTML, HAL, Collection+JSON, Siren,
20 etc.). This increases the reusability of profile documents across
21 media types.
23 Editorial Note (To be removed by RFC Editor)
25 Distribution of this document is unlimited. Comments should be sent
26 to the IETF Media-Types mailing list (see [1]).
28 Status of This Memo
30 This Internet-Draft is submitted in full conformance with the
31 provisions of BCP 78 and BCP 79.
33 Internet-Drafts are working documents of the Internet Engineering
34 Task Force (IETF). Note that other groups may also distribute
35 working documents as Internet-Drafts. The list of current Internet-
36 Drafts is at http://datatracker.ietf.org/drafts/current/.
38 Internet-Drafts are draft documents valid for a maximum of six months
39 and may be updated, replaced, or obsoleted by other documents at any
40 time. It is inappropriate to use Internet-Drafts as reference
41 material or to cite them other than as "work in progress."
43 This Internet-Draft will expire on February 25, 2016.
45 Copyright Notice
47 Copyright (c) 2015 IETF Trust and the persons identified as the
48 document authors. All rights reserved.
50 This document is subject to BCP 78 and the IETF Trust's Legal
51 Provisions Relating to IETF Documents
52 (http://trustee.ietf.org/license-info) in effect on the date of
53 publication of this document. Please review these documents
54 carefully, as they describe your rights and restrictions with respect
55 to this document. Code Components extracted from this document must
56 include Simplified BSD License text as described in Section 4.e of
57 the Trust Legal Provisions and are provided without warranty as
58 described in the Simplified BSD License.
60 Table of Contents
62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
63 1.1. Notational Conventions . . . . . . . . . . . . . . . . . 3
64 1.2. Motivation . . . . . . . . . . . . . . . . . . . . . . . 4
65 1.2.1. Describing Domain-Specific Semantics . . . . . . . . 4
66 1.2.2. ALPS-based Server Implementations . . . . . . . . . . 4
67 1.2.3. ALPS-based Client Implementations . . . . . . . . . . 4
68 1.3. A Short Hike in the ALPS . . . . . . . . . . . . . . . . 5
69 1.4. A Simple ALPS Example . . . . . . . . . . . . . . . . . . 6
70 1.5. Identifying an ALPS Document . . . . . . . . . . . . . . 11
71 2. ALPS Documents . . . . . . . . . . . . . . . . . . . . . . . 11
72 2.1. Compliance . . . . . . . . . . . . . . . . . . . . . . . 12
73 2.2. ALPS Document Properties . . . . . . . . . . . . . . . . 12
74 2.2.1. 'alps' . . . . . . . . . . . . . . . . . . . . . . . 12
75 2.2.2. 'doc' . . . . . . . . . . . . . . . . . . . . . . . . 12
76 2.2.3. 'descriptor' . . . . . . . . . . . . . . . . . . . . 13
77 2.2.4. 'ext' . . . . . . . . . . . . . . . . . . . . . . . . 14
78 2.2.5. 'format' . . . . . . . . . . . . . . . . . . . . . . 15
79 2.2.6. 'href' . . . . . . . . . . . . . . . . . . . . . . . 16
80 2.2.7. 'id' . . . . . . . . . . . . . . . . . . . . . . . . 16
81 2.2.8. 'link' . . . . . . . . . . . . . . . . . . . . . . . 18
82 2.2.9. 'name' . . . . . . . . . . . . . . . . . . . . . . . 18
83 2.2.10. 'rel' . . . . . . . . . . . . . . . . . . . . . . . . 19
84 2.2.11. 'rt' . . . . . . . . . . . . . . . . . . . . . . . . 19
85 2.2.12. 'type' . . . . . . . . . . . . . . . . . . . . . . . 19
86 2.2.13. 'value' . . . . . . . . . . . . . . . . . . . . . . . 20
87 2.2.14. 'version' . . . . . . . . . . . . . . . . . . . . . . 20
88 2.3. ALPS Representations . . . . . . . . . . . . . . . . . . 20
89 2.3.1. Sample HTML . . . . . . . . . . . . . . . . . . . . . 20
90 2.3.2. XML Representation Example . . . . . . . . . . . . . 21
91 2.3.3. JSON Representation Example . . . . . . . . . . . . . 21
92 3. Applying ALPS documents to Existing Media Types . . . . . . . 23
93 3.1. Linking to ALPS Documents . . . . . . . . . . . . . . . . 24
94 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24
95 4.1. application/alps+xml . . . . . . . . . . . . . . . . . . 24
96 4.2. application/alps+json . . . . . . . . . . . . . . . . . . 26
97 5. Internationalization Considerations . . . . . . . . . . . . . 27
98 6. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . 27
99 7. References . . . . . . . . . . . . . . . . . . . . . . . . . 27
100 7.1. Normative References . . . . . . . . . . . . . . . . . . 27
101 7.2. Informative References . . . . . . . . . . . . . . . . . 28
102 Appendix A. Frequently Asked Questions . . . . . . . . . . . . . 29
103 A.1. Why are there no URLs in ALPS? . . . . . . . . . . . . . 29
104 A.2. Why is there no workflow component in the ALPS
105 specification? . . . . . . . . . . . . . . . . . . . . . 29
106 A.3. Why is there no way to indicate ranges for semantic
107 descriptors? . . . . . . . . . . . . . . . . . . . . . . 29
109 1. Introduction
111 This document describes ALPS, a media type for defining simple
112 descriptions of application-level semantics, similar in complexity to
113 HTML microformats. These descriptions contain both human-readable
114 and machine-readable explanations of the semantics. An ALPS document
115 can be used as a profile to explain the application semantics of a
116 document with an application-agnostic media type (such as HTML, HAL,
117 Collection+JSON, Siren. etc.).
119 This document identifies a registry for ALPS documents, (The ALPS
120 Profile Registry or APR). The details of this registry, its goals,
121 and operations are covered in a separate document (TBD).
123 This document also identifies a process for authoring, publishing,
124 and sharing normative human-readable instructions on applying an ALPS
125 document as a profile to responses of a given media type. For
126 example, a document that describes how to apply the semantics of an
127 ALPS profile to an HTML document.
129 This document registers two media-type identifiers with the IANA:
130 'application/alps+xml' ('ALPS+XML') and 'application/alps+json'
131 ('ALPS+JSON').
133 1.1. Notational Conventions
135 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
136 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
137 document are to be interpreted as described in[RFC2119].
139 1.2. Motivation
141 When implementing a hypermedia client/server application using a
142 general media type (HTML, Atom, Collection+JSON, etc.), client and
143 server instances need to share an understanding of domain-specific
144 information such as data element names, link relation values, and
145 state transfer parameters. This information is directly related to
146 the application being implemented (e.g. accounting, contact
147 management, etc.) rather than the media type used in the
148 representations.
150 1.2.1. Describing Domain-Specific Semantics
152 Instead of creating and registering an entirely new media type (i.e.
153 'application/accounting'), representation authors can create an ALPS
154 document that describes a 'profile' of the target domain; one that
155 explains the vital domain-specific semantic descriptors and state
156 transitions. This profile can then be consistently applied to a wide
157 range of media types by server implementors and successfully consumed
158 by client applications. The focus on defining application-level
159 semantics, independent of transfer protocol or media type, makes it
160 possible to serve application-specific representations using an
161 application-agnostic media type.
163 1.2.2. ALPS-based Server Implementations
165 Server implementors can use ALPS documents as a basis for building
166 domain-specific solutions without having to create their own custom
167 media type or re-invent the vocabulary and transition set for a
168 common domain (e.g. accounting, microblogging, etc.). Using a
169 preexisting ALPS profile as a guide, servers can map internal data to
170 commonly-understood semantic descriptors and state transitions,
171 increasing the likelihood that existing client applications (those
172 who share the same understanding of the ALPS document) will be able
173 to successfully interact with that server.
175 1.2.3. ALPS-based Client Implementations
177 Armed with a document's ALPS profile, client applications can
178 associate the ALPS descriptor 'id' and/or 'name' attribute values
179 with the appropriate elements within the document. Client
180 applications can 'code for the profile' and better adjust to detailed
181 changes to the response layout, or even the wholesale replacement of
182 one media type with another.
184 1.3. A Short Hike in the ALPS
186 ALPS documents allow you to express domain semantics independent of
187 message media type and/or protocol. ALPS documents specify
188 'descriptor' elements that define domain-specific semantic
189 information. Each 'descriptor' has an 'id' property that defines a
190 domain-specific name and a 'type' property that indicates whether the
191 information being described is a simple data element (type="semantic)
192 or a state transition element (type="safe", type="unsafe",
193 type="idempontent"). By combining multiple data and transition
194 descriptors in a single document, ALPS authors are able to
195 sufficently describe all the related data and action semantics in an
196 application domain.
198 Take the following example ALPS profile located at:
199 http://example.com/alps/works
201
202
203 The content of a work.
204
205
206 Release a work for distribution.
207
208
210 Sample Works Domain ALPS Document
212 For an 'application/json' message, this would map to:
214 GET /works/1 HTTP/1.1
215 Host: example.io
216 Links: profile="http://example.com/alps/works"
217 Content-Type: application/json
219 {
220 "content" : "The ships hung in the sky in much the same way that bricks don't."
221 }
223 Sample Works JSON Message
225 For an 'application/vnd.siren+json' message, this would map to:
227 GET /works/1 HTTP/1.1
228 Host: example.io
229 Links: profile="http://example.com/alps/works"
230 Content-Type: application/vnd.siren+json
232 {
233 "properties" {
234 "content" : "The ships hung in the sky in much the same way that bricks don't."
235 },
236 "actions" : {
237 "name" : "publish",
238 "method" : "PUT",
239 "href" : "..."
240 }
241 }
243 Sample Works Siren Message
245 While an ALPS document defines an entire set of domain-specific
246 information, not all media types can completely represent this
247 information. For example, plain JSON (application/json) has no
248 standardized definition of hypermedia links or forms. Thus, in the
249 above example, the 'publish' descriptor has no corresponding element
250 in the JSON representation. However, the Siren media type has an
251 'action' hypermedia element that can be used to express the details
252 of the 'publish' state transition.
254 This illustrates a key principle of the ALPS format. ALPS documents
255 define the domain semantics in the abstract and the mapping of these
256 details to a message is defined separately through a standardized set
257 of ALPS-to-[media type] mapping documents (See
258 Applying ALPS documents to Existing Media Types).
260 1.4. A Simple ALPS Example
262 Below is an ALPS document that describes elements of a simple
263 request/response interaction in a contact management application.
264 The profile defines a semantic descriptor called 'contact', and three
265 subordinate descriptors ('fullName', 'email', and 'phone').
267 The ALPS document also defines a single, safe state transition, to be
268 represented by a hypermedia control (e.g. HTML.GET form) with the
269 'id' value of 'collection.' This hypermedia control has one input
270 value ('nameSearch'). When executed, the response will contain one
271 or more 'contact' type items.
273
274 A contact list.
275
277
278
279
280 A simple link/form for getting a list of contacts.
281
282
283 Input for a search form.
284
285
287
288
289
290 A link to an individual contact.
291
292
293
294
295
296
298 ALPS Contact Profile document
300 Implementing the ALPS profile above requires implementing the
301 descriptors defined by the ALPS document. In this case, there are
302 two 'top level' descriptors: the safe state transition ('collection')
303 and the semantic descriptor 'contact'. Below is a single HTML
304 document that shows both these elements in a representation.
306
307
355
356
358 HTML ALPS Contact Representation
360 HTML representations implement most ALPS elements using HTML's
361 'class' attribute. The 'collection' ID has become the CSS class of
362 an HTML form's submit button. The 'contact' ID has become the CSS
363 class of the TR elements in an HTML table. The subordinate
364 descriptors 'fullname','email', and 'phone' are rendered as the TD
365 elements of each TR.
367 This HAL document uses the same profile to express the same
368 application-level semantics as the HTML document.
370
371
373
375
378
379
381 Ann Arbuckle
382 aa@example.org
383 123.456.7890
384
385
386
388 Zelda Zackney
389 zz@example.org
390 987.664.3210
391
392
394 HAL XML Contacts Representation
396 In a HAL representation, all state transitions ('collection' and
397 'item', in this case) are represented as link relations. All data
398 descriptors ('fullName', 'email', and 'phone') are represented as XML
399 tags named after the descriptors.
401 This Collection+JSON document uses the ALPS profile to express the
402 same application-level semantics as the HTML and HAL documents.
404 {
405 "collection" : {
406 "version" : "1.0",
407 "href" : "http://example.org/contacts/",
409 "links" : [
410 {
411 "rel" : "profile",
412 "href" : "http://alps.io/profiles/contacts"
413 },
414 {
415 "rel" : "help",
416 "href" : "http://example.org/help/contacts.html"
417 },
418 {
419 "rel" : "type",
420 "href" : "http://alps.io/profiles/contacts#contact"
421 }
422 ],
424 "queries" : [
425 {
426 "rel" : "collection",
427 "rt" : "contact",
428 "href" : "http://example.org/contacts/",
429 "data" : [
430 {
431 "name" : "nameSearch",
432 "value" : "",
433 "prompt" : "Search Name"
434 }
435 ]
436 }
437 ],
439 "items" : [
440 {
441 "href" : "http://example.org/contacts/1",
442 "rel" : "item",
443 "rt" : "contact",
444 "data" : [
445 {"name" : "fullName", "value" : "Ann Arbuckle"},
446 {"name" : "email", "value" : "aa@example.org"},
447 {"name" : "phone", "value" : "123.456.7890"}
448 ],
449 "links" : [
450 {
451 "rel" : "type",
452 "href" : "http://alps.io/profiles/contacts#contact"
453 }
454 ]
455 },
456 {
457 "href" : "http://example.org/contacts/100",
458 "rel" : "item",
459 "rt" : "contact",
460 "data" : [
461 {
462 "name" : "fullName",
463 "value" : "Zelda Zackney"
464 },
465 {
466 "name" : "email",
467 "value" : "zz@example.org"
468 },
469 {
470 "name" : "phone",
471 "value" : "987.654.3210"
472 }
473 ],
474 "links" : [
475 {
476 "rel" : "type",
477 "href" : "http://alps.io/profiles/contacts#contact"
478 }
479 ]
480 }
481 ]
482 }
483 }
485 Collection+JSON Contacts Representation
487 The descriptor 'collection' has become the link relation associated
488 with a Collection+JSON query. The descriptors 'fullName', 'email',
489 and 'phone' have become the names of key-value pairs in the items in
490 a Collection+JSON collection.
492 1.5. Identifying an ALPS Document
494 An ALPS vocabulary is identified by a unique URL. This URL SHOULD be
495 dereferencable. All ALPS URLs MUST be unique and all ALPS documents
496 intended for public consumption SHOULD be registered in an ALPS
497 Registry [TK: add text on where/how to find registries -mamund].
499 In order to reduce load on servers responding to ALPS document
500 requests, it is RECOMMENDED that servers use cache control directives
501 that instruct client apps to locally cache the results. Clients
502 making these ALPS document requests SHOULD honor the server's caching
503 directives.
505 2. ALPS Documents
507 An ALPS document contains a machine-readable collection of
508 identifying strings and their human-readable explanations. An ALPS
509 document can be represented in either XML or JSON format. This
510 section identifies the general elements and properties of an ALPS
511 document, their meaning, and their use, independent of how the
512 document is represented. Section 2.3 provides specific details on
513 constructing a valid ALPS document in XML and in JSON format.
515 2.1. Compliance
517 An implementation is not compliant if it fails to satisfy one or more
518 of the MUST or REQUIRED level requirements. An implementation that
519 satisfies all the MUST or REQUIRED level and all the SHOULD level
520 requirements is said to be 'unconditionally compliant'; one that
521 satisfies all the MUST level requirements but not all the SHOULD
522 level requirements is said to be 'conditionally compliant.'
524 2.2. ALPS Document Properties
526 The ALPS media type defines a small set of properties. These
527 properties appear in both the XML and JSON formats. Below is a list
528 of the properties that can appear in an ALPS document.
530 2.2.1. 'alps'
532 Indicates the root of the ALPS document. This property is REQUIRED,
533 and it SHOULD have one or more 'descriptor' child properties.
535 Examples:
537 XML: ...
539 JSON: { "alps" : ... }
541 2.2.2. 'doc'
543 A text field that contains free-form, usually human-readable, text.
544 The 'doc' element MAY have two properties: 'href' and 'format'. If
545 the 'href' property appears it SHOULD contain a dereferencable URL
546 that points to human-readable text. If the 'format' property appears
547 it SHOULD contain one of the following values: 'text', 'html',
548 'asciidoc', or 'markdown'. Any program processing 'doc' elements
549 SHOULD honor the 'format' directive and parse/render the content
550 appropriately. If the value in the 'format' property is not
551 recognized and/or supported, the processing program MUST treat the
552 content as plain text. If no 'format' property is present, the
553 content SHOULD be treated as plain text.
555 XML:
Date of Birth
...
557 JSON: { "doc" : { "format" : "text" : "value" : "Date of Birth ..."
558 } }
560 A 'doc' element SHOULD appear as a child of 'descriptor'. When
561 present, it describes the meaning and use of the related
562 'descriptor'.
564 XML: ...
566 JSON: { "descriptor" : { { "doc" : { "value" : "..." } ... } }
568 The 'doc' element MAY appear as a child of 'alps'. When present, it
569 describes the purpose of the ALPS document as a whole.
571 XML: ... ...
573 JSON: { "alps : { "doc" : { "value" : "..." }, ... } }
575 2.2.3. 'descriptor'
577 A 'descriptor' element defines the semantics of specific data
578 elements or state transitions that MAY exist in an associated
579 representation.
581 One or more 'descriptor' elements SHOULD appear as children of
582 'alps'. It may also appear as a child of itself; that is, the
583 'descriptor' property may be nested.
585 The 'descriptor' property SHOULD have either an 'id' or 'href'
586 attribute. It MAY have both. Additionally, the 'descriptor' MAY
587 have any of the following attributes:
589 1. 'doc'
591 2. 'ext'
593 3. 'name'
595 4. 'type'
597 If present, the 'href' property MUST be a dereferenceable URL, that
598 points to another 'descriptor' either within the current ALPS
599 document or in another ALPS document.
601 If 'descriptor' has an 'href' attribute, then 'descriptor' is
602 inheriting all the attributes and sub-properties of the descriptor
603 pointed to by 'href'. When 'descriptor' has a property defined
604 locally, that property value takes precedence over any inherited
605 property value. Since there is no limit to the nesting of elements
606 -- even ones linked remotely -- it is important to process 'all
607 descriptor' chains starting from the bottom to make sure you have
608 collected all the available properties and have established the
609 correct value for each of them.
611 If 'descriptor' is declared at the top level of an ALPS document,
612 then a client SHOULD assume that 'descriptor' can appear anywhere in
613 a runtime message.
615 If 'descriptor' is nested, i.e. declared as a child of another
616 descriptor, then:
618 1. A client SHOULD assume them to appear in any sibling 'descriptor'
619 element and recursively in their child descriptors.
621 2. A client SHOULD NOT assume that it can appear anywhere outside of
622 parent descriptor, unless it was explicitly referenced by another
623 descriptor in 'href' attribute. In that case the same rules are
624 applied to 'descriptor' containing 'href' attribute.
626 2.2.3.1. 'Descriptors and Link Relation Types'
628 When a representation is generated that includes state transitions,
629 valid values for link relation types are:
631 1. A registered IANA link relation type (e.g. rel="edit", a short
632 string).
634 2. An extension link relation type as defined by [RFC5988] whose
635 value is the fully-qualified URI of an associated document
636 describing the relation type. This includes URI fragment
637 identifiers of ALPS descriptors (e.g.
638 rel="http://alps.io/profiles/item#purchased-by", a URI) per the
639 conventions of Section 2.2.7.2.
641 3. The 'id' property of a state transition descriptor of an
642 associated ALPS document (e.g. rel="purchased-by", a short
643 string) per the conventions of section Section 2.2.7.1 and
644 Section 2.2.7.3 if the representation includes an ALPS profile.
646 2.2.4. 'ext'
648 The 'ext' element can be used to extend the ALPS document with
649 author-specific information. It provides a way to customize ALPS
650 documents with additional properties not covered in this
651 specification. This is an OPTIONAL element.
653 The 'ext' element has the following properties.
655 1. 'id'
656 2. 'href'
658 3. 'value'
660 The 'id' property is REQUIRED. The 'href' is RECOMMENDED and it
661 SHOULD point to documentation that explains the use and meaning of
662 this 'ext' element. The 'value' property is OPTIONAL. The content
663 is undetermined; its meaning and use SHOULD be explained by the
664 document found by de-referencing the 'href' property.
666 Examples:
668 XML:
671 JSON: { "ext" : { "id" : "directions", "href" : "http://alps.io/ext/
672 directions", value="north south east west" } }
674 The 'ext' element MAY appear as a child of the following elements:
676 1. 'alps'
678 2. 'descriptor'
680 Since the 'ext' element has no specific meaning within this
681 specification, it MUST be ignored by any application that does not
682 understand its meaning.
684 2.2.5. 'format'
686 Indicates how the text content should be parsed and/or rendered.
687 This specification identifies a range of possible values for
688 'format':
690 o 'text', for plain text, MUST be supported.
692 o 'html', for HTML, SHOULD be supported.
694 o 'asciidoc', for AsciiDoc, MAY be supported.
696 o 'markdown', per The text/markdown Media Type
697 [I-D.ietf-appsawg-text-markdown], MAY be supported.
699 Any other values for this attribute are undefined and SHOULD be
700 treated as plain text. If the program does not recognize the value
701 of the 'format' property and/or the 'format' property is missing, the
702 content SHOULD be treated as plain text.
704 This property MAY appear as an attribute of the 'doc' element.
706 2.2.6. 'href'
708 Contains a resolvable URL.
710 When it appears as an attribute of a 'descriptor', 'href' points to
711 another 'descriptor' either within the existing ALPS document as a
712 fragment or in another ALPS document as an absolute URL. The URL
713 MUST contain a fragment per Section 2.2.7.2 referencing the related
714 'descriptor'.
716 When it appears as an attribute of 'ext', 'href' points to an
717 external document which provides the definition of the extension.
719 When it appears as an attribute of 'link', 'href' points to an
720 external document whose relationship to the current document or
721 'descriptor' is described by the associated 'rel' property.
723 When it appears as an attribute of 'doc', 'href' points to a document
724 that contains human-readable text that describes the associated
725 'descriptor' or ALPS document.
727 2.2.7. 'id'
729 A document-wide unique identifier for the related element. This
730 SHOULD appear as an attribute of a 'descriptor'. It SHOULD be an
731 opaque string that does not contain any URL unsafe characters per
732 [RFC1738].
734 The value of this attribute MAY be used as an identifier in the
735 related runtime hypermedia representation. In the example below the
736 ALPS descriptor with an 'id' of 'q' is used to identify an HTML input
737 element:
739 'id' in ALPS...
741 ...becomes the 'class' in HTML
744 It should be noted that the exact mapping from ALPS elements (e.g.
745 'id') to elements within a particular media type (HTML,
746 Collection+JSON, etc.) is covered in separate documents (to be
747 specified).
749 2.2.7.1. ALPS 'id' and 'name' Properties
751 In some cases, media types support non-unique identifiers (e.g.
752 HTML's 'name' property) or will allow the same identifier value for
753 multiple elements in the same representation (e.g. and and ). In those cases, translating that
756 representation into ALPS documents could result in multiple 'id'
757 properties with the same value.
759 To avoid this, ALPS document designers can add the 'name' property to
760 a 'descriptor' to hold the common value ('search') while still using
761 the 'id' property to hold a document-wide unique value. For example:
763
764
765
769
771 HTML Representation of a Search Transition
773
774
775
776
777
778
780 ALPS Description of the same Search Transition
782 2.2.7.2. Fragment Identifiers and 'id'
784 When applied to an ALPS document, a URI fragment identifier points to
785 the 'descriptor' whose 'id' is the value of the fragment. For
786 example, the fragment identifier 'customer' in the URI
787 http://example.com/my-alps-document#customer refers to an ALPS
788 'descriptor' with 'id' set to 'customer'. If the 'id' contains URL
789 unsafe characters per [RFC1738], the fragment referencing the 'id'
790 MUST be URL escaped.
792 A relative URL with a fragment identifier within an ALPS document
793 (e.g. href="#customer") refers to a local 'descriptor' within the
794 document containing the reference.
796 The complete URI to an ALPS 'descriptor' (including the fragment)
797 forms an 'abstract semantic type' identifier. This is a resolvable
798 URI (URL) that can be used to indicate the type of a resource; for
799 instance, it can be used as the value of the IANA-registered relation
800 type 'type'.
802 2.2.7.3. Link Relation Values and 'id' or 'name'
804 Since a state transition 'descriptor' may define a relation type
805 value, it is important to avoid creating conflicts with existing
806 IANA-registered values. If the resulting link relation type is the
807 same as a registered relation type, the descriptor MUST not change
808 the meaning of the IANA relation type.
810 Further, since the 'id' of a 'descriptor' may define a link relation
811 value per Section 2.2.3.1, if a conflict exists in defining such a
812 descriptor's document-wide unique 'id' with another 'descriptor', the
813 conflicting 'descriptor' MUST define a unique 'id' and MAY specify a
814 'name' property to resolve the conflict.
816 If it is unclear whether a registered link relation type in a
817 representation document refers to a relation registered with IANA or
818 a relation registered in an ALPS profile, the semantics of that link
819 are undefined.
821 2.2.8. 'link'
823 An element that identifies a link between the current ALPS element
824 and some other (possibly external) resource. MAY be a child element
825 of the 'alps' and the 'descriptor' elements.
827 The 'link' element MUST define the two attributes 'href' and 'rel'.
829 2.2.9. 'name'
831 Indicates the name of the 'descriptor' as found in generic
832 representations. It MAY appear as a property of 'descriptor'.
834 This is used when the name of the 'descriptor' is used as an 'id'
835 value elsewhere in the ALPS document. For instance, if a single ALPS
836 document defines a semantic descriptor (data element) called
837 'customer' and a safe descriptor (transition element) also called
838 'customer', they cannot both have 'id="customer"' in the ALPS
839 document. One of them needs to have some other 'id', and to set
840 'name="customer"'.
842 The use of the 'name' property usually indicates an ambiguity in the
843 application semantics. Thus, it SHOULD only be used when creating an
844 ALPS profile that describes an existing design.
846 2.2.10. 'rel'
848 Contains a [RFC5988] approved value: either an extension relation
849 type (a URI) or a registered relation type (a short string).
851 Appears as a property of'link'.
853 2.2.11. 'rt'
855 Indicates the kind of resource that will be returned when executing
856 the specified network request. The 'rt' attribute SHOULD appear only
857 on a 'descriptor' with a 'type' value of 'safe', 'unsafe', or
858 'idempotent.'
860 The 'rt' attribute is OPTIONAL and, when it appears, it MUST point to
861 the 'id' of an existing 'descriptor' using one of two methods:
863 1. A fragment identifier (e.g. rt="#friend") which points to the
864 'id' of an existing 'descriptor' in the current ALPS document.
866 2. A resolvable URL with a fragment identifier (e.g.
867 rt="http://example.org/profiles/people#friend") which points to
868 the 'id' of an existing 'descriptor' in any valid ALPS document.
870 2.2.12. 'type'
872 Indicates the type of hypermedia control to which the element is
873 applied within the resulting representation. This SHOULD appear for
874 each 'descriptor' element. The four valid values are:
876 'semantic' A state element (e.g. HTML.SPAN, HTML.INPUT, etc.).
878 'safe' A hypermedia control that triggers a safe, idempotent state
879 transition (e.g. HTTP.GET or HTTP.HEAD).
881 'idempotent' A hypermedia control that triggers an unsafe,
882 idempotent state transition (e.g. HTTP.PUT or HTTP.DELETE).
884 'unsafe' A hypermedia control that triggers an unsafe, non-
885 idempotent state transition (e.g. HTTP.POST).
887 If no 'type' attribute is associated with the element, then
888 'type="semantic"' is implied.
890 2.2.13. 'value'
892 Contains a string value. It MAY appear as an attribute of the 'doc'
893 and the 'ext' elements.
895 2.2.14. 'version'
897 Indicates the version of the ALPS specification used in the document.
898 This SHOULD appear as a property of the 'alps' element. Currently
899 the only valid value is '1.0'. If no value appears, then
900 'version="1.0"' is implied.
902 2.3. ALPS Representations
904 An ALPS document may be represented in either XML or JSON format.
905 This section contains notes on how the ALPS elements and attributes
906 appear in each format, along with examples to guide ALPS document
907 authors.
909 2.3.1. Sample HTML
911 Below is a simple HTML document that contains a handful of semantic
912 descriptors and transition instructions. This document was generated
913 from the XML and JSON ALPS documents that follow. Use this HTML
914 document as a guide when evaluating the XML and JSON examples.
916
917
918
919
920
921
922
930
931
933 HTML Sample
935 2.3.2. XML Representation Example
937 In the XML version of an ALPS document, the following ALPS properties
938 always appear as XML elements: 'alps', 'doc', 'descriptor', and
939 'ext'. All other ALPS properties appear as XML attributes.
941 2.3.2.1. Complete XML Representation
943 Below is an example of an application/alps+xml representation.
945
946
947
949
950 A search form with two inputs.
951
952
953 input for search
954
955
957
958 results format
959
962
963
965 Complete XML Representation
967 2.3.3. JSON Representation Example
969 When representing ALPS documents in JSON format, the 'descriptor' and
970 'ext' properties are always expressed as arrays of anonymous objects
971 - even when there is only one member in the array.
973 For example:
975 "descriptor" : [
976 {
977 "id" : "value",
978 "name" : "search",
979 "type" : "descriptor",
980 "doc" : { "value" : "input for search" }
981 },
982 { "href" : "#resultType" }
983 ]
985 Arrays in ALPS+JSON
987 The 'doc' property is always expressed as a named object.
989 For example:
991 {
992 "doc" : {
993 "format" : "text",
994 "value" : "Rules are important"
995 }
996 }
998 Descriptions in ALPS+JSON
1000 2.3.3.1. Complete JSON Representation
1002 Below is a example of the application/alps+json representation of an
1003 ALPS document.
1005 {
1006 "alps" : {
1007 "version" : "1.0",
1008 "doc" : {
1009 "href" : "http://example.org/samples/full/doc.html"
1010 },
1011 "descriptor" : [
1012 {
1013 "id" : "search",
1014 "type" : "safe",
1015 "doc" : {"value" :
1016 "A search form with a two inputs"
1017 },
1018 "descriptor" : [
1019 {
1020 "id" : "value",
1021 "name" : "search",
1022 "type" : "descriptor",
1023 "doc" : { "value" : "input for search" }
1024 },
1025 { "href" : "#resultType" }
1026 ]
1027 },
1028 {
1029 "id" : "resultType",
1030 "type" : "descriptor",
1031 "description" : {"value" : "results format"},
1032 "ext" : [
1033 {
1034 "href" : "http://alps.io/ext/range",
1035 "value" : "summary,detail"
1036 }
1037 ]
1038 }
1039 ]
1040 }
1041 }
1043 Complete ALPS+JSON Representation
1045 3. Applying ALPS documents to Existing Media Types
1047 An ALPS document can be applied to many existing media types as long
1048 as there exists an agreed mapping between ALPS and the target media
1049 type. Section 1.4 gave some informative examples of this.
1050 Normative, up-to-date guidance on applying ALPS documents to existing
1051 media types are available at the official ALPS Web site at
1052 (http://alps.io/docs/mapping). [TK : this page does not yet exist.
1053 -mamund]
1055 Not all media types can faithfully represent all ALPS descriptors.
1056 For instance, the 'application/json' media type has no standard way
1057 of representing hyperlinks. The details of how to apply ALPS to such
1058 a media type will necesarily be incomplete, and it will not be
1059 possible to represent some aspects of an ALPS profile in documents in
1060 that media type.
1062 3.1. Linking to ALPS Documents
1064 To indicate that an ALPS profile describes the semantics of some
1065 representation document, the representation document SHOULD be linked
1066 to the ALPS document. The 'profile' link relation [RFC6906] MUST be
1067 used when creating this link. If the media type of the
1068 representation document has no native ability to link to other
1069 resources, or no ability to express link relations, the HTTP header
1070 'Link' [RFC5988] MAY be used to connect the representation document
1071 and the ALPS profile. If the media type of the representation
1072 document defines a parameter for linking the document to a profile,
1073 that parameter MAY be used to connect the representation document and
1074 the ALPS profile.
1076 A single representation document may be described by more than one
1077 ALPS profile. If two ALPS profiles give conflicting semantics for
1078 the same element, the document linked to earlier in the
1079 representation SHOULD take precedence. A profile linked to using the
1080 'Link' header takes precedence over a profile linked to within the
1081 representation document itself. A profile linked to using a media
1082 type parameter takes precedence over a profile linked to using the
1083 'Link' header and a profile linked to within the representation
1084 document itself.
1086 4. IANA Considerations
1088 This specification establishes two media types: 'application/
1089 alps+xml' and 'application/alps+json'
1091 4.1. application/alps+xml
1093 Type name: application
1095 Subtype name: alps+xml
1097 Required parameters: None
1099 Optional parameters:
1101 charset This parameter has identical semantics to the charset
1102 parameter of the 'application/xml' media type as specified
1103 in[RFC3023].
1105 profile A whitespace-separated list of IRIs identifying specific
1106 constraints or conventions that apply to an ALPS document. A
1107 profile must not change the semantics of the resource
1108 representation when processed without profile knowledge, so
1109 that clients both with and without knowledge of a profiled
1110 resource can safely use the same representation. The profile
1111 parameter may also be used by clients to express their
1112 preferences in the content negotiation process. It is
1113 recommended that profile IRIs are dereferenceable and provide
1114 useful documentation at that IRI.
1116 Encoding considerations:
1118 binary Same as encoding considerations of application/xml as
1119 specified in[RFC3023].
1121 Security considerations: This format shares security issues common
1122 to all XML content types. It does not provide executable content.
1123 Information contained in ALPS documents do not require privacy or
1124 integrity services.
1126 Interoperability considerations: ALPS is not described by a DTD and
1127 applies only the well-formedness rules of XML. It should only be
1128 parsed by a non-validating parser.
1130 Fragment identifier considerations: Fragment identifiers used with
1131 application/alps+xml resources are simple, opaque strings that do
1132 not contain any URL unsafe characters per [RFC1738] which match
1133 the 'id' in an existing 'descriptor' in the document. For
1134 example, the fragment identifier "#user" refers to a descriptor in
1135 the document with an id value set to "user."
1137 Published specification: This Document
1139 Applications that use this media type: Various
1141 Additional information:
1143 magic number(s): none
1145 file extensions: .xml
1147 macintosh type file code: TEXT
1148 object idenfiers: none
1150 person to contact for further information:
1152 Name: Mike Amundsen
1154 Email: mca@amundsen.com
1156 Intended usage: Common
1158 Author/change controller: Mike Amundsen
1160 4.2. application/alps+json
1162 Type name: application
1164 Subtype name: alps+json
1166 Required parameters: None
1168 Optional parameters:
1170 profile A whitespace-separated list of IRIs identifying specific
1171 constraints or conventions that apply to an ALPS document. A
1172 profile must not change the semantics of the resource
1173 representation when processed without profile knowledge, so
1174 that clients both with and without knowledge of a profiled
1175 resource can safely use the same representation. The profile
1176 parameter may also be used by clients to express their
1177 preferences in the content negotiation process. It is
1178 recommended that profile IRIs are dereferenceable and provide
1179 useful documentation at that IRI.
1181 Encoding considerations: binary
1183 Security considerations: This media type shares security issues
1184 common to all JSON content types. See [RFC4627] Section #6 for
1185 additional information. ALPS+JSON does not provide executable
1186 content. Information contained in ALPS+JSON documents do not
1187 require privacy or integrity services.
1189 Interoperability considerations: None
1191 Fragment identifier considerations: Fragment identifiers used with
1192 application/alps+json resources are simple, opaque strings that do
1193 not contain any URL unsafe characters per [RFC1738] which match
1194 the 'id' in an existing 'descriptor' in the document. For
1195 example, the fragment identifier "#user" refers to a descriptor in
1196 the document with an id value set to "user."
1198 Published specification: This Document
1200 Applications that use this media type: Various
1202 Additional information:
1204 magic number(s): none
1206 file extensions: .json
1208 macintosh type file code: TEXT
1210 object idenfiers: none
1212 person to contact for further information:
1214 Name: Mike Amundsen
1216 Email: mca@amundsen.com
1218 Intended usage: Common
1220 Author/change controller: Mike Amundsen
1222 5. Internationalization Considerations
1224 [TK]
1226 [[CREF1: insert text (consider rfc 5987)]]
1228 6. Acknowledgements
1230 The authors gratefully acknowledge the following people who made
1231 contributions to this specification:
1233 Glenn Block, Christopher Harrison, Steve Klabnik, Graham Klyne,
1234 Dmitry Pavlov, Remon (Ray) Sinnema.
1236 7. References
1238 7.1. Normative References
1240 [RFC1738] Berners-Lee, T., Masinter, L., and M. McCahill, "Uniform
1241 Resource Locators (URL)", RFC 1738, December 1994.
1243 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
1244 Requirement Levels", BCP 14, RFC 2119, March 1997.
1246 [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media
1247 Types", RFC 3023, January 2001.
1249 [RFC4627] Crockford, D., "The application/json Media Type for
1250 JavaScript Object Notation (JSON)", RFC 4627, July 2006.
1252 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, October 2010.
1254 [RFC6906] Wilde, E., "The 'profile' Link Relation Type", RFC 6906,
1255 March 2013.
1257 [RFC7320] Nottingham, M., "URI Design and Ownership", BCP 190, RFC
1258 7320, July 2014.
1260 7.2. Informative References
1262 [I-D.ietf-appsawg-text-markdown]
1263 Leonard, S., "The text/markdown Media Type", draft-ietf-
1264 appsawg-text-markdown-05 (work in progress), December
1265 2014.
1267 Appendix A. Frequently Asked Questions
1269 A.1. Why are there no URLs in ALPS?
1271 ALPS is meant to describe a service in a universal way. The same
1272 ALPS description document can be used by many ALPS-compliant servers.
1273 Since each service implementation is in charge of their own URL
1274 space, ALPS descriptions do not include URLs. See URI Design and
1275 Ownership [RFC7320] for more on this principle.
1277 When implementing ALPS-compliant servers, implementors are free to
1278 use any URL design they wish. All that is required is that
1279 implementors use the same ALPS profile descriptor 'id' and 'name'
1280 properties in the representations. When implementing ALPS-compliant
1281 client applications, the URLs will be supplied at runtime by the
1282 server representations. Client apps only need to recognize the
1283 descriptor 'id' and 'name' values from the referenced ALPS profile
1284 document.
1286 A.2. Why is there no workflow component in the ALPS specification?
1288 ALPS is not designed to describe workflows or execution paths for a
1289 service. Instead, ALPS is designed to describe a shared set of data
1290 and actions elements that server MAY implement in order to create a
1291 service. Each action descriptor (where the descriptor's type
1292 property is set to 'safe', 'unsafe', or 'idemponent') SHOULD describe
1293 a state transition that a ALPS-compliant client application can
1294 invoke when it is available. Servers are free to implement the
1295 transitions they find useful and to arrange them in any order they
1296 wish. ALPS-compliant client applications SHOULD be able to recognize
1297 these descriptors when they appear and are free to act upon them
1298 directly, render them for humans to invoke, or ignore/hide them
1299 completely.
1301 A.3. Why is there no way to indicate ranges for semantic descriptors?
1303 For most all service implementations, there are cases where it would
1304 be helpful to document a range of possible values for a semantic
1305 element. For example, when implementing the descriptor {"id":"size",
1306 ...}, one service might want to indicate the list of supported values
1307 such as: 'small', 'meduim', 'large', etc. However, another service
1308 might have a very different list of possible values such as
1309 'standard', 'oversized', 'undersized', etc. And there may be a
1310 service that only supports a single value here and will always supply
1311 it ('onesize').
1313 Since ALPS is meant to provide a single description that can be used
1314 by multiple services, establishing ranges within the ALPS description
1315 is considered over-constraining service implementations. Services
1316 are free to supply this information within representations at run
1317 time. But including them in the global ALPS profile is discouraged.
1319 Authors' Addresses
1321 Mike Amundsen
1322 CA Technologies, Inc.
1324 EMail: mca@amundsen.com
1325 URI: http://amundsen.com
1327 Leonard Richardson
1329 EMail: leonardr@segfault.org
1330 URI: http://crummy.com
1332 Mark W. Foster
1334 EMail: mwf@fosrias.com