Skip to content

Latest commit

 

History

History
331 lines (175 loc) · 10.1 KB

link.schema.md

File metadata and controls

331 lines (175 loc) · 10.1 KB

Link Schema

https://ns.adobe.com/xdm/external/activity-streams-2/link

A Link is an indirect, qualified reference to a resource identified by a URL. The fundamental model for links is established by RFC5988. Many of the properties defined by the Activity Vocabulary allow values that are either instances of [Object](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-object) or [Link](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link). When a [Link](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link) is used, it establishes a qualified relation connecting the subject (the containing object) to the resource identified by the [href](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-href). Properties of the [Link](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link) are properties of the reference as opposed to properties of the resource.

Abstract Extensible Status Identifiable Custom Properties Additional Properties Defined In
Can be instantiated Yes Experimental No Forbidden Permitted external/activity-streams-2/link.schema.json

Schema Hierarchy

  • Link https://ns.adobe.com/xdm/external/activity-streams-2/link
    • Object https://ns.adobe.com/xdm/external/activity-streams-2/object
    • RDF Language Tagged String https://ns.adobe.com/xdm/external/activity-streams-2/rdf-langstring
    • Link https://ns.adobe.com/xdm/external/activity-streams-2/link

Link Example

{
  "@context": {
    "activitystreams": "http://www.w3.org/ns/activitystreams#"
  },
  "@type": "https://www.w3.org/ns/activitystreams#Link",
  "activitystreams:href": "http://example.org/abc",
  "activitystreams:hreflang": "en",
  "activitystreams:mediaType": "text/html",
  "activitystreams:name": "An example link"
}

Link Properties

Property Type Required Defined by
activitystreams:height integer Optional Link (this schema)
activitystreams:href string Optional Link (this schema)
activitystreams:hreflang string Optional Link (this schema)
activitystreams:mediaType string Optional Link (this schema)
activitystreams:name complex Optional Link (this schema)
activitystreams:preview complex Optional Link (this schema)
activitystreams:rel complex Optional Link (this schema)
activitystreams:width integer Optional Link (this schema)
* any Additional this schema allows additional properties

activitystreams:height

On a Link, specifies a hint as to the rendering height in device-independent pixels of the linked resource. Refer to the Activity Streams 2.0 Core document for a complete description.

activitystreams:height

  • is optional
  • type: integer
  • defined in this schema

activitystreams:height Type

integer

  • minimum value: 0

activitystreams:href

The target resource pointed to by a Link. Refer to the Activity Streams 2.0 Core document for a complete description.

activitystreams:href

  • is optional
  • type: string
  • defined in this schema

activitystreams:href Type

string

  • format: uri – Uniformous Resource Identifier (according to RFC3986)

activitystreams:hreflang

Language Tag

Hints as to the language used by the target resource. Value must be a [BCP47] Language-Tag. Refer to the Activity Streams 2.0 Core document for a complete description.

activitystreams:hreflang

  • is optional
  • type: string
  • defined in this schema

activitystreams:hreflang Type

string

All instances must conform to this regular expression (test examples here):

^(((([A-Za-z]{2,3}(-([A-Za-z]{3}(-[A-Za-z]{3}){0,2}))?)|[A-Za-z]{4}|[A-Za-z]{5,8})(-([A-Za-z]{4}))?(-([A-Za-z]{2}|[0-9]{3}))?(-([A-Za-z0-9]{5,8}|[0-9][A-Za-z0-9]{3}))*(-([0-9A-WY-Za-wy-z](-[A-Za-z0-9]{2,8})+))*(-(x(-[A-Za-z0-9]{1,8})+))?)|(x(-[A-Za-z0-9]{1,8})+)|((en-GB-oed|i-ami|i-bnn|i-default|i-enochian|i-hak|i-klingon|i-lux|i-mingo|i-navajo|i-pwn|i-tao|i-tay|i-tsu|sgn-BE-FR|sgn-BE-NL|sgn-CH-DE)|(art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang)))$

activitystreams:mediaType

MIME Media Type

When used on a Link, identifies the MIME media type of the referenced resource. When used on an Object, identifies the MIME media type of the value of the content property. If not specified, the content property is assumed to contain text/html content. Refer to the Activity Streams 2.0 Core document for a complete description.

activitystreams:mediaType

  • is optional
  • type: string
  • defined in this schema

activitystreams:mediaType Type

string

All instances must conform to this regular expression (test examples here):

\w+\/[-.\w]+(?:\+[-.\w]+)?

activitystreams:name

Refer to the Activity Streams 2.0 Core document for a complete description.

activitystreams:name

  • is optional
  • type: complex
  • defined in this schema

activitystreams:name Type

One of the following conditions need to be fulfilled.

Condition 1

string

Condition 2

  • https://ns.adobe.com/xdm/external/activity-streams-2/rdf-langstring

activitystreams:preview

Identifies an entity that provides a preview of this object. Refer to the Activity Streams 2.0 Core document for a complete description.

activitystreams:preview

  • is optional
  • type: complex
  • defined in this schema

activitystreams:preview Type

One of the following conditions need to be fulfilled.

Condition 1

Any following options needs to be fulfilled.

Option 1

string

  • format: uri – Uniformous Resource Identifier (according to RFC3986)

Option 2

  • Objecthttps://ns.adobe.com/xdm/external/activity-streams-2/object

Option 3

  • Linkhttps://ns.adobe.com/xdm/external/activity-streams-2/link

Condition 2

Array type:

All items must be of the type: Unknown type anyOf.

{
  "items": {
    "anyOf": [
      {
        "type": "string",
        "format": "uri"
      },
      {
        "$ref": "https://ns.adobe.com/xdm/external/activity-streams-2/object",
        "$linkVal": "Object",
        "$linkPath": "object.schema.md"
      },
      {
        "$ref": "https://ns.adobe.com/xdm/external/activity-streams-2/link",
        "$linkVal": "Link",
        "$linkPath": "link.schema.md"
      }
    ],
    "type": "anyOf"
  },
  "type": "array"
}

activitystreams:rel

Link Relation

A link relation associated with a [Link](https://www.w3.org/TR/activitystreams-vocabulary/#dfn-link). The value MUST conform to both the HTML5 and RFC5988 'link relation' definitions. In the HTML5, any string not containing the 'space' U+0020, 'tab' (U+0009), 'LF' (U+000A), 'FF' (U+000C), 'CR' (U+000D) or ',' (U+002C) characters can be used as a valid link relation.

activitystreams:rel

  • is optional
  • type: complex
  • defined in this schema

activitystreams:rel Type

One of the following conditions need to be fulfilled.

Condition 1

string

All instances must conform to this regular expression (test examples here):

^[a-z]([a-z]|[0-9]|\.|-)*$

Condition 2

Array type:

All items must be of the type: string

All instances must conform to this regular expression (test examples here):

^[a-z]([a-z]|[0-9]|\.|-)*$

activitystreams:width

On a Link, specifies a hint as to the rendering width in device-independent pixels of the linked resource. Refer to the Activity Streams 2.0 Core document for a complete description.

activitystreams:width

  • is optional
  • type: integer
  • defined in this schema

activitystreams:width Type

integer

  • minimum value: 0