Safe Haskell | None |
---|---|
Language | Haskell2010 |
Web.LinkRelations
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 2015-01-21 version of the registry.
- data LinkRelation
- fromURI :: URI -> LinkRelation
- fromURIStr :: ByteString -> Maybe LinkRelation
- fromName :: ByteString -> Maybe LinkRelation
- fromByteString :: ByteString -> Maybe LinkRelation
- isURI :: LinkRelation -> Bool
- isName :: LinkRelation -> Bool
- toByteString :: LinkRelation -> ByteString
- relAbout :: LinkRelation
- relAlternate :: LinkRelation
- relAppendix :: LinkRelation
- relArchives :: LinkRelation
- relAuthor :: LinkRelation
- relBookmark :: LinkRelation
- relCanonical :: LinkRelation
- relChapter :: LinkRelation
- relCollection :: LinkRelation
- relContents :: LinkRelation
- relCopyright :: LinkRelation
- relCreateForm :: LinkRelation
- relCurrent :: LinkRelation
- relDerivedfrom :: LinkRelation
- relDescribedby :: LinkRelation
- relDescribes :: LinkRelation
- relDisclosure :: LinkRelation
- relDuplicate :: LinkRelation
- relEdit :: LinkRelation
- relEditForm :: LinkRelation
- relEditMedia :: LinkRelation
- relEnclosure :: LinkRelation
- relFirst :: LinkRelation
- relGlossary :: LinkRelation
- relHelp :: LinkRelation
- relHosts :: LinkRelation
- relHub :: LinkRelation
- relIcon :: LinkRelation
- relIndex :: LinkRelation
- relItem :: LinkRelation
- relLast :: LinkRelation
- relLatestVersion :: LinkRelation
- relLicense :: LinkRelation
- relLrdd :: LinkRelation
- relMemento :: LinkRelation
- relMonitor :: LinkRelation
- relMonitorGroup :: LinkRelation
- relNext :: LinkRelation
- relNextArchive :: LinkRelation
- relNofollow :: LinkRelation
- relNoreferrer :: LinkRelation
- relOriginal :: LinkRelation
- relPayment :: LinkRelation
- relPredecessorVersion :: LinkRelation
- relPrefetch :: LinkRelation
- relPrev :: LinkRelation
- relPreview :: LinkRelation
- relPrevious :: LinkRelation
- relPrevArchive :: LinkRelation
- relPrivacyPolicy :: LinkRelation
- relProfile :: LinkRelation
- relRelated :: LinkRelation
- relReplies :: LinkRelation
- relSearch :: LinkRelation
- relSection :: LinkRelation
- relSelf :: LinkRelation
- relService :: LinkRelation
- relStart :: LinkRelation
- relStylesheet :: LinkRelation
- relSubsection :: LinkRelation
- relSuccessorVersion :: LinkRelation
- relTag :: LinkRelation
- relTermsOfService :: LinkRelation
- relTimegate :: LinkRelation
- relTimemap :: LinkRelation
- relType :: LinkRelation
- relUp :: LinkRelation
- relVersionHistory :: LinkRelation
- relVia :: LinkRelation
- relWorkingCopy :: LinkRelation
- relWorkingCopyOf :: LinkRelation
Types and Conversions
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
relAlternate :: LinkRelation Source #
Refers to a substitute for this context
Reference: http://www.w3.org/TR/html5/links.html#link-type-alternate
relAppendix :: LinkRelation Source #
Refers to an appendix.
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
relAuthor :: LinkRelation Source #
Refers to the context's author.
Reference: http://www.w3.org/TR/html5/links.html#link-type-author
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.
relCollection :: LinkRelation Source #
The target IRI points to a resource which represents the collection resource for the context IRI.
Reference: RFC 6573
relContents :: LinkRelation Source #
Refers to a table of contents.
relCopyright :: LinkRelation Source #
Refers to a copyright statement that applies to the link's context.
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.
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.
relGlossary :: LinkRelation Source #
Refers to a glossary of terms.
relHelp :: LinkRelation Source #
Refers to context-sensitive help.
Reference: http://www.w3.org/TR/html5/links.html#link-type-help
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
relIndex :: LinkRelation Source #
Refers to an index.
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
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".
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.
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.
relStylesheet :: LinkRelation Source #
Refers to a stylesheet.
Reference: http://www.w3.org/TR/html5/links.html#link-type-stylesheet
relSubsection :: LinkRelation Source #
Refers to a resource serving as a subsection in a collection of resources.
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