link-relations-0.1.1.0: Use web link relation types (RFC 5988) in Haskell

Safe HaskellNone
LanguageHaskell2010

Web.LinkRelations

Contents

Description

A simple web link between two web resources, e.g. a hyperlink in a webpage referring to another page, suggests that the resources are somehow related, but it doesn't say how they are related. For example, a blog post may link to the author's main page (relation: author of the post) but also link to the previous post (relation: previous post by chronological order).

Link relations provide a way to express the relation between resources linked by a web link.

A link relation type may be represented by a URI, or by a registered link relation name. IANA maintains a registry of link relations. This module provides access to them through a dedicated LinkRelation datatype.

This version of the package corresponds to the 2016-01-22 version of the registry.

Synopsis

Types and Conversions

data LinkRelation Source #

A web link relation type. Either a URI or a registered name.

fromURI :: URI -> LinkRelation Source #

Create a link relation type from a URI.

fromURIStr :: ByteString -> Maybe LinkRelation Source #

Try to parse a string into a URI, returning a link relation if successful.

fromName :: ByteString -> Maybe LinkRelation Source #

Try to match a given link relation name against the registered names. Return the matching link relation if successful.

fromByteString :: ByteString -> Maybe LinkRelation Source #

Try to parse the given string as a link relation, either as a registered name or as a URI. If both fail, return Nothing.

isURI :: LinkRelation -> Bool Source #

Check whether a link relation is represented by a URI, i.e. is not a link relation registered name.

isName :: LinkRelation -> Bool Source #

Check whether a link relation is represented by a registered name, i.e. is not a URI.

toByteString :: LinkRelation -> ByteString Source #

Get the official registered name of a link relation (if it's a name) or its URI string (if it's a URI).

Link Relation Identifiers

relAbout :: LinkRelation Source #

Refers to a resource that is the subject of the link's context.

Reference: RFC 6903, section 2

relArchives :: LinkRelation Source #

Refers to a collection of records, documents, or other materials of historical interest.

Reference: http://www.w3.org/TR/2011/WD-html5-20110113/links.html#rel-archives

relBlockedBy :: LinkRelation Source #

Identifies the entity blocking access to a resource folllowing on receipt of a legal demand.

Reference: RFC -ietf-httpbis-legally-restricted-status-04

relBookmark :: LinkRelation Source #

Gives a permanent link to use for bookmarking purposes.

Reference: http://www.w3.org/TR/html5/links.html#link-type-bookmark

relCanonical :: LinkRelation Source #

Designates the preferred version of a resource (the IRI and its contents).

Reference: RFC 6596

relChapter :: LinkRelation Source #

Refers to a chapter in a collection of resources.

Reference: http://www.w3.org/TR/1999/REC-html401-19991224

relCollection :: LinkRelation Source #

The target IRI points to a resource which represents the collection resource for the context IRI.

Reference: RFC 6573

relCopyright :: LinkRelation Source #

Refers to a copyright statement that applies to the link's context.

Reference: http://www.w3.org/TR/1999/REC-html401-19991224

relCreateForm :: LinkRelation Source #

The target IRI points to a resource where a submission form can be obtained.

Reference: RFC 6861

relCurrent :: LinkRelation Source #

Refers to a resource containing the most recent item(s) in a collection of resources.

Reference: RFC 5005

relDerivedfrom :: LinkRelation Source #

The target IRI points to a resource from which this material was derived.

Reference: draft-hoffman-xml2rfc

relDescribedby :: LinkRelation Source #

Refers to a resource providing information about the link's context.

Reference: http://www.w3.org/TR/powder-dr/#assoc-linking

relDescribes :: LinkRelation Source #

The relationship A 'describes' B asserts that resource A provides a description of resource B. There are no constraints on the format or representation of either A or B, neither are there any further constraints on either resource.

Reference: RFC 6892

Note: This link relation type is the inverse of the 'describedby' relation type. While 'describedby' establishes a relation from the described resource back to the resource that describes it, 'describes' established a relation from the describing resource to the resource it describes. If B is 'describedby' A, then A 'describes' B.

relDisclosure :: LinkRelation Source #

Refers to a list of patent disclosures made with respect to material for which 'disclosure' relation is specified.

Reference: RFC 6579

relDuplicate :: LinkRelation Source #

Refers to a resource whose available representations are byte-for-byte identical with the corresponding representations of the context IRI.

Reference: RFC 6249

Note: This relation is for static resources. That is, an HTTP GET request on any duplicate will return the same representation. It does not make sense for dynamic or POSTable resources and should not be used for them.

relEdit :: LinkRelation Source #

Refers to a resource that can be used to edit the link's context.

Reference: RFC 5023

relEditForm :: LinkRelation Source #

The target IRI points to a resource where a submission form for editing associated resource can be obtained.

Reference: RFC 6861

relEditMedia :: LinkRelation Source #

Refers to a resource that can be used to edit media associated with the link's context.

Reference: RFC 5023

relEnclosure :: LinkRelation Source #

Identifies a related resource that is potentially large and might require special handling.

Reference: RFC 4287

relFirst :: LinkRelation Source #

An IRI that refers to the furthest preceding resource in a series of resources.

Reference: RFC 5988

Note: This relation type registration did not indicate a reference. Originally requested by Mark Nottingham in December 2004.

relHosts :: LinkRelation Source #

Refers to a resource hosted by the server indicated by the link context.

Reference: RFC 6690

Note: This relation is used in CoRE where links are retrieved as a "/.well-known/core" resource representation, and is the default relation type in the CoRE Link Format.

relHub :: LinkRelation Source #

Refers to a hub that enables registration for notification of updates to the context.

Reference: http://pubsubhubbub.googlecode.com

Note: This relation type was requested by Brett Slatkin.

relIcon :: LinkRelation Source #

Refers to an icon representing the link's context.

Reference: http://www.w3.org/TR/html5/links.html#link-type-icon

relItem :: LinkRelation Source #

The target IRI points to a resource that is a member of the collection represented by the context IRI.

Reference: RFC 6573

relLast :: LinkRelation Source #

An IRI that refers to the furthest following resource in a series of resources.

Reference: RFC 5988

Note: This relation type registration did not indicate a reference. Originally requested by Mark Nottingham in December 2004.

relLatestVersion :: LinkRelation Source #

Points to a resource containing the latest (e.g., current) version of the context.

Reference: RFC 5829

relLicense :: LinkRelation Source #

Refers to a license associated with this context.

Reference: RFC 4946

Note: For implications of use in HTML, see: http://www.w3.org/TR/html5/links.html#link-type-license

relLrdd :: LinkRelation Source #

Refers to further information about the link's context, expressed as a LRDD ("Link-based Resource Descriptor Document") resource. See RFC 6415 for information about processing this relation type in host-meta documents. When used elsewhere, it refers to additional links and other metadata. Multiple instances indicate additional LRDD resources. LRDD resources MUST have an "application/xrd+xml" representation, and MAY have others.

Reference: RFC 6415

relMemento :: LinkRelation Source #

The Target IRI points to a Memento, a fixed resource that will not change state anymore.

Reference: RFC 7089

Note: A Memento for an Original Resource is a resource that encapsulates a prior state of the Original Resource.

relMonitor :: LinkRelation Source #

Refers to a resource that can be used to monitor changes in an HTTP resource.

Reference: RFC 5989

relMonitorGroup :: LinkRelation Source #

Refers to a resource that can be used to monitor changes in a specified group of HTTP resources.

Reference: RFC 5989

relNext :: LinkRelation Source #

Indicates that the link's context is a part of a series, and that the next in the series is the link target.

Reference: http://www.w3.org/TR/html5/links.html#link-type-next

relNextArchive :: LinkRelation Source #

Refers to the immediately following archive resource.

Reference: RFC 5005

relNofollow :: LinkRelation Source #

Indicates that the context’s original author or publisher does not endorse the link target.

Reference: http://www.w3.org/TR/html5/links.html#link-type-nofollow

relNoreferrer :: LinkRelation Source #

Indicates that no referrer information is to be leaked when following the link.

Reference: http://www.w3.org/TR/html5/links.html#link-type-noreferrer

relOriginal :: LinkRelation Source #

The Target IRI points to an Original Resource.

Reference: RFC 7089

Note: An Original Resource is a resource that exists or used to exist, and for which access to one of its prior states may be required.

relPayment :: LinkRelation Source #

Indicates a resource where payment is accepted.

Reference: RFC 5988

Note: This relation type registration did not indicate a reference. Requested by Joshua Kinberg and Robert Sayre. It is meant as a general way to facilitate acts of payment, and thus this specification makes no assumptions on the type of payment or transaction protocol. Examples may include a web page where donations are accepted or where goods and services are available for purchase. rel="payment" is not intended to initiate an automated transaction. In Atom documents, a link element with a rel="payment" attribute may exist at the feed/channel level and/or the entry/item level. For example, a rel="payment" link at the feed/channel level may point to a "tip jar" URI, whereas an entry/ item containing a book review may include a rel="payment" link that points to the location where the book may be purchased through an online retailer.

relPredecessorVersion :: LinkRelation Source #

Points to a resource containing the predecessor version in the version history.

Reference: RFC 5829

relPrefetch :: LinkRelation Source #

Indicates that the link target should be preemptively cached.

Reference: http://www.w3.org/TR/html5/links.html#link-type-prefetch

relPreload :: LinkRelation Source #

Refers to a resource that should be loaded early in the processing of the link's context, without blocking rendering.

Reference: http://www.w3.org/TR/preload/

Note: Additional target attributes establish the detailed fetch properties of the link.

relPrev :: LinkRelation Source #

Indicates that the link's context is a part of a series, and that the previous in the series is the link target.

Reference: http://www.w3.org/TR/html5/links.html#link-type-prev

relPreview :: LinkRelation Source #

Refers to a resource that provides a preview of the link's context.

Reference: RFC 6903, section 3

relPrevious :: LinkRelation Source #

Refers to the previous resource in an ordered series of resources. Synonym for "prev".

Reference: http://www.w3.org/TR/1999/REC-html401-19991224

relPrevArchive :: LinkRelation Source #

Refers to the immediately preceding archive resource.

Reference: RFC 5005

relPrivacyPolicy :: LinkRelation Source #

Refers to a privacy policy associated with the link's context.

Reference: RFC 6903, section 4

relProfile :: LinkRelation Source #

Identifying that a resource representation conforms to a certain profile, without affecting the non-profile semantics of the resource representation.

Reference: RFC 6906

Note: Profile URIs are primarily intended to be used as identifiers, and thus clients SHOULD NOT indiscriminately access profile URIs.

relRelated :: LinkRelation Source #

Identifies a related resource.

Reference: RFC 4287

relReplies :: LinkRelation Source #

Identifies a resource that is a reply to the context of the link.

Reference: RFC 4685

relSearch :: LinkRelation Source #

Refers to a resource that can be used to search through the link's context and related resources.

Reference: http://www.opensearch.org/Specifications/OpenSearch/1.1

relSection :: LinkRelation Source #

Refers to a section in a collection of resources.

Reference: http://www.w3.org/TR/1999/REC-html401-19991224

relSelf :: LinkRelation Source #

Conveys an identifier for the link's context.

Reference: RFC 4287

relService :: LinkRelation Source #

Indicates a URI that can be used to retrieve a service document.

Reference: RFC 5023

Note: When used in an Atom document, this relation type specifies Atom Publishing Protocol service documents by default. Requested by James Snell.

relStart :: LinkRelation Source #

Refers to the first resource in a collection of resources.

Reference: http://www.w3.org/TR/1999/REC-html401-19991224

relSubsection :: LinkRelation Source #

Refers to a resource serving as a subsection in a collection of resources.

Reference: http://www.w3.org/TR/1999/REC-html401-19991224

relSuccessorVersion :: LinkRelation Source #

Points to a resource containing the successor version in the version history.

Reference: RFC 5829

relTag :: LinkRelation Source #

Gives a tag (identified by the given address) that applies to the current document.

Reference: http://www.w3.org/TR/html5/links.html#link-type-tag

relTermsOfService :: LinkRelation Source #

Refers to the terms of service associated with the link's context.

Reference: RFC 6903, section 5

relTimegate :: LinkRelation Source #

The Target IRI points to a TimeGate for an Original Resource.

Reference: RFC 7089

Note: A TimeGate for an Original Resource is a resource that is capable of datetime negotiation to support access to prior states of the Original Resource.

relTimemap :: LinkRelation Source #

The Target IRI points to a TimeMap for an Original Resource.

Reference: RFC 7089

Note: A TimeMap for an Original Resource is a resource from which a list of URIs of Mementos of the Original Resource is available.

relType :: LinkRelation Source #

Refers to a resource identifying the abstract semantic type of which the link's context is considered to be an instance.

Reference: RFC 6903, section 6

relUp :: LinkRelation Source #

Refers to a parent document in a hierarchy of documents.

Reference: RFC 5988

Note: This relation type registration did not indicate a reference. Requested by Noah Slater.

relVersionHistory :: LinkRelation Source #

Points to a resource containing the version history for the context.

Reference: RFC 5829

relVia :: LinkRelation Source #

Identifies a resource that is the source of the information in the link's context.

Reference: RFC 4287

relWorkingCopy :: LinkRelation Source #

Points to a working copy for this resource.

Reference: RFC 5829

relWorkingCopyOf :: LinkRelation Source #

Points to the versioned resource from which this working copy was obtained.

Reference: RFC 5829