diff --git a/spec/latest/core/core.jsonld b/spec/latest/core/core.jsonld index f186896..f0f93d2 100644 --- a/spec/latest/core/core.jsonld +++ b/spec/latest/core/core.jsonld @@ -28,6 +28,12 @@ "method": "hydra:method", "expects": { "@id": "hydra:expects", "@type": "@vocab" }, "returns": { "@id": "hydra:returns", "@type": "@vocab" }, + "retractedOperation": { "@id": "hydra:retractedOperation", "@type": "@vocab" }, + "reason": { "@id": "hydra:reason", "@type": "@vocab" }, + "RetractedOperationSpecification": "hydra:RetractedOperationSpecification", + "UnavailabilityReason": "hydra:UnavailabilityReason", + "Unavailable": "hydra:Unavailable", + "Unauthorized": "hydra:Unauthorized", "possibleStatus": { "@id": "hydra:possibleStatus", "@type": "@id" }, "Status": "hydra:Status", "statusCode": "hydra:statusCode", @@ -92,7 +98,7 @@ "@id": "http://www.w3.org/ns/hydra/core", "@type": "owl:Ontology", "label": "The Hydra Core Vocabulary", - "comment": "A lightweight vocabulary for hypermedia-driven Web APIs", + "comment": "A lightweight vocabulary for hypermedia-driven Web APIs.", "seeAlso": "https://www.hydra-cg.com/spec/latest/core/", "preferredPrefix": "hydra", "dc:description": "The Hydra Core Vocabulary is a lightweight vocabulary to create hypermedia-driven Web APIs. By specifying a number of concepts commonly used in Web APIs it enables the creation of generic API clients.", @@ -108,7 +114,7 @@ "label": "Hydra Resource", "comment": "The class of dereferenceable resources by means a client can attempt to dereference; however, the received responses should still be verified.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:Class", @@ -117,7 +123,7 @@ "label": "Hydra Class", "comment": "The class of Hydra classes.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:Link", @@ -126,66 +132,118 @@ "label": "Link", "comment": "The class of properties representing links.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:apiDocumentation", "@type": "hydra:Link", "label": "apiDocumentation", - "comment": "A link to the API documentation", + "comment": "A link to the API documentation.", "range": "hydra:ApiDocumentation", "domain": "hydra:Resource", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:ApiDocumentation", "@type": "hydra:Class", "subClassOf": "hydra:Resource", "label": "ApiDocumentation", - "comment": "The Hydra API documentation class", + "comment": "The Hydra API documentation class.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:entrypoint", "@type": "hydra:Link", "label": "entrypoint", - "comment": "A link to main entry point of the Web API", + "comment": "A link to main entry point of the Web API.", "domain": "hydra:ApiDocumentation", "range": "hydra:Resource", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:supportedClass", "@type": "hydra:Link", "label": "supported classes", - "comment": "A class known to be supported by the Web API", + "comment": "A class known to be supported by the Web API.", "domain": "hydra:ApiDocumentation", "range": "rdfs:Class", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, + { + "@id": "hydra:retractedOperation", + "@type": "rdf:Property", + "label": "retracted operation", + "comment": "Retracts available operations.", + "range": "hydra:RetractedOperationSpecification", + "domain": "hydra:Resource", + "isDefinedBy": "http://www.w3.org/ns/hydra/core", + "vs:term_status": "stable" + }, + { + "@id": "hydra:RetractedOperationSpecification", + "@type": "hydra:Class", + "label": "retracted operation specification", + "comment": "Describes which and why an operation is retracted.", + "isDefinedBy": "http://www.w3.org/ns/hydra/core", + "vs:term_status": "stable" + }, + { + "@id": "hydra:reason", + "@type": "rdf:Property", + "label": "reason", + "comment": "Reason of why the operation is retracted.", + "range": "hydra:UnavailabilityReason", + "domain": "hydra:RetractedOperationSpecification", + "isDefinedBy": "http://www.w3.org/ns/hydra/core", + "vs:term_status": "stable" + }, + { + "@id": "hydra:UnavailabilityReason", + "@type": "hydra:Class", + "label": "Unavailability reason", + "comment": "Provides reasons why the operation cannot be invoked.", + "isDefinedBy": "http://www.w3.org/ns/hydra/core", + "vs:term_status": "stable" + }, + { + "@id": "hydra:Unavailable", + "@type": "hydra:UnavailabilityReason", + "label": "Unavailable", + "comment": "States an operation previously announced is unavailable in current circumstances.", + "isDefinedBy": "http://www.w3.org/ns/hydra/core", + "vs:term_status": "stable" + }, + { + "@id": "hydra:Unauthorized", + "@type": "hydra:Availability", + "label": "Unauthorized", + "comment": "States an operation previously announced should not be invoked as the current user is not authorized to invoke it.", + "isDefinedBy": "http://www.w3.org/ns/hydra/core", + "vs:term_status": "stable" + }, { "@id": "hydra:possibleStatus", "@type": "hydra:Link", "label": "possible status", - "comment": "A status that might be returned by the Web API (other statuses should be expected and properly handled as well)", + "comment": "A status that might be returned by the Web API (other statuses should be expected and properly handled as well).", "range": "hydra:Status", - "domainIncludes": ["hydra:ApiDocumentation", "hydra:Operation"], + "domainIncludes": ["hydra:ApiDocumentation", "hydra:Operation", "hydra:RetractedOperationSpecification"], "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:supportedProperty", "@type": "hydra:Link", "label": "supported properties", - "comment": "The properties known to be supported by a Hydra class", + "comment": "The properties known to be supported by a Hydra class.", "domain": "rdfs:Class", "range": "hydra:SupportedProperty", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:SupportedProperty", @@ -193,17 +251,17 @@ "label": "Supported Property", "comment": "A property known to be supported by a Hydra class.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:property", "@type": "rdf:Property", "label": "property", - "comment": "A property", + "comment": "A property.", "range": "rdf:Property", "domainIncludes": ["hydra:SupportedProperty", "hydra:IriTemplateMapping"], "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:required", @@ -213,7 +271,7 @@ "range": "xsd:boolean", "domainIncludes": ["hydra:SupportedProperty", "hydra:IriTemplateMapping"], "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:readable", @@ -223,7 +281,7 @@ "domain": "hydra:SupportedProperty", "range": "xsd:boolean", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:writable", @@ -233,7 +291,7 @@ "domain": "hydra:SupportedProperty", "range": "xsd:boolean", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:writeable", @@ -247,21 +305,21 @@ "@id": "hydra:supportedOperation", "@type": "hydra:Link", "label": "supported operation", - "comment": "An operation supported by instances of the specific Hydra class, or the target of the Hydra link, or IRI template.", + "comment": "An operation supported by instances of the specific Hydra class, or the target of the Hydra link, or Iri template.", "range": "hydra:Operation", "domainIncludes": ["rdfs:Class", "hydra:Class", "hydra:Link", "hydra:TemplatedLink", "hydra:SupportedProperty"], "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:operation", "@type": "hydra:Link", "label": "operation", - "comment": "An operation supported by the Hydra resource", + "comment": "An operation supported by the Hydra resource.", "domain": "hydra:Resource", "range": "hydra:Operation", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:Operation", @@ -269,37 +327,37 @@ "label": "Operation", "comment": "An operation.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:method", "@type": "rdf:Property", "label": "method", - "comment": "The HTTP method.", - "domain": "hydra:Operation", + "comment": "The protocol method.", + "domainIncludes": ["hydra:Operation", "hydra:RetractedOperationSpecification"], "range": "xsd:string", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:expects", "@type": "hydra:Link", "label": "expects", "comment": "The information expected by the Web API.", - "domain": "hydra:Operation", + "domainIncludes": ["hydra:Operation", "hydra:RetractedOperationSpecification"], "rangeIncludes": ["rdfs:Resource", "hydra:Resource", "rdfs:Class", "hydra:Class"], "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:returns", "@type": "hydra:Link", "label": "returns", - "comment": "The information returned by the Web API on success", - "domain": "hydra:Operation", + "comment": "The information returned by the Web API on success.", + "domainIncludes": ["hydra:Operation", "hydra:RetractedOperationSpecification"], "rangeIncludes": ["rdfs:Resource", "hydra:Resource", "rdfs:Class", "hydra:Class"], "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:Status", @@ -307,17 +365,17 @@ "label": "Status code description", "comment": "Additional information about a status code that might be returned.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:statusCode", "@type": "rdf:Property", "label": "status code", - "comment": "The HTTP status code. Please note it may happen this value will be different to actual status code received.", + "comment": "The response status code. Please note it may happen this value will be different to actual status code received.", "domain": "hydra:Status", "range": "xsd:integer", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:title", @@ -336,7 +394,7 @@ "hydra:TemplatedLink" ], "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:description", @@ -355,7 +413,7 @@ "hydra:TemplatedLink" ], "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:Error", @@ -364,7 +422,7 @@ "label": "Error", "comment": "A runtime error, used to report information beyond the returned status code.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:Collection", @@ -373,7 +431,7 @@ "label": "Collection", "comment": "A collection holding references to a number of related resources.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:collection", @@ -382,15 +440,15 @@ "comment": "Collections somehow related to this resource.", "range": "hydra:Collection", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:memberAssertion", "label": "member assertion", "comment": "Semantics of each member provided by the collection.", - "domain": "hydra:Collection", + "domainIncludes": ["hydra:Collection", "hydra:Class"], "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:manages", @@ -405,23 +463,23 @@ "label": "subject", "comment": "The subject.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:object", "label": "object", "comment": "The object.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:member", "@type": "hydra:Link", "label": "member", - "comment": "A member of the collection", + "comment": "A member of the collection.", "domain": "hydra:Collection", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:view", @@ -429,16 +487,16 @@ "label": "view", "comment": "A specific view of a resource.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:PartialCollectionView", "@type": "hydra:Class", "subClassOf": "hydra:Resource", "label": "PartialCollectionView", - "comment": "A PartialCollectionView describes a partial view of a Collection. Multiple PartialCollectionViews can be connected with the the next/previous properties to allow a client to retrieve all members of the collection.", + "comment": "A PartialCollectionView describes a partial view of a Collection. Multiple PartialCollectionViews can be connected with the next/previous properties to allow a client to retrieve all members of the collection.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:totalItems", @@ -448,7 +506,7 @@ "domain": "hydra:Collection", "range": "xsd:integer", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:first", @@ -458,7 +516,7 @@ "domain": "hydra:Resource", "range": "hydra:Resource", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:last", @@ -468,7 +526,7 @@ "domain": "hydra:Resource", "range": "hydra:Resource", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:next", @@ -478,7 +536,7 @@ "domain": "hydra:Resource", "range": "hydra:Resource", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:previous", @@ -488,17 +546,17 @@ "domain": "hydra:Resource", "range": "hydra:Resource", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:search", "@type": "hydra:TemplatedLink", "label": "search", - "comment": "A IRI template that can be used to query a collection.", + "comment": "A Iri template that can be used to query a collection.", "range": "hydra:IriTemplate", "domain": "hydra:Resource", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:freetextQuery", @@ -508,7 +566,7 @@ "range": "xsd:string", "domain": "hydra:Resource", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:TemplatedLink", @@ -517,7 +575,7 @@ "label": "Templated Link", "comment": "A templated link.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:IriTemplate", @@ -525,7 +583,7 @@ "label": "IRI Template", "comment": "The class of IRI templates.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:template", @@ -536,7 +594,7 @@ "domain": "hydra:IriTemplate", "range": "hydra:Rfc6570Template", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:Rfc6570Template", @@ -546,17 +604,17 @@ "seeAlso": "http://tools.ietf.org/html/rfc6570", "range": "xsd:string", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:variableRepresentation", "@type": "rdf:Property", "label": "variable representation", - "comment": "The representation format to use when expanding the IRI template.", + "comment": "The representation format to use when expanding the Iri template.", "range": "hydra:VariableRepresentation", - "domain": "hydra:IriTemplateMapping", + "domainIncludes": ["hydra:IriTemplateMapping", "hydra:IriTemplate"], "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:VariableRepresentation", @@ -564,7 +622,7 @@ "label": "VariableRepresentation", "comment": "A representation specifies how to serialize variable values into strings.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:BasicRepresentation", @@ -572,7 +630,7 @@ "label": "BasicRepresentation", "comment": "A representation that serializes just the lexical form of a variable value, but omits language and type information.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:ExplicitRepresentation", @@ -580,7 +638,7 @@ "label": "ExplicitRepresentation", "comment": "A representation that serializes a variable value including its language and type information and thus differentiating between IRIs and literals.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:mapping", @@ -590,7 +648,7 @@ "domain": "hydra:IriTemplate", "range": "hydra:IriTemplateMapping", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:IriTemplateMapping", @@ -598,26 +656,27 @@ "label": "IriTemplateMapping", "comment": "A mapping from an IRI template variable to a property.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:variable", "@type": "rdf:Property", "label": "variable", - "comment": "An IRI template variable", + "comment": "An Iri template variable.", "domain": "hydra:IriTemplateMapping", "range": "xsd:string", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:resolveRelativeUsing", "@type": "rdf:Property", "label": "relative Uri resolution", + "comment": "Instructs on how to resolve relative Uri created by the Iri template resolution.", "domain": "hydra:IriTemplate", "range": "hydra:BaseUriSource", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:BaseUriSource", @@ -626,7 +685,7 @@ "label": "Base Uri source", "comment": "Provides a base abstract for base Uri source for Iri template resolution.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:Rfc3986", @@ -634,15 +693,15 @@ "label": "RFC 3986 based", "comment": "States that the base Uri should be established using RFC 3986 reference resolution algorithm specified in section 5.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:LinkContext", "@type": "hydra:BaseUriSource", "label": "Link context", - "comment": "States that the link's context IRI, as defined in RFC 5988, should be used as the base Uri", + "comment": "States that the link's context IRI, as defined in RFC 5988, should be used as the base Uri.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:offset", @@ -651,7 +710,7 @@ "comment": "Instructs to skip N elements of the set.", "range": "xsd:nonNegativeInteger", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:limit", @@ -660,7 +719,7 @@ "comment": "Instructs to limit set only to N elements.", "range": "xsd:nonNegativeInteger", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:pageIndex", @@ -670,7 +729,7 @@ "comment": "Instructs to provide a specific page of the collection at a given index.", "range": "xsd:nonNegativeInteger", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:pageReference", @@ -678,7 +737,7 @@ "label": "page reference", "comment": "Instructs to provide a specific page reference of the collection.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:returnsHeader", @@ -688,7 +747,7 @@ "domain": "hydra:Operation", "rangeIncludes": ["xsd:string", "hydra:HeaderSpecification"], "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:expectsHeader", @@ -698,16 +757,16 @@ "domain": "hydra:Operation", "rangeIncludes": ["xsd:string", "hydra:HeaderSpecification"], "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:HeaderSpecification", "@type": "rdfs:Class", "subClassOf": "hydra:Resource", "label": "Header specification", - "comment": "Specifies a possible either expected or returned header values", + "comment": "Specifies a possible either expected or returned header values.", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:headerName", @@ -717,7 +776,7 @@ "domain": "hydra:HeaderSpecification", "range": "xsd:string", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:possibleValue", @@ -726,7 +785,7 @@ "comment": "Possible value of the header.", "domain": "hydra:HeaderSpecification", "range": "xsd:string", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:closedSet", @@ -736,7 +795,7 @@ "domain": "hydra:HeaderSpecification", "range": "xsd:boolean", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" }, { "@id": "hydra:extension", @@ -745,7 +804,7 @@ "comment": "Hint on what kind of extensions are in use.", "domain": "hydra:ApiDocumentation", "isDefinedBy": "http://www.w3.org/ns/hydra/core", - "vs:term_status": "testing" + "vs:term_status": "stable" } ] } diff --git a/spec/latest/core/index.bs b/spec/latest/core/index.bs new file mode 100644 index 0000000..5fc237a --- /dev/null +++ b/spec/latest/core/index.bs @@ -0,0 +1,6265 @@ +
+Title: Hydra Core Vocabulary
+Shortname: hydra
+Level: 1
+Status: LD
+Group: HydraCG
+URL: https://www.hydra-cg.com/spec/latest/core/
+!Author: Markus Lanthaler
+!Author: Karol Szczepanski
+Editor: Markus Lanthaler
+Editor: Karol Szczepanski
+Abstract: Hydra is a lightweight vocabulary to create hypermedia-driven Web APIs. By specifying a number of concepts commonly used in Web APIs it enables the creation of generic API clients.
+Markup Shorthands: markdown yes
+Markup Shorthands: dfn yes
+Line Numbers: yes
+
+ + +Status of This Document {#sotd} +======================= +This specification was published by the [[!HydraCG]]. +It is not a W3C Standard, nor it is on the W3C Standards Track. +Please note that under the +*W3C Community Contributor License Agreement (CLA)* +there is a limited opt-out and other conditions apply. +Learn more about *W3C Community and Business Groups*. + +## Conventions ## {#conventions} + +Within this document, the following namespace prefix bindings are used: + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
PrefixNamespace
hydra:http://www.w3.org/ns/hydra/core#
rdf:http://www.w3.org/1999/02/22-rdf-syntax-ns#
rdfs:http://www.w3.org/2000/01/rdf-schema#
xsd:http://www.w3.org/2001/XMLSchema#
owl:http://www.w3.org/2002/07/owl#
vs:http://www.w3.org/2003/06/sw-vocab-status/ns#
dc:http://purl.org/dc/terms/
cc:http://creativecommons.org/ns#
schema:http://schema.org/
+ +Introduction {#introduction} +============ + +Note: This section is non-normative. + +Coping with the ever-increasing amount of data becomes increasingly +challenging. To alleviate the information overload put on people, +systems are progressively being connected directly to each other. +They exchange, analyze, and manipulate humongous amounts of data +without any human interaction. Most current solutions, however, +do not exploit the whole potential of the architecture of the World +Wide Web and completely ignore the possibilities offered by Linked Data +technologies. + +The combination of the REST architectural style, and the Linked +Data principles offer opportunities to advance the Web of machines +in a similar way that hypertext did for the human Web. Most +building blocks exist already and are in place, but they are rarely +used together. Hydra tries to fill that gap. It allows data +to be enriched with machine-readable affordances which enable interaction. +This not only addresses the problem that Linked Data is still mostly +read-only, but it also paves the way for a completely new breed +of interoperable Web APIs. The fact that it enables the creation +of composable contracts means that interaction models of Web APIs +can be reused at an unprecedented granularity. + +Hydra at a Glance {#hydra-at-a-glance} +================= + +Note: This section is non-normative. + +The basic idea behind Hydra is to provide a vocabulary which enables a +server to advertise valid state transitions to a client. A client can +then use this information to construct requests (i.e. compliant with +an HTTP protocol) which modify the server’s state so that a certain +desired goal is achieved. Since all the information about the valid state +transitions is exchanged in a machine-processable way at runtime +instead of being hardcoded into the client at design time, clients +can be decoupled from the server and adapt to changes more easily. + +The namespace of the Hydra core vocabulary +is `http://www.w3.org/ns/hydra/core#`, and the suggested prefix +is `hydra`. The figure below illustrates the vocabulary +(the figure’s goal is to show how Hydra is used rather than its precise +definition). + +The Hydra core vocabulary + +An alphabetical index of the classes and properties of Hydra +is given below. All the terms are hyperlinked to their detailed +description for quick reference. + +Using Hydra {#using-hydra} +=========== + +Throughout this section, a simple Web API featuring an issue tracker +will be used to illustrate how Hydra can be used. The Web API enables +its users to file new issues, modify or delete existing ones, and +to comment them. For the sake of simplicity, orthogonal aspects such +as authentication or authorization are not covered. + +## Adding Affordances to Representations ## {#adding-affordances-to-representations} + +The exemplary Web API has to expose representations of issues and +comments. To enable interaction with those resources, a client has +to know which operations the server supports. In human-facing +websites such affordances are typically exposed by links and forms +and described in natural language. Unfortunately, machines can not +interpret such information easily. The solution that presents itself +is to reduce the language to a few unambiguous concepts which are easily +recognizable by a machine client. Hydra formalizes such concepts. + +The simplest and most important affordance on the Web are hyperlinks. +Without them, it would be impossible to browse the Web. +Users typically select the link based on the text it is labeled with. +To give machines a similar understanding, links can be annotated +with a link relation type—a registered token or a URI identifying +the semantics of the link. The following example shows how such +a typed link is used in HTML to reference a stylesheet. + +
+ + <link href="http://www.example.com/styles.css" + rel="stylesheet" /> + +
+ +In Linked Data, the link relation type corresponds to the property itself. +An example in JSON-LD would thus look as follows. + +
+
+{
+    "urn:iana:link-relations:stylesheet": {
+        "@id": "http://www.example.com/styles.css"
+    }
+}
+
+
+ +Generally, a client decides whether to follow a link or not based on +the link relation (or property in the case of Linked Data) which +defines its semantics. There are however also clients such as Web crawlers +which simply follow every link intended to be dereferenced. In HTML this +usually means that all links in anchor elements +(the <a> tag) are followed, but most references in link +elements (the <link> tag), such as used in the example +above, are ignored. Since in RDF serializations no such distinction exists, +the best a client can do is to blindly try to dereference all URIs. +It would thus be beneficial to describe in a machine-readable manner +if a property represents a link intended to be dereferenced or +solely an identifier. Hydra's [=Link=] class does just that. It can be +used to define properties that represent dereferencable links. +In the exemplary Web API used throughout this section, it can be +used to define a property linking issues to their comments: + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/vocab#comments",
+    "@type": "Link"
+}
+
+
+ +In the example above, a property identified with the URL +`http://api.example.com/vocab#comments` is defined to be +of the type [=Link=]. This is enough information for a client understanding +Hydra to know that the value of the `comments` property +in the following example is intended to be dereferenced. + +Note: It is recommended to dereference resources that are within an API's domain. +This may prevent possible issues with cross-site scripting or obtaining +resources which might have no meaning to the client or such that the client +would be unable to interpret. Still, there is no formal prohibition of +dereferencing resources linked with well-known properties, e.g. +*rdf:seeAlso*. + +
+
+{
+    "@context": {
+        "comments": "http://api.example.com/vocab#comments"
+    },
+    "@id": "http://api.example.com/an-issue",
+    "title": "An exemplary issue linking to its comments",
+    "comments": { "@id": "http://api.example.com/an-issue/comments" }
+}
+
+
+ +In the example above, the value of the `comments` property +is a JSON object with an `@id` member. This is JSON-LD's +convention to distinguish between strings and IRIs. By using JSON-LD's +type-coercion feature, the representation can be made even more idiomatic: + +
+
+{
+    "@context": {
+        "comments": {
+            "@id": "http://api.example.com/vocab#comments",
+            "@type": "@id"
+        }
+    },
+    "@id": "http://api.example.com/an-issue",
+    "title": "An exemplary issue linking to its comments",
+    "comments":
+        "http://api.example.com/an-issue/comments"
+}
+
+
+ +While links are enough to build read-only Web APIs, more powerful +affordances are required to build read-write Web APIs. Thus, Hydra +introduces the notion of operations. Simply speaking, an +[=Operation=] represents the information necessary for a client +to construct valid HTTP requests in order to manipulate the server's +resource state. As such, the only required property of an +[=Operation=] is its [=method=]. Optionally, it is also possible +to describe what information the server [=expects=] or [=returns=], +including additional information about response status codes that +might be returned. This helps a developer to understand what to expect +when invoking an operation. This information has, however, +not to be considered as being complete; it is merely a hint. +Developers should, e.g., expect that other status codes might be returned +and program their clients accordingly. + +The following example illustrates how representations can be +augmented with information that enables clients to interact with +them. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "/an-issue",
+    "title": "An exemplary issue representation",
+    "description": "This issue can be deleted with an HTTP DELETE request.",
+    "operation": [
+        {
+            "@type": "Operation",
+            "method": "DELETE"
+        }
+    ]
+}
+
+
+ +The example above references Hydra's context to map properties such +as [=operation=] and [=method=] and values like [=Operation=] to URLs +that unambiguously identify these concepts. It would be similarly valid +JSON-LD if these mappings would be directly embedded into the representation +or if the full URLs would be used instead. Typically, however, the context +is the same for a lot of representations in a Web API and it thus makes +sense to reduce the response size by leveraging a remote context that +can easily be cached by a client. + +Note: It is worth mentioning that due to the fact that Hydra is built on +RDF, which is a graph, it may happen that a related resource +(an object of the relation) may not be fully described in the +resource's payload. + +In several circumstances (i.e. payload terms defined in +[=ApiDocumentation|API documentation=] sa described in +[[#documenting-a-web-api]] or [=IriTemplate=] +expected as a related resource as described in +[[#templated-links|Templated Links]]) client may +discover no additional statements describing it. These rules should +be considered by the client in following scenarios: + +- in case of an object expected to be a hypermedia resource does not have + all the necessary statements for which it is a subject, the client + SHOULD look in the [=ApiDocumentation|API documentation=] for more details +- in case the mentioned object, after consulting + an [=ApiDocumentation|API documentation=], still does not have + all the necessary statements for which it is a subject and both + mentioned object's Url and Url of the initially obtained resource + has the same scheme and authority (by means of [[!RFC3986]] + sections 3.1 and 3.2), the client SHOULD dereference that URL. + If the resource does not have the same scheme and authority the client + MAY chose to dereference it (for example if the resource originates + from another API well-known to the client) +- in case the mentioned object still does not have all the necessary + statements for which it is a subject (i.e. dereferencing it failed + or statements are missing), the client SHOULD either ignore the whole + statement (i.e. for display purposes) or throw an exception + (i.e. an [=IriTemplate=] is about to be resolved and dereferenced) + +Example of each of the situations are as follows: + +
+ +HTTP/1.1 200 OK +Content-Type: application/ld+json +Link: <http://api.example.com/doc/>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation" + +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@graph": [{ + "@id": "http://api.example.com/attachments", + "@type": "hydra:Collection", + "api:attachmentByIssue": "api:AttachmentByIssueTemplate" + }, { + "@id": "http://api.example.com/issues", + "@type": "hydra:Collection", + "api:issueByName": "api:IssueByNameTemplate" + } +} + +
+HTTP/1.1 200 OK
+Content-Type: application/ld+json
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@graph": [{
+        "@id": "api:AttachmentByIssueTemplate",
+        "@type": "hydra:IriTemplate",
+        "template": "http://api.example.com/attachments/{issue}",
+        ...
+    }]
+}
+
+
+ +where: + +- resource `http://api.example.com/attachments` should have + an [=IriTemplate=] available as there is a complete definition + of the template available at `http://api.example.com/doc/` +- resource `http://api.example.com/issues` should not have + an IRI template exposed as there are no additional details available, + neither in the initial resources' payload nor in the API documentation + +Note: Keep in mind that any resource described by any hypermedia control +may fail at runtime due to various reasons. Operation details +such as [=returns=] or [=possibleStatus=] may also vary at runtime, +which means client SHOULD always verify received payloads at runtime. + +## Documenting a Web API ## {#documenting-a-web-api} + +In Web APIs, most representations are typically very similar. +Furthermore, resources often support the same operations. It thus +makes sense, to collect this information in a central documentation. +Traditionally, this has been done in natural language which forces +developers to hardcode that knowledge into their clients. Hydra +addresses this issue by making the documentation completely +machine-processable. The fact that all definitions can be identified +by URLs enables reuse at unprecedented granularity. + +Hydra's [=ApiDocumentation=] class builds the foundation for +the description of a Web API. As shown in the following example, +Hydra describes an API by giving it a title, a short description, and +documenting its main entry point. Furthermore, the classes known to +be supported by the Web API and additional information about status +codes that might be returned can be documented. This information +may be used to automatically generate documentations in natural +language. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/doc/",
+    "@type": "ApiDocumentation",
+    "title": "The name of the API",
+    "description": "A short description of the API",
+    "entrypoint": "URL of the API's main entry point",
+    "supportedClass": [
+        // "... Classes known to be supported by the Web API ..."
+    ],
+    "possibleStatus": [
+        // "... Statuses that should be expected and handled properly ..."
+    ]
+}
+
+
+ +In Linked Data, properties are, just as everything else, identified +by IRIs and thus have global scope which implies that they have +independent semantics. In contrast, properties in data models as +used in common programming languages are class-dependent. Their +semantics depend on the class they belong to. In data models classes +are typically described by the properties they expose whereas in +Linked Data properties define to which classes they belong. If no +class is specified, it is assumed that a property may apply to every +class. + +These differences have interesting consequences. For example, the +commonly asked question of which properties can be applied to an +instance of a specific class can typically not be answered for +Linked Data. Strictly speaking, any property which is not explicitly +forbidden could be applied. This stems from the fact that Linked Data +works under an open-world assumption whereas data models used by +programmers typically work under a closed-world assumption. The +difference is that when a closed world is assumed, everything that +is not known to be true is false or vice-versa. With an open-world +assumption the failure to derive a fact does not automatically imply +the opposite; it embraces the fact that the knowledge is incomplete. + +Since Hydra may use classes to describe the information expected or +returned by an operation, it also defines a concept to describe the +properties known to be supported by a class. The following example +illustrates this feature. Instead of referencing properties directly, +[=supportedProperty=] references an intermediate data structure, +namely instances of the [=SupportedProperty=] class. This makes +it possible to define whether a specific property is required or +whether it is read-only or write-only depending on the class it is +associated with. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/doc/#Comment",
+    "@type": "Class",
+    "title": "The name of the class",
+    "description": "A short description of the class.",
+    "supportedProperty": [
+        // "... Properties known to be supported by the class ..."
+        {
+            "@type": "SupportedProperty",
+            "property": "#property", // "The property"
+            "required": true, // "Is the property required in a request to be valid?"
+            "readable": false, // "Can the client retrieve the property's value?"
+            "writable": true // "Can the client change the property's value?"
+        }
+    ]
+}
+
+
+ +All instances of a specific class typically support the same operations. +Hydra therefore features a [=supportedOperation=] property which defines +the operations supported by all instances of a class. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/doc/#Comment",
+    "@type": "Class",
+    "title": "The name of the class",
+    "description": "A short description of the class.",
+    "supportedProperty": [
+        // "... Properties known to be supported by the class ..."
+    ],
+    "supportedOperation": [
+        // "... Operations known to be supported by instances of the class ..."
+    ]
+}
+
+
+ +The same feature can be used to describe the operations supported +by values of a [=Link=] property. This is often helpful when +certain operations depend on the permissions of the current user. It +makes it, e.g., possible to show a "delete" link only if the current +user has the permission to delete the resource. Otherwise, the link +would simply be hidden in the representation. + +Example shown below describes the operation's expected and returned +value as a dereferencable resource (an RDF resource of a given class), +but the vocabulary is not limited to only those originating +from RDF and is enabled to other types of resources. +Please note that in case of multiple either returned or expected types +provided, client SHOULD assume the set includes any of the types, +but not limited to those types and client SHOULD interpret a received +payload at runtime for possible discrepancies. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/doc/#comments",
+    "@type": "Link",
+    "title": "Comments",
+    "description": "A link to comments with an operation to create a new comment.",
+    "supportedOperation": [
+        {
+            "@type": "Operation",
+            "title": "Creates a new comment",
+            "method": "POST",
+            "expects": "http://api.example.com/doc/#Comment",
+            "returns": "http://api.example.com/doc/#Comment",
+            "possibleStatus": [
+                // "... Statuses that should be expected and handled properly ..."
+            ]
+        }
+    ]
+}
+
+
+ +Note: It is worth to mention that Hydra comes with a notion +of a dereferenceability promise, which means that resources marked +with a [=Resource=] class can be safely dereferenced by a client. +Unfortunately, the way how the Word Wide Web works it is impossible to +guarantee that the resource finally will be obtained. + +In addition to [=expects|expected=]/[=returns|returned=] resources, +it is also possible to express similar features for headers with +[=returnsHeader=] and [=expectsHeader=] predicates which provides +a simple set of header names. Client SHOULD apply respective header +semantics when creating or receiving a request natural for the protocol in use. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/doc/#comments",
+    "@type": "Link",
+    "supportedOperation": [
+        {
+            "@type": "Operation",
+            "method": "POST",
+            "expects": "http://api.example.com/doc/#Comment",
+            "returns": "http://api.example.com/doc/#Comment",
+            "returnsHeader": [
+                "Content-Type",
+                "Content-Length"],
+            "expectsHeader": [
+                "Authorization"
+            ]
+        }
+    ]
+}
+
+
+ +The example above enable an HTTP client to prepare a proper cross-site +pre-flight request, so the server exposes enlisted headers for the client. +The client is also aware of the user authentication requirement necessary +for the operation invocation. + +For more complex scenarios it is also possible to expand selected header +specification with both name and possible values, i.e. when defining +expected *Content-Type* values of resources that can be uploaded. +In case multiple possible values are provided, client SHOULD assume +that the set includes any of the values, but not limited to those values. +In order to change that default behavior it is possible to use [=closedSet=] +predicate on the header specification indicating that the set of provided +values is, well, closed and no other values are available. In both cases +the client SHOULD interpret a received payload at runtime for possible +discrepancies. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/doc/#comments",
+    "@type": "Link",
+    "supportedOperation": [
+        {
+            "@type": "Operation",
+            "method": "POST",
+            "expects": "http://api.example.com/doc/#Upload",
+            "returns": "http://api.example.com/doc/#Comment",
+            "returnsHeader": [
+                {
+                    "headerName": "Content-Type",
+                    "possibleValue": ["text/turtle", "application/ld+json"]
+                }
+                "Content-Length"
+            ],
+            "expectsHeader": [
+                "Authorization",
+                {
+                    "headerName": "Content-Type",
+                    "possibleValue": ["image/gif", "image/png"]
+                }
+            ]
+        }
+    ]
+}
+
+
+ +To wrap up everything altogether, it is also possible to attach atomic +operations supported by, well, supported property itself. This might +come in handy for scenarios, when resource can be partially modified. +It can be achieved with two approaches, both having advantages and +disadvantages. + +First approach would involve adding a [=supportedOperation=] to the +intermediate structure of [=SupportedProperty=]. +This way prevents from leaking API specific features from the API itself +to i.e. externally defined properties. Data aggregators won't assume that +each instance with a given property could have such an operation. + +Another approach would require the API to elevate a specific property +to [=Link=], which can accept a [=supportedOperation=]. This +is more intuitive in APIs operating with internally used vocabularies +where assumption that every instance with that very specific property +has the operation attached available. + +Direct usage of [=supportedOperation=] on *rdf:Property* +without elevating it to the [=Link=] SHOULD NOT be implemented as clients +may not discover such a construct correctly. + +There are rare situations when some supported operations once announced in the +API documentation should be retracted, i.e. to reflect current state of the +application or current user capabilities (or lack of them). It is doable +with the [=retractedOperation=] predicate that can be added to the reasorce +the same way as the [=operation=] is. By default all operations are available +without limits and it is up for the server to change that, and for the client +to discover any discrepancies compared against the API documentation in the runtime. +Yet server may want to inform the client that at the very moment an operation is either +[=Unavailable=] or [=Unauthorized=] with a [=reason=] predicate. +The latter MAY be used to notify client that the user used to invoke +the request that provides operation availability information is currently +not authorized for that very operation to be invoked. The former on the other hand +MAY be used to inform that the operation is currently forbidden and client +SHOULD NOT invoke it. Server MAY also provide more custom reasons for which +the operation is not available but it SHOULD provide at least one of the +_Hydra_ built in reasons. + +The [=retractedOperation=] MUST NOT be used in context of the [=ApiDocumentation=]. +The [=retractedOperation=] predicate also MUST take precedence over both +[=operation=] and [=supportedOperation=] declaration and overrides them. +The operation that comes with [=retractedOperation=] predicate SHOULD be identified +using any of the below enlisted methods: +- Iri by using [=object=] predicate +- exact match of a resource described by [=possibleStatus=], [=method=], [=expects=], [=returns=] or combination of those + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/doc/#comments",
+    "@type": "Link",
+    "supportedOperation": [
+        {
+            "@type": "Operation",
+            "method": "POST",
+            "expects": "http://api.example.com/doc/#Upload"
+        },
+        {
+            "@type": "Operation",
+            "method": "POST",
+            "expects": "http://api.example.com/doc/#Comment"
+        }
+    ]
+}
+
+
+
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/doc/",
+    "@type": "Collection",
+    "retractedOperation": [
+        {
+            "@type": "Operation",
+            "method": "POST",
+            "expects": "http://api.example.com/doc/#Upload",
+            "reason": "Unavailable"
+        }
+    ]
+}
+
+
+ +In the example above the operation that expects an uploaded file became +[=Unavailable=], while the one expecting a comment remains available as +the [=expects=] predicate does not match any supported operations. +It is still recommended to mark operations being subject for further +restrictions with an Iri as from the client perspective this may be +easier to implement simple literal Iri comparison rather than to compare +graphs of objects. + +Note: These are the simple example scenarios and possible usages are not +limited to those described above. + +Due to the fact an [=ApiDocumentation=] as all other resources may fail +at runtime, it is important to take countermeasures. A simple strategy +to try to recover from such a situation would be to reload +the [=ApiDocumentation=] and redo all pre-computations that were +based on the [=ApiDocumentation=] (or at least those that lead +to the current failure). Another, simpler approach would require +an application to show an error message with option to return +to a previous or home screen. + +Hydra also allows enriching both [=ApiDocumentation=] and +hypermedia controls with human-readable descriptions by applying +[=title=] and [=description=] (as shown in the examples above). +The former states a name of such a decorated element that could +be displayed as a label. The latter provides its description +to be presented i.e. as a hint. + +Aforementioned [=title=] and [=description=] SHOULD take precedence +over standard *rdfs:label* and *rdfs:comment*. + +There is one more feature related to how Linked Data works. Consider the +example below written in turtle syntax: + +
+ +# An example API documentation itself with all the standard bits +@base <http://some.app/> . +@prefix api: <http://some.api/> . +@prefix ex: <http://ontology.example/> . +@prefix hydra: <http://www.w3.org/ns/hydra/core> . +@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . +<api> + a hydra:ApiDocumentation ; + hydra:supportedClass api:ClassOne, api:ClassTwo . + +# Anything else +ex:SomeType a rdfs:Class . + +
+ +...and how it could be transformed with JSON-LD framing process: + +
+
+{
+    "@context": { ... },
+    "@graph": [
+        {
+            "@id": "http://some.app/api",
+            "@type": "hydra:ApiDocumentation",
+            "hydra:supportedClass": [
+                {
+                    "@id": "api:ClassTwo"
+                },
+                {
+                    "@id": "api:ClassOne"
+                }
+            ]
+        }
+    ]
+}
+
+
+ +As you can see, additional details about *ex:SomeType* went +missing, while this shouldn't happen. The fact that the IRI mentioned +is an *rdfs:Class* may be meaningful for a correct interpretation +of the received payload and this is a sole reason of why a Client +SHOULD NOT disregard other parts of the payload that are not directly +related to the API documentation or other hypermedia controls. + +## Discovering a Hydra-powered Web API ## {#discovering} + +The first step when trying to access a Web API is to find an entry +point. Typically, this is done by looking for a documentation on the +API publisher's homepage. Hydra enables the API's main entry point +to be discovered automatically if the API publisher marks his +responses with a special HTTP Link Header as defined in [[!RFC8288]]. +A Hydra client would look for a Link Header with a relation type +`http://www.w3.org/ns/hydra/core#apiDocumentation` (this is +the IRI identifying the [=apiDocumentation=] property). + +In the following example, a Hydra client simply accesses the +homepage of an API publisher (`http://www.example.com/`) +to find the entry point of its API. A client may use an HTTP GET or +HEAD request. The difference between the two is that the former may +return a message-body in the response whereas the latter will not; +otherwise they are identical. + +
+
+HEAD / HTTP/1.1
+Host: www.example.com
+
+ +HTTP/1.1 200 OK +... +Content-Type: text/html; charset=utf-8 +Link: <http://api.example.com/doc/>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation" + +
+ +The response in the example above contains an HTTP Link Header +pointing to `http://api.example.com/doc/`. Retrieving that resource, +the client would obtain a [=ApiDocumentation|Hydra API documentation=] +defining the API's main entry point: + +
+
+GET /doc/ HTTP/1.1
+Host: api.example.com
+Accept: application/ld+json
+
+
+HTTP/1.1 200 OK
+...
+Content-Type: application/ld+json
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/doc/",
+    "title": "The example.com API",
+    "entrypoint": "http://api.example.com/",
+    ...
+}
+
+
+ +Note: Please note that in some cases the entry point will already be +known to the client. Thus, the discovery of the API documentation +using HTTP Link Headers may not be necessary as the concepts +used in responses from the API will dereference to their documentation. + +In another scenario the [=ApiDocumentation=] would be discovered from +a bookmarked resource's representation. +The [=ApiDocumentation|API implementation=] SHOULD emit the HTTP [=Link=] +header on every API response, making the [=ApiDocumentation=] (and entry +points it defined) discoverable all the time. + +
+
+GET /api/items HTTP/1.1
+Host: api.example.com
+Accept: application/ld+json
+
+ +HTTP/1.1 200 OK +... +Content-Type: application/ld+json +Link: <http://api.example.com/doc/>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation" + +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/items", + "title": "Items collection", + ... +} + +
+ +## Api versions ## {#api-versions} + +It is common to provide a separate API address after a breaking changes +update. This prevents current clients not to get broken as these may not +support these changes. + +With hypermedia provided in each response payload, it may be unnecessary +to provide such an alternative API. This is due to fact the client follows +what the server provides and with proper margin for errors implemented +within that client, even breaking changes can be published on the fly. + +Still, Hydra does neither have any special support for API versions, nor +prevents them. It's fully an implementers decision on if and how +to provide the API features. + +Advanced Concepts {#advanced-concepts} +================= + +## Collections ## {#collections} + +In many situations, it makes sense to expose resources that reference +a set of somehow related resources. Results of a search query or +entries of an address book are just two examples. To simplify such +use cases, Hydra defines the two classes [=Collection=] and +[=PartialCollectionView=]. + +A [=Collection=] can be used to reference a set of resources +as follows: + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/an-issue/comments",
+    "@type": "Collection",
+    "totalItems": 4980,
+    "member" : [
+        {
+            "@id": "/comments/429"
+        },
+        {
+            "@id": "/comments/781",
+            "title": "Properties may be embedded directly in the collection"
+        },
+        ...
+    ]
+}
+
+
+ +As shown in the example above, member items can either consist of +solely a link or also include some properties. In some cases embedding +member properties directly in the collection is beneficial as it may +reduce the number of HTTP requests necessary to get enough information +to process the result. + +Since collections may become very large, Web APIs often chose to +split a collection into multiple pages. In Hydra, that can be achieved +with a [=PartialCollectionView=]. It describes a specific +view on the collection which represents only a subset of the collection's +members. A [=PartialCollectionView=] may contain links to the +[=first=], [=next=], [=previous=], and [=last=] +[=PartialCollectionView=] which allows a client to find all members +of a [=Collection=]. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/an-issue/comments",
+    "@type": "Collection",
+    "totalItems": 4980,
+    "member": [
+        // "... a subset of the members of the Collection ..."
+    ],
+    "view": {
+        "@id": "http://api.example.com/an-issue/comments?page=3",
+        "@type": "PartialCollectionView",
+        "first": "/an-issue/comments?page=1",
+        "previous": "/an-issue/comments?page=2",
+        "next": "/an-issue/comments?page=4",
+        "last": "/an-issue/comments?page=498"
+    }
+}
+
+
+ +Note: It is worth to mention that all those links are optional, +and it is up to server whether to provide these links or not. + +## Member assertions ## {#member-assertions} + +A [=memberAssertion=] (formerly `manages`) is a way to declare additional, +implicit statements about members of a [[#collections|collection]]. +Statements which may otherwise be missing from the respective member +resources inlined in a collection's representation. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/an-issue/comments",
+    "@type": "Collection",
+    "memberAssertion": {
+        "subject": "http://api.example.com/an-issue",
+        "property": "http://api.example.com/vocab#comment"
+    },
+    "member": [
+        {
+            "@id": "/comments/429"
+        }
+    ]
+}
+
+
+ +In the above example, adding a `memberAssertion` node to the collection +instructs the client that every member of this collection is linked +to the `subject` by the `property`. It could be written as a SPARQL +triple pattern below, where `?m` would be substituted by each member +of the collection. + + + <http://api.example.com/an-issue> <http://api.example.com/vocab#comment> ?m + + +A [=memberAssertion=] MUST use two and only two of the [=subject=], +[=property=] and [=object=] predicates. The [=memberAssertion=] predicate +MAY have more than one such blocks, each expressing different relations +between the collection members and other resources. + +Note: It's important to point out that the [=subject=], [=property=] +and [=object=] predicates are defined within the Hydra namespace +and are not [[!RDF-Schema|rdfs]] terms. + +It is also possible to use [=memberAssertion=] predicate on the +API documentation level, by attaching this predicate to subclasses +of the [=Collection=], like in the example below. Clients would +understand that all members of collections which are instances +of `api:UserCollections` would in fact have `rdf:type api:User`. + +
+
+{
+    "@context": [
+        "http://www.w3.org/ns/hydra/context.jsonld",
+        { "api": "http://api.example.com/api/documentation#" }
+    ],
+    "@id": "http://api.example.com/api/documentation",
+    "@type": "ApiDocumentation",
+    "supportedClass": ["api:User", "api:UserCollection"],
+    "api:UserCollection": {
+        "subClassOf": "Collection",
+        "memberAssertion": {
+            "property": "rdf:type",
+            "object": "api:User"
+        },
+    }
+}
+
+
+ +It is worth to mention that a strongly typed collection instance can have +its own member assertions. In such a scenario, both +[=ApiDocumentation|API documentation=] level and instance +level assertions should be combined as neither makes the other obsolete. + +More complex scenario would involve a class hierarchy, in which each class +can carry additional member assertions compared to it's base class. +To discover all available member assertion blocks client SHOULD traverse +whole class hierarchy to gather all the member assertions. In order +to take such a burden from clients it is strongly recommended providing +all member assertion blocks to be provided on each class level including +its base class blocks, so the client does not have to perform +this traversing behavior. + +## Templated Links ## {#templated-links} + +Sometimes, it is impossible for a server to construct a URL because +the URL depends on information only known by the client. A typical +use case are URLs which enable a client to query the server. In such +a case, the server cannot construct the URL because it does not know +the query the client is interested in. What the server can do however, +is to give the client a template to construct such a URL at runtime. +In Hydra, the [=IriTemplate=] class is used to do so. + +An [=IriTemplate=] consists of a [=template=] literal and a set +of [=mappings=]. Each [=IriTemplateMapping=] maps a +[=variable=] used in the template to a [=property=] and may +optionally specify whether that variable is [=required=] or not. +The syntax of the template literal is specified by its datatype and +defaults to the [[!RFC6570]] URI Template syntax, which can be +explicitly indicated by [=Rfc6570Template=]. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@type": "IriTemplate",
+    "template": "http://api.example.com/issues{?q}",
+    "variableRepresentation": "hydra:BasicRepresentation",
+    "mapping": [
+        {
+            "@type": "IriTemplateMapping",
+            "variable": "q",
+            "property": "hydra:freetextQuery",
+            "required": true
+        }
+    ]
+}
+
+
+ +The example above maps the variable `q` to Hydra's [=freetextQuery=] +property and marks it as required. As its name suggests, +the [=freetextQuery=] property can be used for free text queries. + +A template syntax only details how to fill out simple string values, +but not how to derive such string values from typed values, +language-tagged strings, or IRIs. Hydra addresses this by +specifying how such values are to be serialized as strings. The +serialization of an [=IriTemplate's=] variables can be described +by setting the [=variableRepresentation=] property to +[=BasicRepresentation=] or [=ExplicitRepresentation=]. The +[=BasicRepresentation=] represents values by their lexical form. It +omits type and language information and does not differentiate between +IRIs and literals. The [=ExplicitRepresentation=], on the other +hand, includes type and language information and differentiates +between IRIs and literals by serializing values as follows: + +- IRIs are represented as-is +- literals, i.e., (typed) values and language-tagged strings are + represented by their lexical form, surrounded by a single pair of + doubles quotes (`"`) +- if a literal has a language, a single `@` symbol is + appended after the double-quoted lexical form, followed by a + non-empty [[!BCP47]] language code +- if a literal has a type, two *caret* symbols (`^^`) are appended + after the double-quoted literal, followed by the full datatype IRI + +In both representations characters MUST NOT be escaped. In case the +representation format is not explicitly described, clients SHOULD +use the [=BasicRepresentation=] by default. + +

+Warning: Although [=ExplicitRepresentation=] +use of `@` and `^^` is similar, it is *not* the same as the +[[!Turtle]] representation for literals. Turtle literals require escaping +of special characters, surround datatype IRIs with angular brackets +(< and >), and also allow single quotes (`'`) to indicate literals. +The [=ExplicitRepresentation=] values must not be escaped, +IRIs must not be surrounded by any character, and only double quotes +can indicate literals. +

+ +Below are some example values serialized in the different +representations as well as the result of expanding the IRI template +`http://example.com/find/{value}` with the respective value. + + + +The example Description of an IRI Template that was already mentioned +uses a [=variableRepresentation=] on the whole [=IriTemplate=], but +each mapped variable represented as an [=IriTemplateMapping=] can have +its own [=variableRepresentation=] declaration. It MUST override +the declaration from the [=IriTemplate=] level for that very +[=IriTemplateMapping=] as it takes precedence. The example below +depicts such a situation: + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@type": "IriTemplate",
+    "template": "http://api.example.com/issues{?q,category}",
+    "variableRepresentation": "ExplicitRepresentation",
+    "mapping": [
+        {
+            "@type": "IriTemplateMapping",
+            "variable": "q",
+            "property": "hydra:freetextQuery",
+            "variableRepresentation": "BasicRepresentation",
+            "required": true
+        },
+        {
+            "@type": "IriTemplateMapping",
+            "variable": "category",
+            "property": "schema:category"
+        }
+    ]
+}
+
+
+ +In this example, the variable category will be serialised using the explicit representation, +derived from the template itself. The variable q on the other hand will override that +to use basic representation. + +Similar to how Hydra's [=Link=] class allows the definition of +properties that represent hyperlinks as described in +[[#adding-affordances-to-representations]], the [=TemplatedLink=] class +allows the definition of properties whose value are IRI templates. +Hydra predefines one such property, namely the [=search=] property which +can be used to document available search interfaces. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "hydra:search",
+    "@type": "hydra:TemplatedLink"
+}
+
+
+ +IRI expansion should be performed with respect to the specification +behind the IRI template type ([[!RFC6570]] by default), and the product +of this process SHOULD be an IRI. When the produced IRI is relative, +the client SHOULD stick to [[!RFC3986]] sections 5.1.3 and 5.1.4 +to be compatible with most RDF serializations that support relative IRIs. +Still, it may be preferred to use another base URI for the expansion +process, which makes the [=resolveRelativeUsing=] term useful. It allows +to switch the IRI template expansion algorithm, so the base URI +is established using current link context, which is a subject +of the relation pointing to an [=IriTemplate=] instance. In case +that subject is a relative URI, default behavior SHOULD be used as fallback. + +The example below allows to make the product of an IRI template +expansion relative to the `http://api.example.com/an-issue/` resource +by using it as its base URI, which further enables the `some:operation` +to be moved to i.e. [=ApiDocumentation|API documentation=] level rather +to inline it. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/an-issue/",
+    "@type": "Collection",
+    "some:operation": {
+        "@type": "IriTemplate",
+        "template": "{id}",
+        "resolveRelativeUsing": "LinkContext",
+        "variable": "id",
+        "mapping": {...}
+    }
+}
+
+
+ +When constructed, the IRI would effectively become similar +to `http://api.example.com/an-issue/1234`, with the relative part +`{id}` appended to the link context URL. + +## IRI template operations ## {#iri-template-operations} + +There are circumstances in which client would like to perform an operation +not knowing the final IRI of the resource to be called. This case +is especially in force when working with collections - client may want +to add a new collection member, or it may need to provide more details +while searching with other protocol's method (i.e. POST instead of GET +in case of an HTTP). + +This is achievable by attaching a [=supportedOperation=] to the property +that connects a subject of that relation with its [=IriTemplate=] +as described in the previous part of this document. Please note that +client is still allowed to use the defined link and custom operation's +method is optional. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/api-documentation",
+    "@type": "ApiDocumentation",
+    "api:search": {
+        "@type": "Link",
+        "rdfs:subClassOf": "search",
+        "supportedOperation": {
+            "@type": "SupportedOperation",
+            "method": "POST"
+        }
+    }
+}
+
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/issues",
+    "@type": "Collection",
+    "api:search": {
+        "@type": "IriTemplate",
+        "template": "/issues?search={name}",
+        "mapping": { ... }
+    }
+}
+
+
+ +The example above allows client to either invoke an HTTP GET or POST +call on `http://api.example.com/issues?search=search_string` resource. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/api-documentation",
+    "@type": "ApiDocumentation",
+    "api:find": {
+        "supportedOperation": {
+            "@type": "SupportedOperation",
+            "method": "POST"
+        }
+    }
+}
+
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/issues",
+    "@type": "Collection",
+    "api:search": {
+        "@type": "IriTemplate",
+        "template": "/issues?find={name}",
+        "mapping": {...}
+    }
+}
+
+
+ +The example above allows client to invoke only an HTTP POST +call on `http://api.example.com/issues?find=search_string` resource as +the described relation of `find` is not a [=Link=]. + +## Supported property data source ## {#supported-property-data-source} + +There are circumstances in which an API would like to inform a client on +when to obtain values to feed data structures with details. Having all the +necessary components like supported property, collection and IRI templates, +it is possible to drive the client and direct it with links and operations +to the data sources. + +It is doable by attaching either a [=collection=] or [=search=] +predicate to instance of [=supportedProperty=] or to [=property=]. +In such case client SHOULD assume that the relation leads to +the collection of values compatible with the supported property's range +and can be used to feed data structures with the supported property. +It is recommended (but not mandatory) to use [=freetextQuery=] +variable mapping in case of the [=search=] predicate as it has a +well-defined semantics and takes the burden of interpretation from +the client. + +While it is possible to provide such links in both +[=ApiDocumentation|API documentation=] and within the received payload, +client SHOULD use the latter link first if applicable. +This is due to the fact the server may want to put additional +context to narrow the collection of viable values. Redefinition does not +make the more general one obsolete though and can be used as a fallback. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@type": "ApiDocumentation",
+    "supportedClass": {
+        "@id": "schema:Event",
+        "supportedProperty": {
+            "property": "schema:actor",
+            "search": {
+                "template": "/api/user{?search}",
+                "mapping": {
+                    "variable": "search",
+                    "property": "freetextQuery"
+                }
+            }
+        }
+    },
+    ...
+}
+
+
+ +The example above instructs a client that every resource of type +`schema:Event` can have a relation of `schema:actor`, the objects +of which the client can obtain using the search link provided. + +## Description of HTTP Status Codes and Errors ## {#description-of-errors} + +In case of the HTTP protocol, status codes have well-defined semantics +and can be used to signal the outcome of an operation. Unfortunately, +however, HTTP status codes by themselves are often not specific enough, +making it difficult to understand the real cause of an error. For instance, +a `429 Too Many Requests` response is rarely informative enough by itself. +To address this issue, Hydra defines a [=Status=] class which allows +additional information to be associated with the HTTP status code. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@type": "Status",
+    "statusCode": 429,
+    "title": "Too Many Requests",
+    "description": "A maximum of 500 requests per hour and user is allowed.",
+    ...
+}
+
+
+ +An [=ApiDocumentation=] or an [=Operation=] may document the +status codes that might be returned by the server using the +[=possibleStatus=] property as described in [[#documenting-a-web-api]]. +This allows a developer to understand what to expect when invoking +an operation. It has, however, not to be considered as an extensive +list of all potentially returned status codes; it is merely a hint. +Developers should expect to encounter other HTTP status codes as well. + +A server may also return a [=Status=] directly in a response. +When doing so, it often makes sense to subclass the [=Status=] +to make its semantics more explicit. Hydra defines just one such subclass, +namely the [=Error=] class. This provides an extensible framework +to communicate error details to a client. + +Furthermore, a [=Status=] or [=Error=] returned by the server can also +be given an identifier. When dereferenced, the [=Error=] resource +can provide more detailed information or possible ways to resolve +the problem, if applicable. + +Finally, the server SHOULD provide error descriptions using an [[!RFC9457]] +standard by using an `application/problem+json` response. When doing so, +the server also MUST provide an additional header pointing to either +the built-in Hydra `http://www.w3.org/ns/hydra/error` context +or any JSON-LD context that maps the terms `type`, `title`, `detail`, +`status` and `instance` the same way as the standard one. + +
+ +HTTP/1.1 400 Bad Request +Content-Type: application/problem+json +Link: <http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#context" + +{ + "type": "https://example.com/probs/out-of-credit", + "@type": "http://www.w3.org/ns/hydra/core#Error", + "title": "You do not have enough credit.", + "detail": "Your current balance is 30, but that costs 50.", + "instance": "/account/12345/msgs/abc", + "balance": 30, + "accounts": [ + "/account/12345", + "/account/67890" + ] +} + +
+ +While the built-in context makes the response fully compatible with +the mentioned specification, properties not defined in the standard +Hydra's error context won't be visible for Hydra aware processors. +To overcome this, it is possible to declare a custom context pointed +the same way, that would combine standard Hydra's standard error context +and an additional JSON-LD context with either the `@vocab` or custom +property mappings telling the processor on how to interpret those custom +error properties. + +Resources provided may have an additional hint pointing to an [=Error=] +type like in the example above, but it is not mandatory to do so as all +resources described with `application/problem+json` are considered +[=Error=]. + +Note: It is worth to mention that it may happen (i.e. due to proxy behavior) +the value of the [=status=] property will differ to the one received +from the protocol layer. + +
+
+HTTP/1.1 400 Bad Request
+Content-Type: application/ld+json
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@type": "Error",
+    "@id": "http://api.example.com/error-details/1234",
+    "title": "An error occurred",
+    "description": "Typically, a specialization of this class is used in practice.",
+    ...
+}
+
+
+ +## Client initiated pagination ## {#pagination} + +There are situations when a client would like to provide a specific +collection limitations, i.e. by providing query-language like member +offset and limit, or some specific page index and number of members +per page. This is doable with [=offset=]/[=limit=] +or [=pageIndex=]/[=limit=] predicates. + +With those, it is possible to bind a template variables mapped +with externally obtained values (i.e. user interaction) the same way +as with other mappings. + +While the predicates enlisted above accepts non-negative integer +numbers, there is also a possibility of providing a custom page +reference expressed via [=pageReference=] predicate. It is possible +to provide a custom page identifier (i.e. a GUID or a letter) +instead of a number. + +## Extensions ## {#extensions} + +While Hydra Core Vocabulary allows addressing many usage scenarios, +not every aspect of API behavior can be covered. This +applies especially to querying, resource projection or data structure +description. This is due to fact that Hydra is meant to be as light +as possible forcing to drop some features out of its scope. + +That is why there is a possibility of hinting a client on what kind +of extensions may be found or used in the received payloads. +After discovering an [=extension=] predicate in the +[=ApiDocumentation|API documentation=], client can assume additional +details are available described with complementary vocabularies. + +
+
+{
+    "@context": "http://www.w3.org/ns/hydra/context.jsonld",
+    "@id": "http://api.example.com/doc/",
+    "@type": "ApiDocumentation",
+    "title": "The name of the API",
+    "description": "A short description of the API",
+    "entrypoint": "URL of the API's main entry point",
+    "extension": "http://www.w3.org/ns/shacl#",
+    ...
+}
+
+
+ +It is up to the used vocabulary to define how these additional details +should be interpreted. In case client does not recognize these extensions, +additional details should be ignored and base Hydra interpretation +should be in force. + +Server SHOULD NOT use extensions to add statements that are in +contradiction to base Hydra interpretation, so the client is not confused. +Server SHOULD also keep multiple extensions describing adequate +knowledge in line regarding their description (i.e. data structure +descriptions in various vocabularies should not cause differences). + +Client can express its preferences through the `Prefer` HTTP header +by pointing the preferred extensions via IRIs as on the example below. +The client SHOULD use the `Prefer` HTTP header [[!RFC7240]] with +the `hydra.extension` preference as an `iri` attribute having +the IRI of the extension as value to hint the server about the extension +it supports. Multiple preferences can be expressed by providing multiple +`Prefer` header values. + +
+
+GET http://api.example.com/api/people HTTP/1.1
+Prefer: hydra.extension; iri="http://schema.org/"
+
+
+ +Server MUST implement `Prefer` header handling according to +the [[!RFC7240]] and implementers should proceed with caution. + +Classes {#classes} +======= + +## hydra:ApiDocumentation ## {#class-ApiDocumentation} + + + + + + + + + + + + + +
Name:ApiDocumentation
Summary:The Hydra API documentation class.
Sub-class of:[=Resource=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:BaseUriSource ## {#class-BaseUriSource} + + + + + + + + + + + + + + + + + +
Name:BaseUriSource
Summary: + Provides a base abstract for base Uri source + for Iri template resolution. +
Sub-class of:[=Resource=]
Named instances:[=Rfc3986=], [=LinkContext=]
+ +## hydra:Class ## {#class-Class} + + + + + + + + + + + + + +
Name:Class
Summary:The class of Hydra classes.
Sub-class of:`rdfs:Class`
+ +## hydra:Collection ## {#class-Collection} + + + + + + + + + + + + + +
Name:Collection
Summary: + A collection holding references to a number of related resources. +
Sub-class of:[=Resource=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:Error ## {#class-Error} + + + + + + + + + + + + + +
Name:Error
Summary: + A runtime error, used to report information beyond the returned + status code. +
Sub-class of:[=Status=]
+
+ +HTTP/1.1 400 Bad request +Content-Type: application/problem+json +Link: <http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#context" + +{ +"type": "https://api.example.com/vocab#NullReferenceException", +"@type": "http://www.w3.org/ns/hydra/core#Error", +"title": "The request cannot be processed.", +"detail": "Provided value cannot be 'null'.", +"instance": "http://api.example.com/api/posts", +"status": 404 +} + +
+ +## hydra:HeaderSpecification ## {#class-HeaderSpecification} + + + + + + + + + + + + + +
Name: + HeaderSpecification +
Summary:Specifies a possible either expected or returned header values.
Sub-class of:[=Resource=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "@type": "hydra:HeaderSpecification", + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "@type": "hydra:HeaderSpecification", + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:IriTemplate ## {#class-IriTemplate} + + + + + + + + + +
Name:IriTemplate
Summary:The class of IRI templates.
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "@type": "hydra:IriTemplate", + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:IriTemplateMapping ## {#class-IriTemplateMapping} + + + + + + + + + +
Name: + IriTemplateMapping +
Summary:A mapping from an IRI template variable to a property.
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "@type": "hydra:IriTemplate", + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "@type": "hydra:IriTemplateMapping", + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "@type": "hydra:IriTemplateMapping", + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "@type": "hydra:IriTemplateMapping", + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:Link ## {#class-Link} + + + + + + + + + + + + + +
Name:Link
Summary:The class of properties representing links.
Sub-class of:[=Resource=], `rdf:Property`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@graph": [ + { + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api" + }, + { + "@id": "http://api.example.com/vocab#comments", + "@type": "hydra:Link" + } + } +} + +
+ +## hydra:Operation ## {#class-Operation} + + + + + + + + + +
Name:Operation
Summary:An operation.
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts/1", + "operation": [ + { + "@type": "Operation", + "method": "DELETE", + "title": "Remove", + "description": "Removes post no. 1" + } + ] +} + +
+ +## hydra:PartialCollectionView ## {#class-PartialCollectionView} + + + + + + + + + + + + + +
Name: + + PartialCollectionView + +
Summary: + A PartialCollectionView describes a partial view of a Collection. + Multiple PartialCollectionViews can be connected with + the next/previous properties to allow a client to retrieve + all members of the collection. +
Sub-class of:[=Resource=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@type": "PartialCollectionView", + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:Resource ## {#class-Resource} + + + + + + + + + +
Name:Resource
Summary: + The class of dereferenceable resources by means a client + can attempt to dereference; however, the received responses + should still be verified. +
+ +## hydra:RetractedOperationSpecification ## {#class-RetractedOperationSpecification} + + + + + + + + + +
Name:RetractedOperationSpecification
Summary:Describes which and why an operation is retracted.
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/doc/", + "@type": "Collection", + "retractedOperation": [ + { + "@type": "Operation", + "method": "POST", + "expects": "http://api.example.com/doc/#Upload", + "reason": "Unavailable" + } + ] +} + +
+ + +## hydra:Status ## {#class-Status} + + + + + + + + + +
Name:Status
Summary: + Additional information about a status code that might be returned. +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts/1", + "operation": [ + { + "method": "DELETE", + "title": "Remove", + "description": "Removes post no. 1", + "possibleStatus": [ + { + "@type": "Status", + "statusCode": 303 + } + ] + } + ] +} + +
+ +## hydra:SupportedProperty ## {#class-SupportedProperty} + + + + + + + + + +
Name: + SupportedProperty +
Summary:A property known to be supported by a Hydra class.
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "@type": "SupportedProperty", + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:TemplatedLink ## {#class-TemplatedLink} + + + + + + + + + + + + + +
Name:TemplatedLink
Summary:A templated link.
Sub-class of:[=Resource=], `rdf:Property`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@graph": [ + { + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api" + }, + { + "@id": "http://api.example.com/vocab#comments", + "@type": "hydra:TemplatedLink" + } + } +} + +
+ +## hydra:VariableRepresentation ## {#class-VariableRepresentation} + + + + + + + + + + + + + +
Name: + + VariableRepresentation + +
Summary: + A representation specifies how to serialize variable + values into strings. +
Named instances:[=BasicRepresentation=], [=ExplicitRepresentation=]
+ +## hydra:UnavailabilityReason ## {#class-UnavailabilityReason} + + + + + + + + + + + + + +
Name: + + UnavailabilityReason + +
Summary:Provides reasons why the operation cannot be invoked.
Named instances:[=Unavailable=], [=Unauthorized=]
+ +Properties {#properties} +========== + +## hydra:apiDocumentation ## {#property-apiDocumentation} + + + + + + + + + + + + + + + + + +
Name:apiDocumentation‎
Summary:A link to the API documentation.
Domain:[=Resource=]
Range:[=ApiDocumentation=]
+
+ +HTTP/1.1 200 OK +Content-Type: text/html; charset=utf-8 +Link: <http://api.example.com/doc/>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation" + +
+ +## hydra:closedSet ## {#property-closedSet} + + + + + + + + + + + + + + + + + + + + + +
Name:closedSet
Summary: + Determines whether the provided set of header values + is closed or not. +
Max cardinality:1
Domain:[=HeaderSpecification=]
Range:`xsd:boolean`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:collection ## {#property-collection} + + + + + + + + + + + + + +
Name:collection‎
Summary:Collections somehow related to this resource.
Range:[=Collection=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api", + "collection": [ + { + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "memberAssertion": [ + { + "property": "rdf:type", + "object": "http://api.example.com/vocab#Post" + } + ] + } + ] +} + +
+ +## hydra:description ## {#property-description} + + + + + + + + + + + + + + + + + + + + + +
Name:description
Summary:A description.
Max cardinality:1
Domain includes: + [=ApiDocumentation=], + [=Status=], + [=Class=], + [=SupportedProperty=], + [=Operation=], + [=Link=], + [=TemplatedLink=] +
Range:`xsd:string`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:entrypoint ## {#property-entrypoint} + + + + + + + + + + + + + + + + + + + + + +
Name:entrypoint
Summary:A link to main entry point of the Web API.
Min cardinality:1
Domain:[=ApiDocumentation=]
Range:[=Resource=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:expects ## {#property-expects} + + + + + + + + + + + + + + + + + +
Name:expects
Summary:The information expected by the Web API.
Domain includes:[=Operation=], [=RetractedOperationSpecification=]
Range includes: + `rdfs:Resource`, + [=Resource=], + `rdfs:Class`, + [=Class=] +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:expectsHeader ## {#property-expectsHeader} + + + + + + + + + + + + + + + + + +
Name:expectsHeader
Summary:Specification of the header expected by the operation.
Domain:[=Operation=]
Range includes: + `xsd:string`, + [=HeaderSpecification=] +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:extension ## {#property-extension} + + + + + + + + + + + + + +
Name:extension
Summary:Hint on what kind of extensions are in use.
Domain:[=ApiDocumentation=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:first ## {#property-first} + + + + + + + + + + + + + + + + + + + + + +
Name:first
Summary:The first resource of an interlinked set of resources.
Max cardinality:1
Domain:[=Resource=]
Range:[=Resource=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:freetextQuery ## {#property-freetextQuery} + + + + + + + + + + + + + + + + + +
Name:freetextQuery
Summary:A property representing a freetext query.
Domain:[=Resource=]
Range:`xsd:string`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:headerName ## {#property-headerName} + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:headerName
Summary:Name of the header.
Min cardinality:1
Max cardinality:1
Domain:[=HeaderSpecification=]
Range:`xsd:string`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:last ## {#property-last} + + + + + + + + + + + + + + + + + + + + + +
Name:last
Summary:The last resource of an interlinked set of resources.
Max cardinality:1
Domain:[=Resource=]
Range:[=Resource=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:limit ## {#property-limit} + + + + + + + + + + + + + + + + + +
Name:limit
Summary:Instructs to limit set only to N elements.
Max cardinality:1
Range:`xsd:nonNegativeInteger`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:mapping ## {#property-mapping} + + + + + + + + + + + + + + + + + + + + + +
Name:mapping
Summary:A variable-to-property mapping of the IRI template.
Min cardinality:1
Domain:[=IriTemplate=]
Range:[=IriTemplateMapping=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:member ## {#property-member} + + + + + + + + + + + + + +
Name:member
Summary:A member of the collection.
Domain:[=Collection=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:memberAssertion ## {#property-memberAssertion} + + + + + + + + + + + + + + + + + +
Name:memberAssertion
Summary:Semantics of each member provided by the collection.
Domain includes:[=Collection=], [=Class=]
Range:
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api", + "collection": [ + { + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "memberAssertion": [ + { + "property": "rdf:type", + "object": "http://api.example.com/vocab#Post" + } + ] + } + ] +} + +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts/1/comments", + "@type": "Collection", + "memberAssertion": [ + { + "subject": "http://api.example.com/api/posts/1", + "property": "http://api.example.com/vocab#comment" + } + ] +} + +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@graph": [ + { + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api" + }, + { + "@id": "http://api.example.com/vocab#comments", + "@type": "hydra:Link", + "supportedOperation": [ + { + "method": "GET", + "returns": { + "subClassOf": "hydra:Collection", + "memberAssertion": { + "property": "rdf:type", + "object": "http://api.example.com/vocab#Comment" + } + } + } + ] + } + } +} + +
+ +## hydra:method ## {#property-method} + + + + + + + + + + + + + + + + + +
Name:method
Summary:The protocol method.
Domain includes:[=Operation=], [=RetractedOperationSpecification=]
Range:`xsd:string`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:next ## {#property-next} + + + + + + + + + + + + + + + + + + + + + +
Name:next
Summary: + The resource following the current instance + in an interlinked set of resources. +
Max cardinality:1
Domain:[=Resource=]
Range:[=Resource=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:object ## {#property-object} + + + + + + + + + + + + + +
Name:object
Summary:The object.
Min cardinality:1
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api", + "collection": [ + { + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "memberAssertion": [ + { + "property": "rdf:type", + "object": "http://api.example.com/vocab#Post" + } + ] + } + ] +} + +
+ +## hydra:offset ## {#property-offset} + + + + + + + + + + + + + + + + + +
Name:offset
Summary:Instructs to skip N elements of the set.
Max cardinality:1
Range:`xsd:nonNegativeInteger`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:operation ## {#property-operation} + + + + + + + + + + + + + + + + + +
Name:operation‎
Summary:An operation supported by the Hydra resource.
Domain:[=Resource=]
Range:[=Operation=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts/1", + "operation": [ + { + "method": "DELETE", + "title": "Remove", + "description": "Removes post no. 1" + } + ] +} + +
+ +## hydra:pageIndex ## {#property-pageIndex} + + + + + + + + + + + + + + + + + +
Name:pageIndex
Summary: + Instructs to provide a specific page of the collection + at a given index. +
Max cardinality:1
Range:`xsd:nonNegativeInteger`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,page,limit}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "page", + "property": "hydra:pageIndex", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:pageReference ## {#property-pageReference} + + + + + + + + + + + + + +
Name:pageReference
Summary: + Instructs to provide a specific page reference + of the collection. +
Max cardinality:1
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,partOfDay,limit}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "partOfDay", + "property": "hydra:pageReference", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:possibleStatus ## {#property-possibleStatus} + + + + + + + + + + + + + + + + + +
Name:possibleStatus
Summary: + A status that might be returned by the Web API (other + statuses should be expected and properly handled as well). +
Domain includes:[=ApiDocumentation=], [=Operation=], [=RetractedOperationSpecification=]
Range:[=Status=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts/1", + "operation": [ + { + "method": "DELETE", + "title": "Remove", + "description": "Removes post no. 1", + "possibleStatus": [ + { + "@type": "Status", + "statusCode": 303 + } + ] + } + ] +} + +
+ +## hydra:possibleValue ## {#property-possibleValue} + + + + + + + + + + + + + + + + + + + + + +
Name:possibleValue
Summary:Possible value of the header.
Min cardinality:1
Domain:[=HeaderSpecification=]
Range:`xsd:string`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:previous ## {#property-previous} + + + + + + + + + + + + + + + + + + + + + +
Name:previous
Summary: + The resource preceding the current instance + in an interlinked set of resources. +
Max cardinality:1
Domain:[=Resource=]
Range:[=Resource=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:property ## {#property-property} + + + + + + + + + + + + (only when used in context of [=memberAssertion=]) + + + + + + + + + +
Name:property
Summary:A property.
Min cardinality:1
Domain includes:[=SupportedProperty=], [=IriTemplateMapping=]
Range:`rdf:Property`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api", + "collection": [ + { + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "memberAssertion": [ + { + "property": "rdf:type", + "object": "http://api.example.com/vocab#Post" + } + ] + } + ] +} + +
+ +## hydra:readable ## {#property-readable} + + + + + + + + + + + + + + + + + + + + + +
Name:readable
Summary: + True if the client can retrieve the property's value, + false otherwise. +
Max cardinality:1
Domain:[=SupportedProperty=]
Range:`xsd:boolean`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:reason ## {#property-reason} + + + + + + + + + + + + + + + + + + + + + +
Name:reason
Summary:Reason of why the operation is retracted.
Max cardinality:1
Domain:[=RetractedOperationSpecification=]
Range:[=UnavailabilityReason=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/doc/", + "@type": "Collection", + "retractedOperation": [ + { + "@type": "Operation", + "method": "POST", + "expects": "http://api.example.com/doc/#Upload", + "reason": "Unavailable" + } + ] +} + +
+ +## hydra:retractedOperation ## {#property-retractedOperation} + + + + + + + + + + + + + + + + + +
Name:retractedOperation
Summary:Retracts available operations.
Domain:[=Resource=]
Range:[=RetractedOperationSpecification=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/doc/", + "@type": "Collection", + "retractedOperation": [ + { + "@type": "Operation", + "method": "POST", + "expects": "http://api.example.com/doc/#Upload", + "reason": "Unavailable" + } + ] +} + +
+ +## hydra:required ## {#property-required} + + + + + + + + + + + + + + + + + + + + + +
Name:required
Summary:True if the property is required, false otherwise.
Max cardinality:1
Domain includes:[=SupportedProperty=], [=IriTemplateMapping=]
Range:`xsd:boolean`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:resolveRelativeUsing ## {#property-resolveRelativeUsing} + + + + + + + + + + + + + +
Name:resolveRelativeUsing
Summary: + Instructs on how to resolve relative Uri created + by the Iri template resolution. +
Max cardinality:1
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:returns ## {#property-returns} + + + + + + + + + + + + + + + + + +
Name:returns
Summary:The information returned by the Web API on success.
Domain includes:[=Operation=], [=RetractedOperationSpecification=]
Range includes: + `rdfs:Resource`, + [=Resource=], + `rdfs:Class`, + [=Class=] +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:returnsHeader ## {#property-returnsHeader} + + + + + + + + + + + + + + + + + +
Name:returnsHeader
Summary:Name of the header returned by the operation.
Domain:[=Operation=]
Range includes: + `xsd:string`, + [=HeaderSpecification=] +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:search ## {#property-search} + + + + + + + + + + + + + + + + + +
Name:search
Summary:A Iri template that can be used to query a collection.
Domain:[=Resource=]
Range:[=IriTemplate=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:statusCode ## {#property-statusCode} + + + + + + + + + + + + + + + + + +
Name:statusCode
Summary: + The response status code. Please note it may happen this + value will be different to actual status code received. +
Domain:[=Status=]
Range:`xsd:integer`
+
+ +HTTP/1.1 400 Bad request +Content-Type: application/problem+json +Link: <http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#context" + +{ + "type": "https://api.example.com/vocab#NullReferenceException", + "@type": "http://www.w3.org/ns/hydra/core#Error", + "title": "The request cannot be processed.", + "detail": "Provided value cannot be 'null'.", + "instance": "http://api.example.com/api/posts", + "status": 404 +} + +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts/1", + "operation": [ + { + "method": "DELETE", + "title": "Remove", + "description": "Removes post no. 1", + "possibleStatus": [ + { + "@type": "Status", + "statusCode": 303 + } + ] + } + ] +} + +
+ +## hydra:subject ## {#property-subject} + + + + + + + + + + + + + +
Name:subject
Summary:The subject.
Min cardinality:1
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts/1/comments", + "@type": "Collection", + "memberAssertion": [ + { + "subject": "http://api.example.com/api/posts/1", + "property": "http://api.example.com/vocab#comment" + } + ] +} + +
+ +## hydra:supportedClass ## {#property-supportedClass} + + + + + + + + + + + + + + + + + +
Name:supportedClass
Summary:A class known to be supported by the Web API.
Domain:[=ApiDocumentation=]
Range:`rdfs:Class`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:supportedOperation ## {#property-supportedOperation} + + + + + + + + + + + + + + + + + +
Name:supportedOperation
Summary: + An operation supported by instances of the specific Hydra + class, or the target of the Hydra link, or Iri template. +
Domain includes: + `rdfs:Class`, + [=Class=], + [=Link=], + [=TemplatedLink=], + [=SupportedProperty=] +
Range:[=Operation=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search}", + "resolveRelativeUsing": "hydra:Rfc3986", + "supportedOperation": { + "method": "POST" + }, + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@graph": [ + { + "@id": "http://api.example.com/api/posts/1", + "http://api.example.com/vocab#comment": + "http://api.example.com/api/posts/1/comments" + }, + { + "@id": "http://api.example.com/vocab#comment", + "@type": "hydra:Link", + "supportedOperation": { + "method": "GET", + "returns": "http://api.example.com/vocab#Comment + } + } + ] +} + +
+ +## hydra:supportedProperty ## {#property-supportedProperty} + + + + + + + + + + + + + + + + + +
Name:supportedProperty‎
Summary:The properties known to be supported by a Hydra class.
Domain:`rdfs:Class`
Range:[=SupportedProperty=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:template ## {#property-template} + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:template
Summary: + A templated string with placeholders. The literal's + datatype indicates the template syntax; if not specified, + hydra:Rfc6570Template is assumed. +
Min cardinality:1
Max cardinality:1
Domain:[=IriTemplate=]
Range:[=Rfc6570Template=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:title ## {#property-title} + + + + + + + + + + + + + + + + + + + + + +
Name:title
Summary:A title, often used along with a description.
Max cardinality:1
Domain includes: + [=ApiDocumentation=], + [=Status=], + [=Class=], + [=SupportedProperty=], + [=Operation=], + [=Link=], + [=TemplatedLink=] +
Range:`xsd:string`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "title": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "title": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +## hydra:totalItems ## {#property-totalItems} + + + + + + + + + + + + + + + + + + + + + +
Name:totalItems
Summary:The total number of items referenced by a collection.
Max cardinality:1
Domain:[=Collection=]
Range:`xsd:integer`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:variable ## {#property-variable} + + + + + + + + + + + + + + + + + + + + + + + + + +
Name:variable
Summary:An Iri template variable.
Min cardinality:1
Max cardinality:1
Domain:[=IriTemplateMapping=]
Range:`xsd:string`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:variableRepresentation ## {#property-variableRepresentation} + + + + + + + + + + + + + + + + + + + + + +
Name:variableRepresentation‎
Summary: + The representation format to use when expanding + the Iri template. +
Max cardinality:1
Domain includes:[=IriTemplateMapping=], [=IriTemplate=]
Range:[=VariableRepresentation=]
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection",hydra:view + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "variableRepresentation": "hydra:BasicRepresentation", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:ExplicitRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false + } + ] + } +} + +
+ +## hydra:view ## {#property-view} + + + + + + + + + + + + + +
Name:view
Summary:A specific view of a resource.
Max cardinality:1
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search,limit,offset}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:writable ## {#property-writable} + + + + + + + + + + + + + + + + + + + + + +
Name:writable
Summary: + True if the client can change the property's value, + false otherwise. +
Max cardinality:1
Domain:[=SupportedProperty=]
Range:`xsd:boolean`
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api?documentation", + "@type": "ApiDocumentation", + "entrypoint": "http://api.example.com/api", + "extension": "https://w3id.org/hydra/extension#shacl", + "supportedClass": [ + { + "@id": "http://api.example.com/vocab#User", + "label": "User", + "description": "Describes a system user.", + "supportedOperation": [ + { + "method": "PUT", + "label": "Create new user", + "description": "Creates a brand new user.", + "expects": "http://api.example.com/vocab#User", + "returns": "http://api.example.com/vocab#User", + "returnsHeader": [ + { + "headerName": "Content-Type", + "possibleValue": ["text/turtle", "application/ld+json"], + "closedSet": true + } + "Content-Length" + ], + "expectsHeader": [ + "Authorization", + { + "headerName": "Content-Type", + "possibleValue": ["image/gif", "image/png"], + "closedSet": true + } + ] + } + ], + "supportedProperty": [ + { + "property": "http://api.example.com/vocab#login", + "writable": true, + "readable": true, + "required": true + } + ] + } + ] +} + +
+ +Named instances {#named-instances} +=============== + +## hydra:BasicRepresentation ## {#instance-BasicRepresentation} + + + + + + + + + +
Name:BasicRepresentation
Summary: + A representation that serializes just the lexical form of a variable value, + but omits language and type information. +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:ExplicitRepresentation ## {#instance-ExplicitRepresentation} + + + + + + + + + +
Name:ExplicitRepresentation
Summary: + A representation that serializes a variable value including its language + and type information and thus differentiating between IRIs and literals. +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": "/api/posts{?search}", + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:ExplicitRepresentation" + } + ] + } +} + +
+ +## hydra:LinkContext ## {#instance-LinkContext} + + + + + + + + + +
Name:LinkContext
Summary: + States that the link's context IRI, as defined in RFC 5988, should be used + as the base Uri. +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": { + "@value": "/api/posts{?search}", + "@type": "hydra:Rfc6570Template" + }, + "resolveRelativeUsing": "hydra:LinkContext", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:Rfc3986 ## {#instance-Rfc3986} + + + + + + + + + +
Name:Rfc3986
Summary: + States that the link's context IRI, as defined in RFC 5988, should be used + as the base Uri. +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": { + "@value": "/api/posts{?search}", + "@type": "hydra:Rfc6570Template" + }, + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation" + } + ] + } +} + +
+ +## hydra:Unavailable ## {#instance-Unavailable} + + + + + + + + + +
Name:Unavailable
Summary:States an operation previously announced is unavailable in current circumstances.
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/doc/", + "@type": "Collection", + "retractedOperation": [ + { + "@type": "Operation", + "method": "POST", + "expects": "http://api.example.com/doc/#Upload", + "reason": "Unavailable" + } + ] +} + +
+ +## hydra:Unauthorized ## {#instance-Unauthorized} + + + + + + + + + +
Name:Unauthorized
Summary: + States an operation previously announced should not be invoked + as the current user is not authorized to invoke it. +
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/doc/", + "@type": "Collection", + "retractedOperation": [ + { + "@type": "Operation", + "method": "POST", + "expects": "http://api.example.com/doc/#Upload", + "reason": "Unauthorized" + } + ] +} + +
+ +Data types {#data-types} +========== + +## hydra:Rfc6570Template ## {#datatype-Rfc6570Template} + + + + + + + + + +
Name:Rfc6570Template
Summary:An IRI template as defined by [[!RFC6570]].
+
+ +{ + "@context": "http://www.w3.org/ns/hydra/context.jsonld", + "@id": "http://api.example.com/api/posts", + "@type": "Collection", + "view": { + "@id": "http://api.example.com/api/posts?skip=10", + "@type": "PartialCollectionView", + "first": "http://api.example.com/api/posts", + "last": "http://api.example.com/api/posts?skip=100", + "previous": "http://api.example.com/api/posts", + "next": "http://api.example.com/api/posts?skip=20", + "totalItems": 10, + }, + "totalItems": 100, + "member": [ + { "@id": "http://api.example.com/api/posts/10" }, + { "@id": "http://api.example.com/api/posts/11" }, + { "@id": "http://api.example.com/api/posts/12" }, + { "@id": "http://api.example.com/api/posts/13" }, + { "@id": "http://api.example.com/api/posts/14" }, + { "@id": "http://api.example.com/api/posts/15" }, + { "@id": "http://api.example.com/api/posts/16" }, + { "@id": "http://api.example.com/api/posts/17" }, + { "@id": "http://api.example.com/api/posts/18" }, + { "@id": "http://api.example.com/api/posts/19" } + ], + "search": { + "template": { + "@value": "/api/posts{?search,limit,offset}", + "@type": "hydra:Rfc6570Template" + }, + "resolveRelativeUsing": "hydra:Rfc3986", + "mapping": [ + { + "variable": "search", + "property": "hydra:freetextQuery", + "required": true, + "variableRepresentation": "hydra:BasicRepresentation"" + }, + { + "variable": "limit", + "property": "hydra:limit", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation"" + }, + { + "variable": "offset", + "property": "hydra:offset", + "required": false, + "variableRepresentation": "hydra:BasicRepresentation"" + } + ] + } +} + +
+ +Acknowledgements {#acknowledgments} +================ + +Note: This section is non-normative. + +The authors would like to thank the following individuals for contributing +their ideas and providing feedback for writing this specification: +Arnau Siches, elf Pavlik, Mark Baker, Martijn Faassen, +Matthias Lehmann, Ruben Verborgh, Ryan J. McDonough, Sam Goto, +Thomas Hoppe, @wasabiwimp (on GitHub). + +Special thanks to Tomasz Pluskiewicz. + +The Hydra in JSON-LD {#vocab-jsonld} +==================================== + +Note: This section is non-normative. + +
+path: core.jsonld
+highlight: json-ld
+
+ +The Hydra error context {#error-jsonld} +====================================================== + +Note: This section is non-normative. + +
+path: error.jsonld
+highlight: json-ld
+
+ +
+{
+    "HydraCG": {
+        "href": "https://www.w3.org/community/hydra/",
+        "title": "Hydra W3C Community Group"
+    }
+}
+
\ No newline at end of file diff --git a/spec/latest/core/index.html b/spec/latest/core/index.html index 1f5dfaf..0ef274b 100644 --- a/spec/latest/core/index.html +++ b/spec/latest/core/index.html @@ -1,1615 +1,5355 @@ - - - -Hydra Core Vocabulary - - - - - + + + + Hydra Core Vocabulary + + + + + + + + + + + + + - - - -
-

Hydra is a lightweight vocabulary to create hypermedia-driven Web APIs. - By specifying a number of concepts commonly used in Web APIs it enables - the creation of generic API clients.

-
- -
-

This entire document is a work in progress and several - sections are incomplete, missing, or outdated. All open issues and decisions - are documented in our - issue tracker. - If you have questions, please don't hesitate to - join the Hydra W3C Community Group and post to the mailing list. -

- -

This specification was published by the - Hydra W3C Community Group. It is - not a W3C Standard nor is it on the W3C Standards Track. Please note that under the - W3C Community Contributor License Agreement (CLA) - there is a limited opt-out and other conditions apply. Learn more about - W3C Community and Business Groups.

- -

To participate in the development of this specification, please join the - Hydra W3C Community Group. If - you have questions, want to suggest a feature, or raise an issue, please send a mail to the - public-hydra@w3.org mailing list.

-
- -
-

Introduction

- -

Coping with the ever-increasing amount of data becomes - increasingly challenging. To alleviate the information overload put on - people, systems are progressively being connected directly to each - other. They exchange, analyze, and manipulate humongous amounts of - data without any human interaction. Most current solutions, however, - do not exploit the whole potential of the architecture of the World - Wide Web and completely ignore the possibilities offered by Linked Data - technologies.

- -

The combination of the REST architectural style and the Linked - Data principles offer opportunities to advance the Web of machines - in a similar way that hypertext did for the human Web. Most - building blocks exist already and are in place but they are rarely - used together. Hydra tries to fill that gap. It allows data to be - enriched with machine-readable affordances which enable - interaction. This not only addresses the problem that Linked Data - is still mostly read-only, but it also paves the way for a - completely new breed of interoperable Web APIs. The fact that it - enables the creation of composable contracts means that - interaction models of Web APIs can be reused at an unprecedented - granularity.

-
- -
-

Conformance

- -

This specification describes the conformance criteria for - Hydra API documentations - and Hydra clients. These criteria are - relevant to authors, authoring tool implementers, and client - implementers. All authoring guidelines, diagrams, examples, and notes - in this specification are non-normative, as are all sections - explicitly marked as non-normative. Everything else in this - specification is normative.

- -

Conformance for Hydra clients should probably not be - specified in this document.

- -

Add normative statements

- -

The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, - SHOULD NOT, RECOMMENDED, NOT RECOMMENDED, MAY, and OPTIONAL in this - specification have the meaning defined in [[!RFC2119]].

-
- -
-

Hydra at a Glance

- -

The basic idea behind Hydra is to provide a vocabulary which enables a - server to advertise valid state transitions to a client. A client can - then use this information to construct HTTP requests which modify the - server’s state so that a certain desired goal is achieved. Since all - the information about the valid state transitions is exchanged in a - machine-processable way at runtime instead of being hardcoded into the - client at design time, clients can be decoupled from the server and - adapt to changes more easily.

- -

The namespace of the Hydra core vocabulary is - http://www.w3.org/ns/hydra/core#, and the suggested prefix - is hydra. The figure below illustrates the vocabulary (the - figure’s goal is to show how Hydra is used rather than its precise - definition).

- -

Is this illustration clear enough or is it confusing? - Feedback would be much appreciated.

- -
-

The Hydra core vocabulary

-

The Hydra core vocabulary

+ + +
+

+

Hydra Core Vocabulary

+

Living Document,

+
+
+
This version: +
https://www.hydra-cg.com/spec/latest/core/ +
Editors: +
Markus Lanthaler +
Karol Szczepanski +
Author: +
Markus Lanthaler +
Karol Szczepanski +
+
+
+ +
+
+
+

Abstract

+

Hydra is a lightweight vocabulary to create hypermedia-driven Web APIs. By specifying a number of concepts commonly used in Web APIs it enables the creation of generic API clients.

+
+ +
+

1. Status of This Document

+ This specification was published by the [HydraCG]. +It is not a W3C Standard, nor it is on the W3C Standards Track. +Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. +Learn more about W3C Community and Business Groups. +

1.1. Conventions

+

Within this document, the following namespace prefix bindings are used:

+ + + + + + + + + + + + +
Prefix + Namespace +
hydra: + http://www.w3.org/ns/hydra/core# +
rdf: + http://www.w3.org/1999/02/22-rdf-syntax-ns# +
rdfs: + http://www.w3.org/2000/01/rdf-schema# +
xsd: + http://www.w3.org/2001/XMLSchema# +
owl: + http://www.w3.org/2002/07/owl# +
vs: + http://www.w3.org/2003/06/sw-vocab-status/ns# +
dc: + http://purl.org/dc/terms/ +
cc: + http://creativecommons.org/ns# +
schema: + http://schema.org/ +
+

2. Introduction

+

Note: This section is non-normative.

+

Coping with the ever-increasing amount of data becomes increasingly +challenging. To alleviate the information overload put on people, +systems are progressively being connected directly to each other. +They exchange, analyze, and manipulate humongous amounts of data +without any human interaction. Most current solutions, however, +do not exploit the whole potential of the architecture of the World +Wide Web and completely ignore the possibilities offered by Linked Data +technologies.

+

The combination of the REST architectural style, and the Linked +Data principles offer opportunities to advance the Web of machines +in a similar way that hypertext did for the human Web. Most +building blocks exist already and are in place, but they are rarely +used together. Hydra tries to fill that gap. It allows data +to be enriched with machine-readable affordances which enable interaction. +This not only addresses the problem that Linked Data is still mostly +read-only, but it also paves the way for a completely new breed +of interoperable Web APIs. The fact that it enables the creation +of composable contracts means that interaction models of Web APIs +can be reused at an unprecedented granularity.

+

3. Hydra at a Glance

+

Note: This section is non-normative.

+

The basic idea behind Hydra is to provide a vocabulary which enables a +server to advertise valid state transitions to a client. A client can +then use this information to construct requests (i.e. compliant with +an HTTP protocol) which modify the server’s state so that a certain +desired goal is achieved. Since all the information about the valid state +transitions is exchanged in a machine-processable way at runtime +instead of being hardcoded into the client at design time, clients +can be decoupled from the server and adapt to changes more easily.

+

The namespace of the Hydra core vocabulary +is http://www.w3.org/ns/hydra/core#, and the suggested prefix +is hydra. The figure below illustrates the vocabulary +(the figure’s goal is to show how Hydra is used rather than its precise +definition).

+

The Hydra core vocabulary

+

An alphabetical index of the classes and properties of Hydra +is given below. All the terms are hyperlinked to their detailed +description for quick reference.

+

4. Using Hydra

+

Throughout this section, a simple Web API featuring an issue tracker +will be used to illustrate how Hydra can be used. The Web API enables +its users to file new issues, modify or delete existing ones, and +to comment them. For the sake of simplicity, orthogonal aspects such +as authentication or authorization are not covered.

+

4.1. Adding Affordances to Representations

+

The exemplary Web API has to expose representations of issues and +comments. To enable interaction with those resources, a client has +to know which operations the server supports. In human-facing +websites such affordances are typically exposed by links and forms +and described in natural language. Unfortunately, machines can not +interpret such information easily. The solution that presents itself +is to reduce the language to a few unambiguous concepts which are easily +recognizable by a machine client. Hydra formalizes such concepts.

+

The simplest and most important affordance on the Web are hyperlinks. +Without them, it would be impossible to browse the Web. +Users typically select the link based on the text it is labeled with. +To give machines a similar understanding, links can be annotated +with a link relation type—a registered token or a URI identifying +the semantics of the link. The following example shows how such +a typed link is used in HTML to reference a stylesheet.

+
+ +
EXAMPLE: A typed link referencing a stylesheet as used in HTML
+
<link href="http://www.example.com/styles.css"      rel="stylesheet" />
+
+

In Linked Data, the link relation type corresponds to the property itself. +An example in JSON-LD would thus look as follows.

+
+ +
EXAMPLE: Referencing a stylesheet in JSON-LD
+
{    "urn:iana:link-relations:stylesheet": {        "@id": "http://www.example.com/styles.css"    }}
+
+

Generally, a client decides whether to follow a link or not based on +the link relation (or property in the case of Linked Data) which +defines its semantics. There are however also clients such as Web crawlers +which simply follow every link intended to be dereferenced. In HTML this +usually means that all links in anchor elements +(the <a> tag) are followed, but most references in link +elements (the <link> tag), such as used in the example +above, are ignored. Since in RDF serializations no such distinction exists, +the best a client can do is to blindly try to dereference all URIs. +It would thus be beneficial to describe in a machine-readable manner +if a property represents a link intended to be dereferenced or +solely an identifier. Hydra’s Link class does just that. It can be +used to define properties that represent dereferencable links. +In the exemplary Web API used throughout this section, it can be +used to define a property linking issues to their comments:

+
+ +
EXAMPLE: Defining properties representing hyperlinks using Hydra’s Link class
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/vocab#comments",    "@type": "Link"}
+
+

In the example above, a property identified with the URL http://api.example.com/vocab#comments is defined to be +of the type Link. This is enough information for a client understanding +Hydra to know that the value of the comments property +in the following example is intended to be dereferenced.

+

Note: It is recommended to dereference resources that are within an API’s domain. +This may prevent possible issues with cross-site scripting or obtaining +resources which might have no meaning to the client or such that the client +would be unable to interpret. Still, there is no formal prohibition of +dereferencing resources linked with well-known properties, e.g. rdf:seeAlso.

+
+ +
EXAMPLE: Using a property defined to be a hyperlink
+
{    "@context": {        "comments": "http://api.example.com/vocab#comments"    },    "@id": "http://api.example.com/an-issue",    "title": "An exemplary issue linking to its comments",    "comments": { "@id": "http://api.example.com/an-issue/comments" }}
+
+

In the example above, the value of the comments property +is a JSON object with an @id member. This is JSON-LD’s +convention to distinguish between strings and IRIs. By using JSON-LD’s +type-coercion feature, the representation can be made even more idiomatic:

+
+ +
EXAMPLE: Using JSON-LD’s type-coercion feature to create idiomatic representations
+
{    "@context": {        "comments": {            "@id": "http://api.example.com/vocab#comments",            "@type": "@id"        }    },    "@id": "http://api.example.com/an-issue",    "title": "An exemplary issue linking to its comments",    "comments":        "http://api.example.com/an-issue/comments"}
+
+

While links are enough to build read-only Web APIs, more powerful +affordances are required to build read-write Web APIs. Thus, Hydra +introduces the notion of operations. Simply speaking, an Operation represents the information necessary for a client +to construct valid HTTP requests in order to manipulate the server’s +resource state. As such, the only required property of an Operation is its method. Optionally, it is also possible +to describe what information the server expects or returns, +including additional information about response status codes that +might be returned. This helps a developer to understand what to expect +when invoking an operation. This information has, however, +not to be considered as being complete; it is merely a hint. +Developers should, e.g., expect that other status codes might be returned +and program their clients accordingly.

+

The following example illustrates how representations can be +augmented with information that enables clients to interact with +them.

+
+ +
EXAMPLE: A representation of an issue augmented with a delete operation
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "/an-issue",    "title": "An exemplary issue representation",    "description": "This issue can be deleted with an HTTP DELETE request.",    "operation": [        {            "@type": "Operation",            "method": "DELETE"        }    ]}
+
+

The example above references Hydra’s context to map properties such +as operation and method and values like Operation to URLs +that unambiguously identify these concepts. It would be similarly valid +JSON-LD if these mappings would be directly embedded into the representation +or if the full URLs would be used instead. Typically, however, the context +is the same for a lot of representations in a Web API and it thus makes +sense to reduce the response size by leveraging a remote context that +can easily be cached by a client.

+

Note: It is worth mentioning that due to the fact that Hydra is built on +RDF, which is a graph, it may happen that a related resource +(an object of the relation) may not be fully described in the +resource’s payload.

+

In several circumstances (i.e. payload terms defined in API documentation sa described in § 4.2 Documenting a Web API or IriTemplate expected as a related resource as described in Templated Links) client may +discover no additional statements describing it. These rules should +be considered by the client in following scenarios:

+
    +
  • +

    in case of an object expected to be a hypermedia resource does not have +all the necessary statements for which it is a subject, the client +SHOULD look in the API documentation for more details

    +
  • +

    in case the mentioned object, after consulting +an API documentation, still does not have +all the necessary statements for which it is a subject and both +mentioned object’s Url and Url of the initially obtained resource +has the same scheme and authority (by means of [RFC3986] sections 3.1 and 3.2), the client SHOULD dereference that URL. +If the resource does not have the same scheme and authority the client +MAY chose to dereference it (for example if the resource originates +from another API well-known to the client)

    +
  • +

    in case the mentioned object still does not have all the necessary +statements for which it is a subject (i.e. dereferencing it failed +or statements are missing), the client SHOULD either ignore the whole +statement (i.e. for display purposes) or throw an exception +(i.e. an IriTemplate is about to be resolved and dereferenced)

    +
+

Example of each of the situations are as follows:

+
+ +
EXAMPLE: IriTemplate details extraction
+
HTTP/1.1 200 OKContent-Type: application/ld+jsonLink: <http://api.example.com/doc/>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@graph": [{        "@id": "http://api.example.com/attachments",        "@type": "hydra:Collection",        "api:attachmentByIssue": "api:AttachmentByIssueTemplate"    }, {        "@id": "http://api.example.com/issues",        "@type": "hydra:Collection",        "api:issueByName": "api:IssueByNameTemplate"    }}
+
HTTP/1.1 200 OKContent-Type: application/ld+json{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@graph": [{        "@id": "api:AttachmentByIssueTemplate",        "@type": "hydra:IriTemplate",        "template": "http://api.example.com/attachments/{issue}",        ...    }]}
+
+

where:

+
    +
  • +

    resource http://api.example.com/attachments should have +an IriTemplate available as there is a complete definition +of the template available at http://api.example.com/doc/

    +
  • +

    resource http://api.example.com/issues should not have +an IRI template exposed as there are no additional details available, +neither in the initial resources' payload nor in the API documentation

    +
+

Note: Keep in mind that any resource described by any hypermedia control +may fail at runtime due to various reasons. Operation details +such as returns or possibleStatus may also vary at runtime, +which means client SHOULD always verify received payloads at runtime.

+

4.2. Documenting a Web API

+

In Web APIs, most representations are typically very similar. +Furthermore, resources often support the same operations. It thus +makes sense, to collect this information in a central documentation. +Traditionally, this has been done in natural language which forces +developers to hardcode that knowledge into their clients. Hydra +addresses this issue by making the documentation completely +machine-processable. The fact that all definitions can be identified +by URLs enables reuse at unprecedented granularity.

+

Hydra’s ApiDocumentation class builds the foundation for +the description of a Web API. As shown in the following example, +Hydra describes an API by giving it a title, a short description, and +documenting its main entry point. Furthermore, the classes known to +be supported by the Web API and additional information about status +codes that might be returned can be documented. This information +may be used to automatically generate documentations in natural +language.

+
+ +
EXAMPLE: The overall structure of a Hydra API documentation
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/",    "@type": "ApiDocumentation",    "title": "The name of the API",    "description": "A short description of the API",    "entrypoint": "URL of the API’s main entry point",    "supportedClass": [        // "... Classes known to be supported by the Web API ..."    ],    "possibleStatus": [        // "... Statuses that should be expected and handled properly ..."    ]}
+
+

In Linked Data, properties are, just as everything else, identified +by IRIs and thus have global scope which implies that they have +independent semantics. In contrast, properties in data models as +used in common programming languages are class-dependent. Their +semantics depend on the class they belong to. In data models classes +are typically described by the properties they expose whereas in +Linked Data properties define to which classes they belong. If no +class is specified, it is assumed that a property may apply to every +class.

+

These differences have interesting consequences. For example, the +commonly asked question of which properties can be applied to an +instance of a specific class can typically not be answered for +Linked Data. Strictly speaking, any property which is not explicitly +forbidden could be applied. This stems from the fact that Linked Data +works under an open-world assumption whereas data models used by +programmers typically work under a closed-world assumption. The +difference is that when a closed world is assumed, everything that +is not known to be true is false or vice-versa. With an open-world +assumption the failure to derive a fact does not automatically imply +the opposite; it embraces the fact that the knowledge is incomplete.

+

Since Hydra may use classes to describe the information expected or +returned by an operation, it also defines a concept to describe the +properties known to be supported by a class. The following example +illustrates this feature. Instead of referencing properties directly, supportedProperty references an intermediate data structure, +namely instances of the SupportedProperty class. This makes +it possible to define whether a specific property is required or +whether it is read-only or write-only depending on the class it is +associated with.

+
+ +
EXAMPLE: Defining a class and documenting its supported properties
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/#Comment",    "@type": "Class",    "title": "The name of the class",    "description": "A short description of the class.",    "supportedProperty": [        // "... Properties known to be supported by the class ..."        {            "@type": "SupportedProperty",            "property": "#property", // "The property"            "required": true, // "Is the property required in a request to be valid?"            "readable": false, // "Can the client retrieve the property’s value?"            "writable": true // "Can the client change the property’s value?"        }    ]}
+
+

All instances of a specific class typically support the same operations. +Hydra therefore features a supportedOperation property which defines +the operations supported by all instances of a class.

+
+ +
EXAMPLE: Defining a class and documenting its supported operations
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/#Comment",    "@type": "Class",    "title": "The name of the class",    "description": "A short description of the class.",    "supportedProperty": [        // "... Properties known to be supported by the class ..."    ],    "supportedOperation": [        // "... Operations known to be supported by instances of the class ..."    ]}
+
+

The same feature can be used to describe the operations supported +by values of a Link property. This is often helpful when +certain operations depend on the permissions of the current user. It +makes it, e.g., possible to show a "delete" link only if the current +user has the permission to delete the resource. Otherwise, the link +would simply be hidden in the representation.

+

Example shown below describes the operation’s expected and returned +value as a dereferencable resource (an RDF resource of a given class), +but the vocabulary is not limited to only those originating +from RDF and is enabled to other types of resources. +Please note that in case of multiple either returned or expected types +provided, client SHOULD assume the set includes any of the types, +but not limited to those types and client SHOULD interpret a received +payload at runtime for possible discrepancies.

+
+ +
EXAMPLE: Documenting the supported operations of link properties
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/#comments",    "@type": "Link",    "title": "Comments",    "description": "A link to comments with an operation to create a new comment.",    "supportedOperation": [        {            "@type": "Operation",            "title": "Creates a new comment",            "method": "POST",            "expects": "http://api.example.com/doc/#Comment",            "returns": "http://api.example.com/doc/#Comment",            "possibleStatus": [                // "... Statuses that should be expected and handled properly ..."            ]        }    ]}
+
+

Note: It is worth to mention that Hydra comes with a notion +of a dereferenceability promise, which means that resources marked +with a Resource class can be safely dereferenced by a client. +Unfortunately, the way how the Word Wide Web works it is impossible to +guarantee that the resource finally will be obtained.

+

In addition to expected/returned resources, +it is also possible to express similar features for headers with returnsHeader and expectsHeader predicates which provides +a simple set of header names. Client SHOULD apply respective header +semantics when creating or receiving a request natural for the protocol in use.

+
+ +
EXAMPLE: Making a use of a returned header
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/#comments",    "@type": "Link",    "supportedOperation": [        {            "@type": "Operation",            "method": "POST",            "expects": "http://api.example.com/doc/#Comment",            "returns": "http://api.example.com/doc/#Comment",            "returnsHeader": [                "Content-Type",                "Content-Length"],            "expectsHeader": [                "Authorization"            ]        }    ]}
+
+

The example above enable an HTTP client to prepare a proper cross-site +pre-flight request, so the server exposes enlisted headers for the client. +The client is also aware of the user authentication requirement necessary +for the operation invocation.

+

For more complex scenarios it is also possible to expand selected header +specification with both name and possible values, i.e. when defining +expected Content-Type values of resources that can be uploaded. +In case multiple possible values are provided, client SHOULD assume +that the set includes any of the values, but not limited to those values. +In order to change that default behavior it is possible to use closedSet predicate on the header specification indicating that the set of provided +values is, well, closed and no other values are available. In both cases +the client SHOULD interpret a received payload at runtime for possible +discrepancies.

+
+ +
EXAMPLE: Making a use of a expected header values
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/#comments",    "@type": "Link",    "supportedOperation": [        {            "@type": "Operation",            "method": "POST",            "expects": "http://api.example.com/doc/#Upload",            "returns": "http://api.example.com/doc/#Comment",            "returnsHeader": [                {                    "headerName": "Content-Type",                    "possibleValue": ["text/turtle", "application/ld+json"]                }                "Content-Length"            ],            "expectsHeader": [                "Authorization",                {                    "headerName": "Content-Type",                    "possibleValue": ["image/gif", "image/png"]                }            ]        }    ]}
+
+

To wrap up everything altogether, it is also possible to attach atomic +operations supported by, well, supported property itself. This might +come in handy for scenarios, when resource can be partially modified. +It can be achieved with two approaches, both having advantages and +disadvantages.

+

First approach would involve adding a supportedOperation to the +intermediate structure of SupportedProperty. +This way prevents from leaking API specific features from the API itself +to i.e. externally defined properties. Data aggregators won’t assume that +each instance with a given property could have such an operation.

+

Another approach would require the API to elevate a specific property +to Link, which can accept a supportedOperation. This +is more intuitive in APIs operating with internally used vocabularies +where assumption that every instance with that very specific property +has the operation attached available.

+

Direct usage of supportedOperation on rdf:Property without elevating it to the Link SHOULD NOT be implemented as clients +may not discover such a construct correctly.

+

There are rare situations when some supported operations once announced in the +API documentation should be retracted, i.e. to reflect current state of the +application or current user capabilities (or lack of them). It is doable +with the retractedOperation predicate that can be added to the reasorce +the same way as the operation is. By default all operations are available +without limits and it is up for the server to change that, and for the client +to discover any discrepancies compared against the API documentation in the runtime. +Yet server may want to inform the client that at the very moment an operation is either Unavailable or Unauthorized with a reason predicate. +The latter MAY be used to notify client that the user used to invoke +the request that provides operation availability information is currently +not authorized for that very operation to be invoked. The former on the other hand +MAY be used to inform that the operation is currently forbidden and client +SHOULD NOT invoke it. Server MAY also provide more custom reasons for which +the operation is not available but it SHOULD provide at least one of the +_Hydra_ built in reasons.

+

The retractedOperation MUST NOT be used in context of the ApiDocumentation. +The retractedOperation predicate also MUST take precedence over both operation and supportedOperation declaration and overrides them. +The operation that comes with retractedOperation predicate SHOULD be identified +using any of the below enlisted methods:

+ +
+ +
EXAMPLE: Retracting operations - declaration of supported operations
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/#comments",    "@type": "Link",    "supportedOperation": [        {            "@type": "Operation",            "method": "POST",            "expects": "http://api.example.com/doc/#Upload"        },        {            "@type": "Operation",            "method": "POST",            "expects": "http://api.example.com/doc/#Comment"        }    ]}
+
+
+ +
EXAMPLE: Retracting operations - matching
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/",    "@type": "Collection",    "retractedOperation": [        {            "@type": "Operation",            "method": "POST",            "expects": "http://api.example.com/doc/#Upload",            "reason": "Unavailable"        }    ]}
+
+

In the example above the operation that expects an uploaded file became Unavailable, while the one expecting a comment remains available as +the expects predicate does not match any supported operations. +It is still recommended to mark operations being subject for further +restrictions with an Iri as from the client perspective this may be +easier to implement simple literal Iri comparison rather than to compare +graphs of objects.

+

Note: These are the simple example scenarios and possible usages are not +limited to those described above.

+

Due to the fact an ApiDocumentation as all other resources may fail +at runtime, it is important to take countermeasures. A simple strategy +to try to recover from such a situation would be to reload +the ApiDocumentation and redo all pre-computations that were +based on the ApiDocumentation (or at least those that lead +to the current failure). Another, simpler approach would require +an application to show an error message with option to return +to a previous or home screen.

+

Hydra also allows enriching both ApiDocumentation and +hypermedia controls with human-readable descriptions by applying title and description (as shown in the examples above). +The former states a name of such a decorated element that could +be displayed as a label. The latter provides its description +to be presented i.e. as a hint.

+

Aforementioned title and description SHOULD take precedence +over standard rdfs:label and rdfs:comment.

+

There is one more feature related to how Linked Data works. Consider the +example below written in turtle syntax:

+
+ +
EXAMPLE: RDF as a graph
+
# An example API documentation itself with all the standard bits@base <http://some.app/> .@prefix api: <http://some.api/> .@prefix ex: <http://ontology.example/> .@prefix hydra: <http://www.w3.org/ns/hydra/core> .@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .<api>  a hydra:ApiDocumentation ;  hydra:supportedClass api:ClassOne, api:ClassTwo .# Anything elseex:SomeType a rdfs:Class .
+
+

...and how it could be transformed with JSON-LD framing process:

+
+ +
EXAMPLE: RDF as a graph continued
+
{    "@context": { ... },    "@graph": [        {            "@id": "http://some.app/api",            "@type": "hydra:ApiDocumentation",            "hydra:supportedClass": [                {                    "@id": "api:ClassTwo"                },                {                    "@id": "api:ClassOne"                }            ]        }    ]}
+
+

As you can see, additional details about ex:SomeType went +missing, while this shouldn’t happen. The fact that the IRI mentioned +is an rdfs:Class may be meaningful for a correct interpretation +of the received payload and this is a sole reason of why a Client +SHOULD NOT disregard other parts of the payload that are not directly +related to the API documentation or other hypermedia controls.

+

4.3. Discovering a Hydra-powered Web API

+

The first step when trying to access a Web API is to find an entry +point. Typically, this is done by looking for a documentation on the +API publisher’s homepage. Hydra enables the API’s main entry point +to be discovered automatically if the API publisher marks his +responses with a special HTTP Link Header as defined in [RFC8288]. +A Hydra client would look for a Link Header with a relation type http://www.w3.org/ns/hydra/core#apiDocumentation (this is +the IRI identifying the apiDocumentation property).

+

In the following example, a Hydra client simply accesses the +homepage of an API publisher (http://www.example.com/) +to find the entry point of its API. A client may use an HTTP GET or +HEAD request. The difference between the two is that the former may +return a message-body in the response whereas the latter will not; +otherwise they are identical.

+
+ +
EXAMPLE: Discovering Hydra API documentation documents
+
HEAD / HTTP/1.1Host: www.example.com
+
HTTP/1.1 200 OK...Content-Type: text/html; charset=utf-8Link: <http://api.example.com/doc/>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"
+
+

The response in the example above contains an HTTP Link Header +pointing to http://api.example.com/doc/. Retrieving that resource, +the client would obtain a Hydra API documentation defining the API’s main entry point:

+
+ +
EXAMPLE: Retrieving a Hydra API documentation to obtain the main entry point
+
GET /doc/ HTTP/1.1Host: api.example.comAccept: application/ld+json
+
HTTP/1.1 200 OK...Content-Type: application/ld+json{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/",    "title": "The example.com API",    "entrypoint": "http://api.example.com/",    ...}
+
+

Note: Please note that in some cases the entry point will already be +known to the client. Thus, the discovery of the API documentation +using HTTP Link Headers may not be necessary as the concepts +used in responses from the API will dereference to their documentation.

+

In another scenario the ApiDocumentation would be discovered from +a bookmarked resource’s representation. +The API implementation SHOULD emit the HTTP Link header on every API response, making the ApiDocumentation (and entry +points it defined) discoverable all the time.

+
+ +
EXAMPLE: Retrieving a Hydra API documentation from another API response
+
GET /api/items HTTP/1.1Host: api.example.comAccept: application/ld+json
+
HTTP/1.1 200 OK...Content-Type: application/ld+jsonLink: <http://api.example.com/doc/>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/items",    "title": "Items collection",    ...}
+
+

4.4. Api versions

+

It is common to provide a separate API address after a breaking changes +update. This prevents current clients not to get broken as these may not +support these changes.

+

With hypermedia provided in each response payload, it may be unnecessary +to provide such an alternative API. This is due to fact the client follows +what the server provides and with proper margin for errors implemented +within that client, even breaking changes can be published on the fly.

+

Still, Hydra does neither have any special support for API versions, nor +prevents them. It’s fully an implementers decision on if and how +to provide the API features.

+

5. Advanced Concepts

+

5.1. Collections

+

In many situations, it makes sense to expose resources that reference +a set of somehow related resources. Results of a search query or +entries of an address book are just two examples. To simplify such +use cases, Hydra defines the two classes Collection and PartialCollectionView.

+

A Collection can be used to reference a set of resources +as follows:

+
+ +
EXAMPLE: Referencing related resources using a Hydra Collection
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/an-issue/comments",    "@type": "Collection",    "totalItems": 4980,    "member" : [        {            "@id": "/comments/429"        },        {            "@id": "/comments/781",            "title": "Properties may be embedded directly in the collection"        },        ...    ]}
+
+

As shown in the example above, member items can either consist of +solely a link or also include some properties. In some cases embedding +member properties directly in the collection is beneficial as it may +reduce the number of HTTP requests necessary to get enough information +to process the result.

+

Since collections may become very large, Web APIs often chose to +split a collection into multiple pages. In Hydra, that can be achieved +with a PartialCollectionView. It describes a specific +view on the collection which represents only a subset of the collection’s +members. A PartialCollectionView may contain links to the first, next, previous, and last PartialCollectionView which allows a client to find all members +of a Collection.

+
+ +
EXAMPLE: A Hydra PartialCollectionView splits a collection into multiple views
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/an-issue/comments",    "@type": "Collection",    "totalItems": 4980,    "member": [        // "... a subset of the members of the Collection ..."    ],    "view": {        "@id": "http://api.example.com/an-issue/comments?page=3",        "@type": "PartialCollectionView",        "first": "/an-issue/comments?page=1",        "previous": "/an-issue/comments?page=2",        "next": "/an-issue/comments?page=4",        "last": "/an-issue/comments?page=498"    }}
+
+

Note: It is worth to mention that all those links are optional, +and it is up to server whether to provide these links or not.

+

5.2. Member assertions

+

A memberAssertion (formerly manages) is a way to declare additional, +implicit statements about members of a collection. +Statements which may otherwise be missing from the respective member +resources inlined in a collection’s representation.

+
+ +
EXAMPLE: Member assertion describes relation with another resource
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/an-issue/comments",    "@type": "Collection",    "memberAssertion": {        "subject": "http://api.example.com/an-issue",        "property": "http://api.example.com/vocab#comment"    },    "member": [        {            "@id": "/comments/429"        }    ]}
+
+

In the above example, adding a memberAssertion node to the collection +instructs the client that every member of this collection is linked +to the subject by the property. It could be written as a SPARQL +triple pattern below, where ?m would be substituted by each member +of the collection.

+
<http://api.example.com/an-issue> <http://api.example.com/vocab#comment> ?m
+

A memberAssertion MUST use two and only two of the subject, property and object predicates. The memberAssertion predicate +MAY have more than one such blocks, each expressing different relations +between the collection members and other resources.

+

Note: It’s important to point out that the subject, property and object predicates are defined within the Hydra namespace +and are not rdfs terms.

+

It is also possible to use memberAssertion predicate on the +API documentation level, by attaching this predicate to subclasses +of the Collection, like in the example below. Clients would +understand that all members of collections which are instances +of api:UserCollections would in fact have rdf:type api:User.

+
+ +
EXAMPLE: Member assertion block describes strongly typed collection
+
{    "@context": [        "http://www.w3.org/ns/hydra/context.jsonld",        { "api": "http://api.example.com/api/documentation#" }    ],    "@id": "http://api.example.com/api/documentation",    "@type": "ApiDocumentation",    "supportedClass": ["api:User", "api:UserCollection"],    "api:UserCollection": {        "subClassOf": "Collection",        "memberAssertion": {            "property": "rdf:type",            "object": "api:User"        },    }}
+
+

It is worth to mention that a strongly typed collection instance can have +its own member assertions. In such a scenario, both API documentation level and instance +level assertions should be combined as neither makes the other obsolete.

+

More complex scenario would involve a class hierarchy, in which each class +can carry additional member assertions compared to it’s base class. +To discover all available member assertion blocks client SHOULD traverse +whole class hierarchy to gather all the member assertions. In order +to take such a burden from clients it is strongly recommended providing +all member assertion blocks to be provided on each class level including +its base class blocks, so the client does not have to perform +this traversing behavior.

+ +

Sometimes, it is impossible for a server to construct a URL because +the URL depends on information only known by the client. A typical +use case are URLs which enable a client to query the server. In such +a case, the server cannot construct the URL because it does not know +the query the client is interested in. What the server can do however, +is to give the client a template to construct such a URL at runtime. +In Hydra, the IriTemplate class is used to do so.

+

An IriTemplate consists of a template literal and a set +of mappings. Each IriTemplateMapping maps a variable used in the template to a property and may +optionally specify whether that variable is required or not. +The syntax of the template literal is specified by its datatype and +defaults to the [RFC6570] URI Template syntax, which can be +explicitly indicated by Rfc6570Template.

+
+ +
EXAMPLE: Description of an IRI Template
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@type": "IriTemplate",    "template": "http://api.example.com/issues{?q}",    "variableRepresentation": "hydra:BasicRepresentation",    "mapping": [        {            "@type": "IriTemplateMapping",            "variable": "q",            "property": "hydra:freetextQuery",            "required": true        }    ]}
+
+

The example above maps the variable q to Hydra’s freetextQuery property and marks it as required. As its name suggests, +the freetextQuery property can be used for free text queries.

+

A template syntax only details how to fill out simple string values, +but not how to derive such string values from typed values, +language-tagged strings, or IRIs. Hydra addresses this by +specifying how such values are to be serialized as strings. The +serialization of an IriTemplate’s variables can be described +by setting the variableRepresentation property to BasicRepresentation or ExplicitRepresentation. The BasicRepresentation represents values by their lexical form. It +omits type and language information and does not differentiate between +IRIs and literals. The ExplicitRepresentation, on the other +hand, includes type and language information and differentiates +between IRIs and literals by serializing values as follows:

+
    +
  • +

    IRIs are represented as-is

    +
  • +

    literals, i.e., (typed) values and language-tagged strings are +represented by their lexical form, surrounded by a single pair of +doubles quotes (")

    +
  • +

    if a literal has a language, a single @ symbol is +appended after the double-quoted lexical form, followed by a +non-empty [BCP47] language code

    +
  • +

    if a literal has a type, two caret symbols (^^) are appended +after the double-quoted literal, followed by the full datatype IRI

    +
+

In both representations characters MUST NOT be escaped. In case the +representation format is not explicitly described, clients SHOULD +use the BasicRepresentation by default.

+

Warning: Although ExplicitRepresentation use of @ and ^^ is similar, it is not the same as the [Turtle] representation for literals. Turtle literals require escaping +of special characters, surround datatype IRIs with angular brackets +(< and >), and also allow single quotes (') to indicate literals. +The ExplicitRepresentation values must not be escaped, +IRIs must not be surrounded by any character, and only double quotes +can indicate literals.

+

Below are some example values serialized in the different +representations as well as the result of expanding the IRI template http://example.com/find/{value} with the respective value.

+ +

The example Description of an IRI Template that was already mentioned +uses a variableRepresentation on the whole IriTemplate, but +each mapped variable represented as an IriTemplateMapping can have +its own variableRepresentation declaration. It MUST override +the declaration from the IriTemplate level for that very IriTemplateMapping as it takes precedence. The example below +depicts such a situation:

+
+ +
EXAMPLE: Variable level representation
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@type": "IriTemplate",    "template": "http://api.example.com/issues{?q,category}",    "variableRepresentation": "ExplicitRepresentation",    "mapping": [        {            "@type": "IriTemplateMapping",            "variable": "q",            "property": "hydra:freetextQuery",            "variableRepresentation": "BasicRepresentation",            "required": true        },        {            "@type": "IriTemplateMapping",            "variable": "category",            "property": "schema:category"        }    ]}
+
+

In this example, the variable category will be serialised using the explicit representation, +derived from the template itself. The variable q on the other hand will override that +to use basic representation.

+

Similar to how Hydra’s Link class allows the definition of +properties that represent hyperlinks as described in § 4.1 Adding Affordances to Representations, the TemplatedLink class +allows the definition of properties whose value are IRI templates. +Hydra predefines one such property, namely the search property which +can be used to document available search interfaces.

+
+ +
EXAMPLE: The definition of Hydra’s search property (extract)
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "hydra:search",    "@type": "hydra:TemplatedLink"}
+
+

IRI expansion should be performed with respect to the specification +behind the IRI template type ([RFC6570] by default), and the product +of this process SHOULD be an IRI. When the produced IRI is relative, +the client SHOULD stick to [RFC3986] sections 5.1.3 and 5.1.4 +to be compatible with most RDF serializations that support relative IRIs. +Still, it may be preferred to use another base URI for the expansion +process, which makes the resolveRelativeUsing term useful. It allows +to switch the IRI template expansion algorithm, so the base URI +is established using current link context, which is a subject +of the relation pointing to an IriTemplate instance. In case +that subject is a relative URI, default behavior SHOULD be used as fallback.

+

The example below allows to make the product of an IRI template +expansion relative to the http://api.example.com/an-issue/ resource +by using it as its base URI, which further enables the some:operation to be moved to i.e. API documentation level rather +to inline it.

+
+ +
EXAMPLE: Custom base Uri resolution for an Iri template
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/an-issue/",    "@type": "Collection",    "some:operation": {        "@type": "IriTemplate",        "template": "{id}",        "resolveRelativeUsing": "LinkContext",        "variable": "id",        "mapping": {...}    }}
+
+

When constructed, the IRI would effectively become similar +to http://api.example.com/an-issue/1234, with the relative part {id} appended to the link context URL.

+

5.4. IRI template operations

+

There are circumstances in which client would like to perform an operation +not knowing the final IRI of the resource to be called. This case +is especially in force when working with collections - client may want +to add a new collection member, or it may need to provide more details +while searching with other protocol’s method (i.e. POST instead of GET +in case of an HTTP).

+

This is achievable by attaching a supportedOperation to the property +that connects a subject of that relation with its IriTemplate as described in the previous part of this document. Please note that +client is still allowed to use the defined link and custom operation’s +method is optional.

+
+ +
EXAMPLE: Operation with IRI template
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api-documentation",    "@type": "ApiDocumentation",    "api:search": {        "@type": "Link",        "rdfs:subClassOf": "search",        "supportedOperation": {            "@type": "SupportedOperation",            "method": "POST"        }    }}
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/issues",    "@type": "Collection",    "api:search": {        "@type": "IriTemplate",        "template": "/issues?search={name}",        "mapping": { ... }    }}
+
+

The example above allows client to either invoke an HTTP GET or POST +call on http://api.example.com/issues?search=search_string resource.

+
+ +
EXAMPLE: Operation with IRI template without link option
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api-documentation",    "@type": "ApiDocumentation",    "api:find": {        "supportedOperation": {            "@type": "SupportedOperation",            "method": "POST"        }    }}
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/issues",    "@type": "Collection",    "api:search": {        "@type": "IriTemplate",        "template": "/issues?find={name}",        "mapping": {...}    }}
+
+

The example above allows client to invoke only an HTTP POST +call on http://api.example.com/issues?find=search_string resource as +the described relation of find is not a Link.

+

5.5. Supported property data source

+

There are circumstances in which an API would like to inform a client on +when to obtain values to feed data structures with details. Having all the +necessary components like supported property, collection and IRI templates, +it is possible to drive the client and direct it with links and operations +to the data sources.

+

It is doable by attaching either a collection or search predicate to instance of supportedProperty or to property. +In such case client SHOULD assume that the relation leads to +the collection of values compatible with the supported property’s range +and can be used to feed data structures with the supported property. +It is recommended (but not mandatory) to use freetextQuery variable mapping in case of the search predicate as it has a +well-defined semantics and takes the burden of interpretation from +the client.

+

While it is possible to provide such links in both API documentation and within the received payload, +client SHOULD use the latter link first if applicable. +This is due to the fact the server may want to put additional +context to narrow the collection of viable values. Redefinition does not +make the more general one obsolete though and can be used as a fallback.

+
+ +
EXAMPLE: Supported property data source
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@type": "ApiDocumentation",    "supportedClass": {        "@id": "schema:Event",        "supportedProperty": {            "property": "schema:actor",            "search": {                "template": "/api/user{?search}",                "mapping": {                    "variable": "search",                    "property": "freetextQuery"                }            }        }    },    ...}
+
+

The example above instructs a client that every resource of type schema:Event can have a relation of schema:actor, the objects +of which the client can obtain using the search link provided.

+

5.6. Description of HTTP Status Codes and Errors

+

In case of the HTTP protocol, status codes have well-defined semantics +and can be used to signal the outcome of an operation. Unfortunately, +however, HTTP status codes by themselves are often not specific enough, +making it difficult to understand the real cause of an error. For instance, +a 429 Too Many Requests response is rarely informative enough by itself. +To address this issue, Hydra defines a Status class which allows +additional information to be associated with the HTTP status code.

+
+ +
EXAMPLE: Associating additional information to an HTTP status code
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@type": "Status",    "statusCode": 429,    "title": "Too Many Requests",    "description": "A maximum of 500 requests per hour and user is allowed.",    ...}
+
+

An ApiDocumentation or an Operation may document the +status codes that might be returned by the server using the possibleStatus property as described in § 4.2 Documenting a Web API. +This allows a developer to understand what to expect when invoking +an operation. It has, however, not to be considered as an extensive +list of all potentially returned status codes; it is merely a hint. +Developers should expect to encounter other HTTP status codes as well.

+

A server may also return a Status directly in a response. +When doing so, it often makes sense to subclass the Status to make its semantics more explicit. Hydra defines just one such subclass, +namely the Error class. This provides an extensible framework +to communicate error details to a client.

+

Furthermore, a Status or Error returned by the server can also +be given an identifier. When dereferenced, the Error resource +can provide more detailed information or possible ways to resolve +the problem, if applicable.

+

Finally, the server SHOULD provide error descriptions using an [RFC9457] standard by using an application/problem+json response. When doing so, +the server also MUST provide an additional header pointing to either +the built-in Hydra http://www.w3.org/ns/hydra/error context +or any JSON-LD context that maps the terms type, title, detail, status and instance the same way as the standard one.

+
+ +
EXAMPLE: RFC-7807 compatible error description
+
HTTP/1.1 400 Bad RequestContent-Type: application/problem+jsonLink: <http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#context"{    "type": "https://example.com/probs/out-of-credit",    "@type": "http://www.w3.org/ns/hydra/core#Error",    "title": "You do not have enough credit.",    "detail": "Your current balance is 30, but that costs 50.",    "instance": "/account/12345/msgs/abc",    "balance": 30,    "accounts": [        "/account/12345",        "/account/67890"    ]}
+
+

While the built-in context makes the response fully compatible with +the mentioned specification, properties not defined in the standard +Hydra’s error context won’t be visible for Hydra aware processors. +To overcome this, it is possible to declare a custom context pointed +the same way, that would combine standard Hydra’s standard error context +and an additional JSON-LD context with either the @vocab or custom +property mappings telling the processor on how to interpret those custom +error properties.

+

Resources provided may have an additional hint pointing to an Error type like in the example above, but it is not mandatory to do so as all +resources described with application/problem+json are considered Error.

+

Note: It is worth to mention that it may happen (i.e. due to proxy behavior) +the value of the status property will differ to the one received +from the protocol layer.

+
+ +
EXAMPLE: Non RFC-7807 compliant error description using raw Hydra JSON-LD representation
+
HTTP/1.1 400 Bad RequestContent-Type: application/ld+json{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@type": "Error",    "@id": "http://api.example.com/error-details/1234",    "title": "An error occurred",    "description": "Typically, a specialization of this class is used in practice.",    ...}
+
+

5.7. Client initiated pagination

+

There are situations when a client would like to provide a specific +collection limitations, i.e. by providing query-language like member +offset and limit, or some specific page index and number of members +per page. This is doable with offset/limit or pageIndex/limit predicates.

+

With those, it is possible to bind a template variables mapped +with externally obtained values (i.e. user interaction) the same way +as with other mappings.

+

While the predicates enlisted above accepts non-negative integer +numbers, there is also a possibility of providing a custom page +reference expressed via pageReference predicate. It is possible +to provide a custom page identifier (i.e. a GUID or a letter) +instead of a number.

+

5.8. Extensions

+

While Hydra Core Vocabulary allows addressing many usage scenarios, +not every aspect of API behavior can be covered. This +applies especially to querying, resource projection or data structure +description. This is due to fact that Hydra is meant to be as light +as possible forcing to drop some features out of its scope.

+

That is why there is a possibility of hinting a client on what kind +of extensions may be found or used in the received payloads. +After discovering an extension predicate in the API documentation, client can assume additional +details are available described with complementary vocabularies.

+
+ +
EXAMPLE: Hydra client extension usage
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/",    "@type": "ApiDocumentation",    "title": "The name of the API",    "description": "A short description of the API",    "entrypoint": "URL of the API’s main entry point",    "extension": "http://www.w3.org/ns/shacl#",    ...}
+
+

It is up to the used vocabulary to define how these additional details +should be interpreted. In case client does not recognize these extensions, +additional details should be ignored and base Hydra interpretation +should be in force.

+

Server SHOULD NOT use extensions to add statements that are in +contradiction to base Hydra interpretation, so the client is not confused. +Server SHOULD also keep multiple extensions describing adequate +knowledge in line regarding their description (i.e. data structure +descriptions in various vocabularies should not cause differences).

+

Client can express its preferences through the Prefer HTTP header +by pointing the preferred extensions via IRIs as on the example below. +The client SHOULD use the Prefer HTTP header [RFC7240] with +the hydra.extension preference as an iri attribute having +the IRI of the extension as value to hint the server about the extension +it supports. Multiple preferences can be expressed by providing multiple Prefer header values.

+
+ +
EXAMPLE: Hydra client extension preference
+
GET http://api.example.com/api/people HTTP/1.1Prefer: hydra.extension; iri="http://schema.org/"
+
+

Server MUST implement Prefer header handling according to +the [RFC7240] and implementers should proceed with caution.

+

6. Classes

+

6.1. hydra:ApiDocumentation

+ + + + + +
Name: + ApiDocumentation +
Summary: + The Hydra API documentation class. +
Sub-class of: + Resource +
+
+ +
EXAMPLE: hydra:ApiDescription
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

6.2. hydra:BaseUriSource

+ + + + + + +
Name: + BaseUriSource +
Summary: + Provides a base abstract for base Uri source + for Iri template resolution. +
Sub-class of: + Resource +
Named instances: + Rfc3986, LinkContext +
+

6.3. hydra:Class

+ + + + + +
Name: + Class +
Summary: + The class of Hydra classes. +
Sub-class of: + rdfs:Class +
+

6.4. hydra:Collection

+ + + + + +
Name: + Collection +
Summary: + A collection holding references to a number of related resources. +
Sub-class of: + Resource +
+
+ +
EXAMPLE: hydra:Collection
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

6.5. hydra:Error

+ + + + + +
Name: + Error +
Summary: + A runtime error, used to report information beyond the returned + status code. +
Sub-class of: + Status +
+
+ +
EXAMPLE: hydra:Error
+
HTTP/1.1 400 Bad requestContent-Type: application/problem+jsonLink: <http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#context"{"type": "https://api.example.com/vocab#NullReferenceException","@type": "http://www.w3.org/ns/hydra/core#Error","title": "The request cannot be processed.","detail": "Provided value cannot be 'null'.","instance": "http://api.example.com/api/posts","status": 404}
+
+

6.6. hydra:HeaderSpecification

+ + + + + +
Name: + HeaderSpecification +
Summary: + Specifies a possible either expected or returned header values. +
Sub-class of: + Resource +
+
+ +
EXAMPLE: hydra:HeaderSpecification
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "@type": "hydra:HeaderSpecification",                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "@type": "hydra:HeaderSpecification",                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

6.7. hydra:IriTemplate

+ + + + +
Name: + IriTemplate +
Summary: + The class of IRI templates. +
+
+ +
EXAMPLE: hydra:IriTemplate
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "@type": "hydra:IriTemplate",        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

6.8. hydra:IriTemplateMapping

+ + + + +
Name: + IriTemplateMapping +
Summary: + A mapping from an IRI template variable to a property. +
+
+ +
EXAMPLE: hydra:IriTemplateMapping
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "@type": "hydra:IriTemplate",        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "@type": "hydra:IriTemplateMapping",                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "@type": "hydra:IriTemplateMapping",                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "@type": "hydra:IriTemplateMapping",                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+ + + + + + +
Name: + Link +
Summary: + The class of properties representing links. +
Sub-class of: + Resource, rdf:Property +
+
+ +
EXAMPLE: hydra:Link
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@graph": [        {            "@id": "http://api.example.com/api?documentation",            "@type": "ApiDocumentation",            "entrypoint": "http://api.example.com/api"        },        {            "@id": "http://api.example.com/vocab#comments",            "@type": "hydra:Link"        }    }}
+
+

6.10. hydra:Operation

+ + + + +
Name: + Operation +
Summary: + An operation. +
+
+ +
EXAMPLE: hydra:Operation
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts/1",    "operation": [        {            "@type": "Operation",            "method": "DELETE",            "title": "Remove",            "description": "Removes post no. 1"        }    ]}
+
+

6.11. hydra:PartialCollectionView

+ + + + + +
Name: + PartialCollectionView +
Summary: + A PartialCollectionView describes a partial view of a Collection. + Multiple PartialCollectionViews can be connected with + the next/previous properties to allow a client to retrieve + all members of the collection. +
Sub-class of: + Resource +
+
+ +
EXAMPLE: hydra:PartialCollectionView
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@type": "PartialCollectionView",        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

6.12. hydra:Resource

+ + + + +
Name: + Resource +
Summary: + The class of dereferenceable resources by means a client + can attempt to dereference; however, the received responses + should still be verified. +
+

6.13. hydra:RetractedOperationSpecification

+ + + + +
Name: + RetractedOperationSpecification +
Summary: + Describes which and why an operation is retracted. +
+
+ +
EXAMPLE: hydra:Status
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/",    "@type": "Collection",    "retractedOperation": [        {            "@type": "Operation",            "method": "POST",            "expects": "http://api.example.com/doc/#Upload",            "reason": "Unavailable"        }    ]}
+
+

6.14. hydra:Status

+ + + + +
Name: + Status +
Summary: + Additional information about a status code that might be returned. +
+
+ +
EXAMPLE: hydra:Status
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts/1",    "operation": [        {            "method": "DELETE",            "title": "Remove",            "description": "Removes post no. 1",            "possibleStatus": [                {                    "@type": "Status",                    "statusCode": 303                }            ]        }    ]}
+
+

6.15. hydra:SupportedProperty

+ + + + +
Name: + SupportedProperty +
Summary: + A property known to be supported by a Hydra class. +
+
+ +
EXAMPLE: hydra:SupportedProperty
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "@type": "SupportedProperty",                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+ + + + + + +
Name: + TemplatedLink +
Summary: + A templated link. +
Sub-class of: + Resource, rdf:Property +
+
+ +
EXAMPLE: hydra:TemplatedLink
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@graph": [        {            "@id": "http://api.example.com/api?documentation",            "@type": "ApiDocumentation",            "entrypoint": "http://api.example.com/api"        },        {            "@id": "http://api.example.com/vocab#comments",            "@type": "hydra:TemplatedLink"        }    }}
+
+

6.17. hydra:VariableRepresentation

+ + + + + +
Name: + VariableRepresentation +
Summary: + A representation specifies how to serialize variable + values into strings. +
Named instances: + BasicRepresentation, ExplicitRepresentation +
+

6.18. hydra:UnavailabilityReason

+ + + + + +
Name: + UnavailabilityReason +
Summary: + Provides reasons why the operation cannot be invoked. +
Named instances: + Unavailable, Unauthorized +
+

7. Properties

+

7.1. hydra:apiDocumentation

+ + + + + + +
Name: + apiDocumentation‎ +
Summary: + A link to the API documentation. +
Domain: + Resource +
Range: + ApiDocumentation +
+
+ +
EXAMPLE: hydra:apiDocumentation
+
HTTP/1.1 200 OKContent-Type: text/html; charset=utf-8Link: <http://api.example.com/doc/>; rel="http://www.w3.org/ns/hydra/core#apiDocumentation"
+
+

7.2. hydra:closedSet

+ + + + + + + +
Name: + closedSet +
Summary: + Determines whether the provided set of header values + is closed or not. +
Max cardinality: + 1 +
Domain: + HeaderSpecification +
Range: + xsd:boolean +
+
+ +
EXAMPLE: hydra:closedSet
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.3. hydra:collection

+ + + + + +
Name: + collection‎ +
Summary: + Collections somehow related to this resource. +
Range: + Collection +
+
+ +
EXAMPLE: hydra:collection
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api",    "collection": [        {            "@id": "http://api.example.com/api/posts",            "@type": "Collection",            "memberAssertion": [                {                    "property": "rdf:type",                    "object": "http://api.example.com/vocab#Post"                }            ]        }    ]}
+
+

7.4. hydra:description

+ + + + + + + +
Name: + description +
Summary: + A description. +
Max cardinality: + 1 +
Domain includes: + ApiDocumentation, Status, Class, SupportedProperty, Operation, Link, TemplatedLink +
Range: + xsd:string +
+
+ +
EXAMPLE: hydra:description
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.5. hydra:entrypoint

+ + + + + + + +
Name: + entrypoint +
Summary: + A link to main entry point of the Web API. +
Min cardinality: + 1 +
Domain: + ApiDocumentation +
Range: + Resource +
+
+ +
EXAMPLE: hydra:entrypoint
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.6. hydra:expects

+ + + + + + +
Name: + expects +
Summary: + The information expected by the Web API. +
Domain includes: + Operation, RetractedOperationSpecification +
Range includes: + rdfs:Resource, Resource, rdfs:Class, Class +
+
+ +
EXAMPLE: hydra:expects
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.7. hydra:expectsHeader

+ + + + + + +
Name: + expectsHeader +
Summary: + Specification of the header expected by the operation. +
Domain: + Operation +
Range includes: + xsd:string, HeaderSpecification +
+
+ +
EXAMPLE: hydra:expectsHeader
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.8. hydra:extension

+ + + + + +
Name: + extension +
Summary: + Hint on what kind of extensions are in use. +
Domain: + ApiDocumentation +
+
+ +
EXAMPLE: hydra:extension
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.9. hydra:first

+ + + + + + + +
Name: + first +
Summary: + The first resource of an interlinked set of resources. +
Max cardinality: + 1 +
Domain: + Resource +
Range: + Resource +
+
+ +
EXAMPLE: hydra:first
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.10. hydra:freetextQuery

+ + + + + + +
Name: + freetextQuery +
Summary: + A property representing a freetext query. +
Domain: + Resource +
Range: + xsd:string +
+
+ +
EXAMPLE: hydra:freetextQuery
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.11. hydra:headerName

+ + + + + + + + +
Name: + headerName +
Summary: + Name of the header. +
Min cardinality: + 1 +
Max cardinality: + 1 +
Domain: + HeaderSpecification +
Range: + xsd:string +
+
+ +
EXAMPLE: hydra:headerName
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.12. hydra:last

+ + + + + + + +
Name: + last +
Summary: + The last resource of an interlinked set of resources. +
Max cardinality: + 1 +
Domain: + Resource +
Range: + Resource +
+
+ +
EXAMPLE: hydra:last
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.13. hydra:limit

+ + + + + + +
Name: + limit +
Summary: + Instructs to limit set only to N elements. +
Max cardinality: + 1 +
Range: + xsd:nonNegativeInteger +
+
+ +
EXAMPLE: hydra:limit
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.14. hydra:mapping

+ + + + + + + +
Name: + mapping +
Summary: + A variable-to-property mapping of the IRI template. +
Min cardinality: + 1 +
Domain: + IriTemplate +
Range: + IriTemplateMapping +
+
+ +
EXAMPLE: hydra:mapping
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.15. hydra:member

+ + + + + +
Name: + member +
Summary: + A member of the collection. +
Domain: + Collection +
+
+ +
EXAMPLE: hydra:member
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.16. hydra:memberAssertion

+ + + + + + +
Name: + memberAssertion +
Summary: + Semantics of each member provided by the collection. +
Domain includes: + Collection, Class +
Range: + +
+
+ +
EXAMPLE: hydra:memberAssertion in context of strongly typed collections
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api",    "collection": [        {            "@id": "http://api.example.com/api/posts",            "@type": "Collection",            "memberAssertion": [                {                    "property": "rdf:type",                    "object": "http://api.example.com/vocab#Post"                }            ]        }    ]}
+
+
+ +
EXAMPLE: hydra:memberAssertion in context of building relation to another resource
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts/1/comments",    "@type": "Collection",    "memberAssertion": [        {            "subject": "http://api.example.com/api/posts/1",            "property": "http://api.example.com/vocab#comment"        }    ]}
+
+
+ +
EXAMPLE: hydra:memberAssertion in context of hydra:ApiDocumentation
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@graph": [        {            "@id": "http://api.example.com/api?documentation",            "@type": "ApiDocumentation",            "entrypoint": "http://api.example.com/api"        },        {            "@id": "http://api.example.com/vocab#comments",            "@type": "hydra:Link",            "supportedOperation": [                {                    "method": "GET",                    "returns": {                        "subClassOf": "hydra:Collection",                        "memberAssertion": {                            "property": "rdf:type",                            "object": "http://api.example.com/vocab#Comment"                        }                    }                }            ]        }    }}
+
+

7.17. hydra:method

+ + + + + + +
Name: + method +
Summary: + The protocol method. +
Domain includes: + Operation, RetractedOperationSpecification +
Range: + xsd:string +
+
+ +
EXAMPLE: hydra:method
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.18. hydra:next

+ + + + + + + +
Name: + next +
Summary: + The resource following the current instance + in an interlinked set of resources. +
Max cardinality: + 1 +
Domain: + Resource +
Range: + Resource +
+
+ +
EXAMPLE: hydra:next
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.19. hydra:object

+ + + + + +
Name: + object +
Summary: + The object. +
Min cardinality: + 1 +
+
+ +
EXAMPLE: hydra:object
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api",    "collection": [        {            "@id": "http://api.example.com/api/posts",            "@type": "Collection",            "memberAssertion": [                {                    "property": "rdf:type",                    "object": "http://api.example.com/vocab#Post"                }            ]        }    ]}
+
+

7.20. hydra:offset

+ + + + + + +
Name: + offset +
Summary: + Instructs to skip N elements of the set. +
Max cardinality: + 1 +
Range: + xsd:nonNegativeInteger +
+
+ +
EXAMPLE: hydra:offset
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.21. hydra:operation

+ + + + + + +
Name: + operation‎ +
Summary: + An operation supported by the Hydra resource. +
Domain: + Resource +
Range: + Operation +
+
+ +
EXAMPLE: hydra:operation
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts/1",    "operation": [        {            "method": "DELETE",            "title": "Remove",            "description": "Removes post no. 1"        }    ]}
+
+

7.22. hydra:pageIndex

+ + + + + + +
Name: + pageIndex +
Summary: + Instructs to provide a specific page of the collection + at a given index. +
Max cardinality: + 1 +
Range: + xsd:nonNegativeInteger +
+
+ +
EXAMPLE: hydra:pageIndex
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,page,limit}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "page",                "property": "hydra:pageIndex",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.23. hydra:pageReference

+ + + + + +
Name: + pageReference +
Summary: + Instructs to provide a specific page reference + of the collection. +
Max cardinality: + 1 +
+
+ +
EXAMPLE: hydra:pageReference
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,partOfDay,limit}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "partOfDay",                "property": "hydra:pageReference",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.24. hydra:possibleStatus

+ + + + + + +
Name: + possibleStatus +
Summary: + A status that might be returned by the Web API (other + statuses should be expected and properly handled as well). +
Domain includes: + ApiDocumentation, Operation, RetractedOperationSpecification +
Range: + Status +
+
+ +
EXAMPLE: hydra:possibleStatus
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts/1",    "operation": [        {            "method": "DELETE",            "title": "Remove",            "description": "Removes post no. 1",            "possibleStatus": [                {                    "@type": "Status",                    "statusCode": 303                }            ]        }    ]}
+
+

7.25. hydra:possibleValue

+ + + + + + + +
Name: + possibleValue +
Summary: + Possible value of the header. +
Min cardinality: + 1 +
Domain: + HeaderSpecification +
Range: + xsd:string +
+
+ +
EXAMPLE: hydra:possibleValue
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.26. hydra:previous

+ + + + + + + +
Name: + previous +
Summary: + The resource preceding the current instance + in an interlinked set of resources. +
Max cardinality: + 1 +
Domain: + Resource +
Range: + Resource +
+
+ +
EXAMPLE: hydra:previous
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.27. hydra:property

+ (only when used in context of memberAssertion) + + + + + + + +
Name: + property +
Summary: + A property. +
Min cardinality: + 1 +
Domain includes: + SupportedProperty, IriTemplateMapping +
Range: + rdf:Property +
+
+ +
EXAMPLE: hydra:property in context of hydra:SupportedProperty
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+
+ +
EXAMPLE: hydra:property in context of hydra:IriTemplateMapping
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+
+ +
EXAMPLE: hydra:property in context of strongly typed collections
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api",    "collection": [        {            "@id": "http://api.example.com/api/posts",            "@type": "Collection",            "memberAssertion": [                {                    "property": "rdf:type",                    "object": "http://api.example.com/vocab#Post"                }            ]        }    ]}
+
+

7.28. hydra:readable

+ + + + + + + +
Name: + readable +
Summary: + True if the client can retrieve the property’s value, + false otherwise. +
Max cardinality: + 1 +
Domain: + SupportedProperty +
Range: + xsd:boolean +
+
+ +
EXAMPLE: hydra:readable
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.29. hydra:reason

+ + + + + + + +
Name: + reason +
Summary: + Reason of why the operation is retracted. +
Max cardinality: + 1 +
Domain: + RetractedOperationSpecification +
Range: + UnavailabilityReason +
+
+ +
EXAMPLE: hydra:reason
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/",    "@type": "Collection",    "retractedOperation": [        {            "@type": "Operation",            "method": "POST",            "expects": "http://api.example.com/doc/#Upload",            "reason": "Unavailable"        }    ]}
+
+

7.30. hydra:retractedOperation

+ + + + + + +
Name: + retractedOperation +
Summary: + Retracts available operations. +
Domain: + Resource +
Range: + RetractedOperationSpecification +
+
+ +
EXAMPLE: hydra:retractedOperation
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/",    "@type": "Collection",    "retractedOperation": [        {            "@type": "Operation",            "method": "POST",            "expects": "http://api.example.com/doc/#Upload",            "reason": "Unavailable"        }    ]}
+
+

7.31. hydra:required

+ + + + + + + +
Name: + required +
Summary: + True if the property is required, false otherwise. +
Max cardinality: + 1 +
Domain includes: + SupportedProperty, IriTemplateMapping +
Range: + xsd:boolean +
+
+ +
EXAMPLE: hydra:required in context of hydra:SupportedProperty
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+
+ +
EXAMPLE: hydra:required in context of hydra:IriTemplateMapping
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.32. hydra:resolveRelativeUsing

+ + + + + +
Name: + resolveRelativeUsing +
Summary: + Instructs on how to resolve relative Uri created + by the Iri template resolution. +
Max cardinality: + 1 +
+
+ +
EXAMPLE: hydra:resolveRelativeUsing
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.33. hydra:returns

+ + + + + + +
Name: + returns +
Summary: + The information returned by the Web API on success. +
Domain includes: + Operation, RetractedOperationSpecification +
Range includes: + rdfs:Resource, Resource, rdfs:Class, Class +
+
+ +
EXAMPLE: hydra:returns
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.34. hydra:returnsHeader

+ + + + + + +
Name: + returnsHeader +
Summary: + Name of the header returned by the operation. +
Domain: + Operation +
Range includes: + xsd:string, HeaderSpecification +
+
+ +
EXAMPLE: hydra:returnsHeader
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+ + + + + + + +
Name: + search +
Summary: + A Iri template that can be used to query a collection. +
Domain: + Resource +
Range: + IriTemplate +
+
+ +
EXAMPLE: hydra:search
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.36. hydra:statusCode

+ + + + + + +
Name: + statusCode +
Summary: + The response status code. Please note it may happen this + value will be different to actual status code received. +
Domain: + Status +
Range: + xsd:integer +
+
+ +
EXAMPLE: hydra:statusCode in context of hydra:Error
+
HTTP/1.1 400 Bad requestContent-Type: application/problem+jsonLink: <http://www.w3.org/ns/hydra/error>; rel="http://www.w3.org/ns/json-ld#context"{    "type": "https://api.example.com/vocab#NullReferenceException",    "@type": "http://www.w3.org/ns/hydra/core#Error",    "title": "The request cannot be processed.",    "detail": "Provided value cannot be 'null'.",    "instance": "http://api.example.com/api/posts",    "status": 404}
+
+
+ +
EXAMPLE: hydra:statusCode in context of hydra:Status
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts/1",    "operation": [        {            "method": "DELETE",            "title": "Remove",            "description": "Removes post no. 1",            "possibleStatus": [                {                    "@type": "Status",                    "statusCode": 303                }            ]        }    ]}
+
+

7.37. hydra:subject

+ + + + + +
Name: + subject +
Summary: + The subject. +
Min cardinality: + 1 +
+
+ +
EXAMPLE: hydra:subject
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts/1/comments",    "@type": "Collection",    "memberAssertion": [        {            "subject": "http://api.example.com/api/posts/1",            "property": "http://api.example.com/vocab#comment"        }    ]}
+
+

7.38. hydra:supportedClass

+ + + + + + +
Name: + supportedClass +
Summary: + A class known to be supported by the Web API. +
Domain: + ApiDocumentation +
Range: + rdfs:Class +
+
+ +
EXAMPLE: hydra:supportedClass
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.39. hydra:supportedOperation

+ + + + + + +
Name: + supportedOperation +
Summary: + An operation supported by instances of the specific Hydra + class, or the target of the Hydra link, or Iri template. +
Domain includes: + rdfs:Class, Class, Link, TemplatedLink, SupportedProperty +
Range: + Operation +
+
+ +
EXAMPLE: hydra:supportedOperation in context of hydra:SupportedClass
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+
+ +
EXAMPLE: hydra:supportedOperation in context of hydra:TemplatedLink
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search}",        "resolveRelativeUsing": "hydra:Rfc3986",        "supportedOperation": {            "method": "POST"        },        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+
+ +
EXAMPLE: hydra:supportedOperation in context of hydra:Link
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@graph": [        {            "@id": "http://api.example.com/api/posts/1",            "http://api.example.com/vocab#comment":                "http://api.example.com/api/posts/1/comments"        },        {            "@id": "http://api.example.com/vocab#comment",            "@type": "hydra:Link",            "supportedOperation": {                "method": "GET",                "returns": "http://api.example.com/vocab#Comment            }        }    ]}
+
+

7.40. hydra:supportedProperty

+ + + + + + +
Name: + supportedProperty‎ +
Summary: + The properties known to be supported by a Hydra class. +
Domain: + rdfs:Class +
Range: + SupportedProperty +
+
+ +
EXAMPLE: hydra:supportedProperty
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.41. hydra:template

+ + + + + + + + +
Name: + template +
Summary: + A templated string with placeholders. The literal’s + datatype indicates the template syntax; if not specified, + hydra:Rfc6570Template is assumed. +
Min cardinality: + 1 +
Max cardinality: + 1 +
Domain: + IriTemplate +
Range: + Rfc6570Template +
+
+ +
EXAMPLE: hydra:template
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.42. hydra:title

+ + + + + + + +
Name: + title +
Summary: + A title, often used along with a description. +
Max cardinality: + 1 +
Domain includes: + ApiDocumentation, Status, Class, SupportedProperty, Operation, Link, TemplatedLink +
Range: + xsd:string +
+
+ +
EXAMPLE: hydra:title
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "title": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "title": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

7.43. hydra:totalItems

+ + + + + + + +
Name: + totalItems +
Summary: + The total number of items referenced by a collection. +
Max cardinality: + 1 +
Domain: + Collection +
Range: + xsd:integer +
+
+ +
EXAMPLE: hydra:totalItems
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.44. hydra:variable

+ + + + + + + + +
Name: + variable +
Summary: + An Iri template variable. +
Min cardinality: + 1 +
Max cardinality: + 1 +
Domain: + IriTemplateMapping +
Range: + xsd:string +
+
+ +
EXAMPLE: hydra:variable
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.45. hydra:variableRepresentation

+ + + + + + + +
Name: + variableRepresentation‎ +
Summary: + The representation format to use when expanding + the Iri template. +
Max cardinality: + 1 +
Domain includes: + IriTemplateMapping, IriTemplate +
Range: + VariableRepresentation +
+
+ +
EXAMPLE: hydra:variableRepresentation
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",hydra:view    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "variableRepresentation": "hydra:BasicRepresentation",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:ExplicitRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false            }        ]    }}
+
+

7.46. hydra:view

+ + + + + +
Name: + view +
Summary: + A specific view of a resource. +
Max cardinality: + 1 +
+
+ +
EXAMPLE: hydra:view
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search,limit,offset}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

7.47. hydra:writable

+ + + + + + + +
Name: + writable +
Summary: + True if the client can change the property’s value, + false otherwise. +
Max cardinality: + 1 +
Domain: + SupportedProperty +
Range: + xsd:boolean +
+
+ +
EXAMPLE: hydra:writable
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api?documentation",    "@type": "ApiDocumentation",    "entrypoint": "http://api.example.com/api",    "extension": "https://w3id.org/hydra/extension#shacl",    "supportedClass": [        {            "@id": "http://api.example.com/vocab#User",            "label": "User",            "description": "Describes a system user.",            "supportedOperation": [                {                    "method": "PUT",                    "label": "Create new user",                    "description": "Creates a brand new user.",                    "expects": "http://api.example.com/vocab#User",                    "returns": "http://api.example.com/vocab#User",                    "returnsHeader": [                        {                            "headerName": "Content-Type",                            "possibleValue": ["text/turtle", "application/ld+json"],                            "closedSet": true                        }                        "Content-Length"                    ],                    "expectsHeader": [                        "Authorization",                        {                            "headerName": "Content-Type",                            "possibleValue": ["image/gif", "image/png"],                            "closedSet": true                        }                    ]                }            ],            "supportedProperty": [                {                    "property": "http://api.example.com/vocab#login",                    "writable": true,                    "readable": true,                    "required": true                }            ]        }    ]}
+
+

8. Named instances

+

8.1. hydra:BasicRepresentation

+ + + + +
Name: + BasicRepresentation +
Summary: + A representation that serializes just the lexical form of a variable value, + but omits language and type information. +
+
+ +
EXAMPLE: hydra:BasicRepresentation
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

8.2. hydra:ExplicitRepresentation

+ + + + +
Name: + ExplicitRepresentation +
Summary: + A representation that serializes a variable value including its language + and type information and thus differentiating between IRIs and literals. +
+
+ +
EXAMPLE: hydra:ExplicitRepresentation
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": "/api/posts{?search}",        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:ExplicitRepresentation"            }        ]    }}
+
+

8.3. hydra:LinkContext

+ + + + +
Name: + LinkContext +
Summary: + States that the link’s context IRI, as defined in RFC 5988, should be used + as the base Uri. +
+
+ +
EXAMPLE: hydra:LinkContext
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": {            "@value": "/api/posts{?search}",            "@type": "hydra:Rfc6570Template"        },        "resolveRelativeUsing": "hydra:LinkContext",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

8.4. hydra:Rfc3986

+ + + + +
Name: + Rfc3986 +
Summary: + States that the link’s context IRI, as defined in RFC 5988, should be used + as the base Uri. +
+
+ +
EXAMPLE: hydra:LinkContext
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": {            "@value": "/api/posts{?search}",            "@type": "hydra:Rfc6570Template"        },        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation"            }        ]    }}
+
+

8.5. hydra:Unavailable

+ + + + +
Name: + Unavailable +
Summary: + States an operation previously announced is unavailable in current circumstances. +
+
+ +
EXAMPLE: hydra:Unavailable
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/",    "@type": "Collection",    "retractedOperation": [        {            "@type": "Operation",            "method": "POST",            "expects": "http://api.example.com/doc/#Upload",            "reason": "Unavailable"        }    ]}
+
+

8.6. hydra:Unauthorized

+ + + + +
Name: + Unauthorized +
Summary: + States an operation previously announced should not be invoked + as the current user is not authorized to invoke it. +
+
+ +
EXAMPLE: hydra:Unauthorized
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/doc/",    "@type": "Collection",    "retractedOperation": [        {            "@type": "Operation",            "method": "POST",            "expects": "http://api.example.com/doc/#Upload",            "reason": "Unauthorized"        }    ]}
+
+

9. Data types

+

9.1. hydra:Rfc6570Template

+ + + + +
Name: + Rfc6570Template +
Summary: + An IRI template as defined by [RFC6570]. +
+
+ +
EXAMPLE: hydra:Rfc6570Template
+
{    "@context": "http://www.w3.org/ns/hydra/context.jsonld",    "@id": "http://api.example.com/api/posts",    "@type": "Collection",    "view": {        "@id": "http://api.example.com/api/posts?skip=10",        "@type": "PartialCollectionView",        "first": "http://api.example.com/api/posts",        "last": "http://api.example.com/api/posts?skip=100",        "previous": "http://api.example.com/api/posts",        "next": "http://api.example.com/api/posts?skip=20",        "totalItems": 10,    },    "totalItems": 100,    "member": [        { "@id": "http://api.example.com/api/posts/10" },        { "@id": "http://api.example.com/api/posts/11" },        { "@id": "http://api.example.com/api/posts/12" },        { "@id": "http://api.example.com/api/posts/13" },        { "@id": "http://api.example.com/api/posts/14" },        { "@id": "http://api.example.com/api/posts/15" },        { "@id": "http://api.example.com/api/posts/16" },        { "@id": "http://api.example.com/api/posts/17" },        { "@id": "http://api.example.com/api/posts/18" },        { "@id": "http://api.example.com/api/posts/19" }    ],    "search": {        "template": {            "@value": "/api/posts{?search,limit,offset}",            "@type": "hydra:Rfc6570Template"        },        "resolveRelativeUsing": "hydra:Rfc3986",        "mapping": [            {                "variable": "search",                "property": "hydra:freetextQuery",                "required": true,                "variableRepresentation": "hydra:BasicRepresentation""            },            {                "variable": "limit",                "property": "hydra:limit",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation""            },            {                "variable": "offset",                "property": "hydra:offset",                "required": false,                "variableRepresentation": "hydra:BasicRepresentation""            }        ]    }}
+
+

10. Acknowledgements

+

Note: This section is non-normative.

+

The authors would like to thank the following individuals for contributing +their ideas and providing feedback for writing this specification: +Arnau Siches, elf Pavlik, Mark Baker, Martijn Faassen, +Matthias Lehmann, Ruben Verborgh, Ryan J. McDonough, Sam Goto, +Thomas Hoppe, @wasabiwimp (on GitHub).

+

Special thanks to Tomasz Pluskiewicz.

+

11. The Hydra in JSON-LD

+

Note: This section is non-normative.

+
{  "@context": {    "hydra": "http://www.w3.org/ns/hydra/core#",    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",    "xsd": "http://www.w3.org/2001/XMLSchema#",    "owl": "http://www.w3.org/2002/07/owl#",    "vs": "http://www.w3.org/2003/06/sw-vocab-status/ns#",    "dc": "http://purl.org/dc/terms/",    "cc": "http://creativecommons.org/ns#",    "schema": "http://schema.org/",    "apiDocumentation": "hydra:apiDocumentation",    "ApiDocumentation": "hydra:ApiDocumentation",    "title": "hydra:title",    "description": "hydra:description",    "entrypoint": { "@id": "hydra:entrypoint", "@type": "@id" },    "supportedClass": { "@id": "hydra:supportedClass", "@type": "@vocab" },    "Class": "hydra:Class",    "supportedProperty": { "@id": "hydra:supportedProperty", "@type": "@id" },    "SupportedProperty": "hydra:SupportedProperty",    "property": { "@id": "hydra:property", "@type": "@vocab" },    "required": "hydra:required",    "readable": "hydra:readable",    "writable": "hydra:writable",    "writeable": "hydra:writeable",    "supportedOperation": { "@id": "hydra:supportedOperation", "@type": "@id" },    "Operation": "hydra:Operation",    "method": "hydra:method",    "expects": { "@id": "hydra:expects", "@type": "@vocab" },    "returns": { "@id": "hydra:returns", "@type": "@vocab" },    "retractedOperation": { "@id": "hydra:retractedOperation", "@type": "@vocab" },    "reason": { "@id": "hydra:reason", "@type": "@vocab" },    "RetractedOperationSpecification": "hydra:RetractedOperationSpecification",    "UnavailabilityReason": "hydra:UnavailabilityReason",    "Unavailable": "hydra:Unavailable",    "Unauthorized": "hydra:Unauthorized",     "possibleStatus": { "@id": "hydra:possibleStatus", "@type": "@id" },    "Status": "hydra:Status",    "statusCode": "hydra:statusCode",    "Error": "hydra:Error",    "Resource": "hydra:Resource",    "operation": "hydra:operation",    "Collection": "hydra:Collection",    "collection": "hydra:collection",    "member": { "@id": "hydra:member", "@type": "@id" },    "memberAssertion": "hydra:memberAssertion",    "manages": "hydra:manages",    "subject": { "@id": "hydra:subject", "@type": "@vocab" },    "object": { "@id": "hydra:object", "@type": "@vocab" },    "search": "hydra:search",    "freetextQuery": "hydra:freetextQuery",    "view": { "@id": "hydra:view", "@type": "@id" },    "PartialCollectionView": "hydra:PartialCollectionView",    "totalItems": "hydra:totalItems",    "first": { "@id": "hydra:first", "@type": "@id" },    "last": { "@id": "hydra:last", "@type": "@id" },    "next": { "@id": "hydra:next", "@type": "@id" },    "previous": { "@id": "hydra:previous", "@type": "@id" },    "Link": "hydra:Link",    "TemplatedLink": "hydra:TemplatedLink",    "IriTemplate": "hydra:IriTemplate",    "template": "hydra:template",    "Rfc6570Template": "hydra:Rfc6570Template",    "variableRepresentation": { "@id": "hydra:variableRepresentation", "@type": "@vocab" },    "VariableRepresentation": "hydra:VariableRepresentation",    "BasicRepresentation": "hydra:BasicRepresentation",    "ExplicitRepresentation": "hydra:ExplicitRepresentation",    "mapping": "hydra:mapping",    "IriTemplateMapping": "hydra:IriTemplateMapping",    "variable": "hydra:variable",    "offset": { "@id": "hydra:offset", "@type": "xsd:nonNegativeInteger" },    "limit": { "@id": "hydra:limit", "@type": "xsd:nonNegativeInteger" },    "pageIndex": { "@id": "hydra:pageIndex", "@type": "xsd:nonNegativeInteger" },    "pageReference": { "@id": "hydra:pageReference" },    "returnsHeader": { "@id": "hydra:returnsHeader", "@type": "xsd:string" },    "expectsHeader": { "@id": "hydra:expectsHeader", "@type": "xsd:string" },    "HeaderSpecification": "hydra:HeaderSpecification",    "headerName": "hydra:headerName",    "possibleValue": "hydra:possibleValue",    "closedSet": { "@id": "hydra:possibleValue", "@type": "xsd:boolean" },    "name": { "@id": "hydra:name", "@type": "xsd:string" },    "extension": { "@id": "hydra:extension", "@type": "@id" },    "isDefinedBy": { "@id": "rdfs:isDefinedBy", "@type": "@id" },    "defines": { "@reverse": "rdfs:isDefinedBy" },    "comment": "rdfs:comment",    "label": "rdfs:label",    "preferredPrefix": "http://purl.org/vocab/vann/preferredNamespacePrefix",    "cc:license": {"@type": "@id" },    "cc:attributionURL": {"@type": "@id" },    "domain": { "@id": "rdfs:domain", "@type": "@vocab" },    "range": {"@id": "rdfs:range", "@type": "@vocab" },    "subClassOf": { "@id": "rdfs:subClassOf", "@type": "@vocab" },    "subPropertyOf": { "@id": "rdfs:subPropertyOf", "@type": "@vocab" },    "seeAlso": { "@id": "rdfs:seeAlso", "@type": "@id" },    "domainIncludes": { "@id": "schema:domainIncludes", "@type": "@id" },    "rangeIncludes": { "@id": "schema:rangeIncludes", "@type": "@id" }  },  "@id": "http://www.w3.org/ns/hydra/core",  "@type": "owl:Ontology",  "label": "The Hydra Core Vocabulary",  "comment": "A lightweight vocabulary for hypermedia-driven Web APIs.",  "seeAlso": "https://www.hydra-cg.com/spec/latest/core/",  "preferredPrefix": "hydra",  "dc:description": "The Hydra Core Vocabulary is a lightweight vocabulary to create hypermedia-driven Web APIs. By specifying a number of concepts commonly used in Web APIs it enables the creation of generic API clients.",  "dc:rights": "Copyright © 2012-2014 the Contributors to the Hydra Core Vocabulary Specification",  "dc:publisher": "Hydra W3C Community Group",  "cc:license": "http://creativecommons.org/licenses/by/4.0/",  "cc:attributionName": "Hydra W3C Community Group",  "cc:attributionURL": "http://www.hydra-cg.com/",  "defines": [    {      "@id": "hydra:Resource",      "@type": "hydra:Class",      "label": "Hydra Resource",      "comment": "The class of dereferenceable resources by means a client can attempt to dereference; however, the received responses should still be verified.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:Class",      "@type": [ "hydra:Resource", "rdfs:Class" ],      "subClassOf": [ "rdfs:Class" ],      "label": "Hydra Class",      "comment": "The class of Hydra classes.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:Link",      "@type": "hydra:Class",      "subClassOf": [ "hydra:Resource", "rdf:Property" ],      "label": "Link",      "comment": "The class of properties representing links.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:apiDocumentation",      "@type": "hydra:Link",      "label": "apiDocumentation",      "comment": "A link to the API documentation.",      "range": "hydra:ApiDocumentation",      "domain": "hydra:Resource",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:ApiDocumentation",      "@type": "hydra:Class",      "subClassOf": "hydra:Resource",      "label": "ApiDocumentation",      "comment": "The Hydra API documentation class.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:entrypoint",      "@type": "hydra:Link",      "label": "entrypoint",      "comment": "A link to main entry point of the Web API.",      "domain": "hydra:ApiDocumentation",      "range": "hydra:Resource",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:supportedClass",      "@type": "hydra:Link",      "label": "supported classes",      "comment": "A class known to be supported by the Web API.",      "domain": "hydra:ApiDocumentation",      "range": "rdfs:Class",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:retractedOperation",      "@type": "rdf:Property",      "label": "retracted operation",      "comment": "Retracts available operations.",      "range": "hydra:RetractedOperationSpecification",      "domain": "hydra:Resource",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:RetractedOperationSpecification",      "@type": "hydra:Class",      "label": "retracted operation specification",      "comment": "Describes which and why an operation is retracted.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:reason",      "@type": "rdf:Property",      "label": "reason",      "comment": "Reason of why the operation is retracted.",      "range": "hydra:UnavailabilityReason",      "domain": "hydra:RetractedOperationSpecification",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:UnavailabilityReason",      "@type": "hydra:Class",      "label": "Unavailability reason",      "comment": "Provides reasons why the operation cannot be invoked.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:Unavailable",      "@type": "hydra:UnavailabilityReason",      "label": "Unavailable",      "comment": "States an operation previously announced is unavailable in current circumstances.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:Unauthorized",      "@type": "hydra:Availability",      "label": "Unauthorized",      "comment": "States an operation previously announced should not be invoked as the current user is not authorized to invoke it.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },        {      "@id": "hydra:possibleStatus",      "@type": "hydra:Link",      "label": "possible status",      "comment": "A status that might be returned by the Web API (other statuses should be expected and properly handled as well).",      "range": "hydra:Status",      "domainIncludes": ["hydra:ApiDocumentation", "hydra:Operation", "hydra:RetractedOperationSpecification"],      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:supportedProperty",      "@type": "hydra:Link",      "label": "supported properties",      "comment": "The properties known to be supported by a Hydra class.",      "domain": "rdfs:Class",      "range": "hydra:SupportedProperty",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:SupportedProperty",      "@type": "hydra:Class",      "label": "Supported Property",      "comment": "A property known to be supported by a Hydra class.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:property",      "@type": "rdf:Property",      "label": "property",      "comment": "A property.",      "range": "rdf:Property",      "domainIncludes": ["hydra:SupportedProperty", "hydra:IriTemplateMapping"],      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:required",      "@type": "rdf:Property",      "label": "required",      "comment": "True if the property is required, false otherwise.",      "range": "xsd:boolean",      "domainIncludes": ["hydra:SupportedProperty", "hydra:IriTemplateMapping"],      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:readable",      "@type": "rdf:Property",      "label": "readable",      "comment": "True if the client can retrieve the property's value, false otherwise.",      "domain": "hydra:SupportedProperty",      "range": "xsd:boolean",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:writable",      "@type": "rdf:Property",      "label": "writable",      "comment": "True if the client can change the property's value, false otherwise.",      "domain": "hydra:SupportedProperty",      "range": "xsd:boolean",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:writeable",      "subPropertyOf": "hydra:writable",      "label": "writable",      "comment": "This property is left for compatibility purposes and hydra:writable should be used instead.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "archaic"    },    {      "@id": "hydra:supportedOperation",      "@type": "hydra:Link",      "label": "supported operation",      "comment": "An operation supported by instances of the specific Hydra class, or the target of the Hydra link, or Iri template.",      "range": "hydra:Operation",      "domainIncludes": ["rdfs:Class", "hydra:Class", "hydra:Link", "hydra:TemplatedLink", "hydra:SupportedProperty"],      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:operation",      "@type": "hydra:Link",      "label": "operation",      "comment": "An operation supported by the Hydra resource.",      "domain": "hydra:Resource",      "range": "hydra:Operation",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:Operation",      "@type": "hydra:Class",      "label": "Operation",      "comment": "An operation.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:method",      "@type": "rdf:Property",      "label": "method",      "comment": "The protocol method.",      "domainIncludes": ["hydra:Operation", "hydra:RetractedOperationSpecification"],      "range": "xsd:string",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:expects",      "@type": "hydra:Link",      "label": "expects",      "comment": "The information expected by the Web API.",      "domainIncludes": ["hydra:Operation", "hydra:RetractedOperationSpecification"],      "rangeIncludes": ["rdfs:Resource", "hydra:Resource", "rdfs:Class", "hydra:Class"],      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:returns",      "@type": "hydra:Link",      "label": "returns",      "comment": "The information returned by the Web API on success.",      "domainIncludes": ["hydra:Operation", "hydra:RetractedOperationSpecification"],      "rangeIncludes": ["rdfs:Resource", "hydra:Resource", "rdfs:Class", "hydra:Class"],      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:Status",      "@type": "hydra:Class",      "label": "Status code description",      "comment": "Additional information about a status code that might be returned.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:statusCode",      "@type": "rdf:Property",      "label": "status code",      "comment": "The response status code. Please note it may happen this value will be different to actual status code received.",      "domain": "hydra:Status",      "range": "xsd:integer",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:title",      "@type": "rdf:Property",      "subPropertyOf": "rdfs:label",      "label": "title",      "comment": "A title, often used along with a description.",      "range": "xsd:string",      "domainIncludes": [        "hydra:ApiDocumentation",        "hydra:Status",        "hydra:Class",        "hydra:SupportedProperty",        "hydra:Operation",        "hydra:Link",        "hydra:TemplatedLink"      ],      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:description",      "@type": "rdf:Property",      "subPropertyOf": "rdfs:comment",      "label": "description",      "comment": "A description.",      "range": "xsd:string",      "domainIncludes": [        "hydra:ApiDocumentation",        "hydra:Status",        "hydra:Class",        "hydra:SupportedProperty",        "hydra:Operation",        "hydra:Link",        "hydra:TemplatedLink"      ],      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:Error",      "@type": "hydra:Class",      "subClassOf": "hydra:Status",      "label": "Error",      "comment": "A runtime error, used to report information beyond the returned status code.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:Collection",      "@type": "hydra:Class",      "subClassOf": "hydra:Resource",      "label": "Collection",      "comment": "A collection holding references to a number of related resources.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:collection",      "@type": "hydra:Link",      "label": "collection",      "comment": "Collections somehow related to this resource.",      "range": "hydra:Collection",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:memberAssertion",      "label": "member assertion",      "comment": "Semantics of each member provided by the collection.",      "domainIncludes": ["hydra:Collection", "hydra:Class"],      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:manages",      "subPropertyOf": "hydra:memberAssertion",      "label": "manages",      "comment": "This predicate is left for compatibility purposes and hydra:memberAssertion should be used instead.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "archaic"    },    {      "@id": "hydra:subject",      "label": "subject",      "comment": "The subject.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:object",      "label": "object",      "comment": "The object.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:member",      "@type": "hydra:Link",      "label": "member",      "comment": "A member of the collection.",      "domain": "hydra:Collection",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:view",      "@type": "hydra:Link",      "label": "view",      "comment": "A specific view of a resource.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:PartialCollectionView",      "@type": "hydra:Class",      "subClassOf": "hydra:Resource",      "label": "PartialCollectionView",      "comment": "A PartialCollectionView describes a partial view of a Collection. Multiple PartialCollectionViews can be connected with the next/previous properties to allow a client to retrieve all members of the collection.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:totalItems",      "@type": "rdf:Property",      "label": "total items",      "comment": "The total number of items referenced by a collection.",      "domain": "hydra:Collection",      "range": "xsd:integer",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:first",      "@type": "hydra:Link",      "label": "first",      "comment": "The first resource of an interlinked set of resources.",      "domain": "hydra:Resource",      "range": "hydra:Resource",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:last",      "@type": "hydra:Link",      "label": "last",      "comment": "The last resource of an interlinked set of resources.",      "domain": "hydra:Resource",      "range": "hydra:Resource",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:next",      "@type": "hydra:Link",      "label": "next",      "comment": "The resource following the current instance in an interlinked set of resources.",      "domain": "hydra:Resource",      "range": "hydra:Resource",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:previous",      "@type": "hydra:Link",      "label": "previous",      "comment": "The resource preceding the current instance in an interlinked set of resources.",      "domain": "hydra:Resource",      "range": "hydra:Resource",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:search",      "@type": "hydra:TemplatedLink",      "label": "search",      "comment": "A Iri template that can be used to query a collection.",      "range": "hydra:IriTemplate",      "domain": "hydra:Resource",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:freetextQuery",      "@type": "rdf:Property",      "label": "freetext query",      "comment": "A property representing a freetext query.",      "range": "xsd:string",      "domain": "hydra:Resource",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:TemplatedLink",      "@type": "hydra:Class",      "subClassOf": [ "hydra:Resource", "rdf:Property" ],      "label": "Templated Link",      "comment": "A templated link.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:IriTemplate",      "@type": "hydra:Class",      "label": "IRI Template",      "comment": "The class of IRI templates.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:template",      "@type": "rdf:Property",      "label": "template",      "comment": "A templated string with placeholders. The literal's datatype indicates the template syntax; if not specified, hydra:Rfc6570Template is assumed.",      "seeAlso": "hydra:Rfc6570Template",      "domain": "hydra:IriTemplate",      "range": "hydra:Rfc6570Template",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:Rfc6570Template",      "@type": "rdfs:Datatype",      "label": "RFC6570 IRI template",      "comment": "An IRI template as defined by RFC6570.",      "seeAlso": "http://tools.ietf.org/html/rfc6570",      "range": "xsd:string",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:variableRepresentation",      "@type": "rdf:Property",      "label": "variable representation",      "comment": "The representation format to use when expanding the Iri template.",      "range": "hydra:VariableRepresentation",      "domainIncludes": ["hydra:IriTemplateMapping", "hydra:IriTemplate"],      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:VariableRepresentation",      "@type": "hydra:Class",      "label": "VariableRepresentation",      "comment": "A representation specifies how to serialize variable values into strings.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:BasicRepresentation",      "@type": "hydra:VariableRepresentation",      "label": "BasicRepresentation",      "comment": "A representation that serializes just the lexical form of a variable value, but omits language and type information.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:ExplicitRepresentation",      "@type": "hydra:VariableRepresentation",      "label": "ExplicitRepresentation",      "comment": "A representation that serializes a variable value including its language and type information and thus differentiating between IRIs and literals.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:mapping",      "@type": "rdf:Property",      "label": "mapping",      "comment": "A variable-to-property mapping of the IRI template.",      "domain": "hydra:IriTemplate",      "range": "hydra:IriTemplateMapping",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:IriTemplateMapping",      "@type": "hydra:Class",      "label": "IriTemplateMapping",      "comment": "A mapping from an IRI template variable to a property.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:variable",      "@type": "rdf:Property",      "label": "variable",      "comment": "An Iri template variable.",      "domain": "hydra:IriTemplateMapping",      "range": "xsd:string",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:resolveRelativeUsing",      "@type": "rdf:Property",      "label": "relative Uri resolution",      "comment": "Instructs on how to resolve relative Uri created by the Iri template resolution.",      "domain": "hydra:IriTemplate",      "range": "hydra:BaseUriSource",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:BaseUriSource",      "@type": "hydra:Class",      "subClassOf": "hydra:Resource",      "label": "Base Uri source",      "comment": "Provides a base abstract for base Uri source for Iri template resolution.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:Rfc3986",      "@type": "hydra:BaseUriSource",      "label": "RFC 3986 based",      "comment": "States that the base Uri should be established using RFC 3986 reference resolution algorithm specified in section 5.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:LinkContext",      "@type": "hydra:BaseUriSource",      "label": "Link context",      "comment": "States that the link's context IRI, as defined in RFC 5988, should be used as the base Uri.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:offset",      "@type": "rdf:Property",      "label": "skip",      "comment": "Instructs to skip N elements of the set.",      "range": "xsd:nonNegativeInteger",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:limit",      "@type": "rdf:Property",      "label": "take",      "comment": "Instructs to limit set only to N elements.",      "range": "xsd:nonNegativeInteger",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:pageIndex",      "@type": "rdf:Property",      "subPropertyOf": "hydra:pageReference",      "label": "page index",      "comment": "Instructs to provide a specific page of the collection at a given index.",      "range": "xsd:nonNegativeInteger",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:pageReference",      "@type": "rdf:Property",      "label": "page reference",      "comment": "Instructs to provide a specific page reference of the collection.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:returnsHeader",      "@type": "rdf:Property",      "label": "returns header",      "comment": "Name of the header returned by the operation.",      "domain": "hydra:Operation",      "rangeIncludes": ["xsd:string", "hydra:HeaderSpecification"],      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:expectsHeader",      "@type": "rdf:Property",      "label": "expects header",      "comment": "Specification of the header expected by the operation.",      "domain": "hydra:Operation",      "rangeIncludes": ["xsd:string", "hydra:HeaderSpecification"],      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:HeaderSpecification",      "@type": "rdfs:Class",      "subClassOf": "hydra:Resource",      "label": "Header specification",      "comment": "Specifies a possible either expected or returned header values.",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:headerName",      "@type": "rdf:Property",      "label": "header name",      "comment": "Name of the header.",      "domain": "hydra:HeaderSpecification",      "range": "xsd:string",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:possibleValue",      "@type": "rdf:Property",      "label": "possible header value",      "comment": "Possible value of the header.",      "domain": "hydra:HeaderSpecification",      "range": "xsd:string",      "vs:term_status": "testing"    },    {      "@id": "hydra:closedSet",      "@type": "rdf:Property",      "label": "closed set",      "comment": "Determines whether the provided set of header values is closed or not.",      "domain": "hydra:HeaderSpecification",      "range": "xsd:boolean",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    },    {      "@id": "hydra:extension",      "@type": "rdf:Property",      "label": "extension",      "comment": "Hint on what kind of extensions are in use.",      "domain": "hydra:ApiDocumentation",      "isDefinedBy": "http://www.w3.org/ns/hydra/core",      "vs:term_status": "testing"    }  ]}
+

12. The Hydra error context

+

Note: This section is non-normative.

+
{  "@context": {    "rdf": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",    "rdfs": "http://www.w3.org/2000/01/rdf-schema#",    "hydra": "http://www.w3.org/ns/hydra/core#",    "type": { "@id": "rdf:type", "@type": "@id" },    "title": "rdfs:label",    "detail": "rdfs:comment",    "status": "hydra:statusCode",    "instance": { "@id": "rdfs:seeAlso", "@type": "@id" }  }}
+
+
+

Conformance

+

Conformance requirements are expressed with a combination of descriptive assertions and RFC 2119 terminology. + The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” + in the normative parts of this document + are to be interpreted as described in RFC 2119. + However, for readability, + these words do not appear in all uppercase letters in this specification.

+

All of the text of this specification is normative + except sections explicitly marked as non-normative, examples, and notes. [RFC2119]

+

Examples in this specification are introduced with the words “for example” + or are set apart from the normative text with class="example", like this:

+
This is an example of an informative example.
+

Informative notes begin with the word “Note” + and are set apart from the normative text with class="note", like this:

+

Note, this is an informative note.

+
+ +

Index

+

Terms defined by this specification

+ +

References

+

Normative References

+
+
[BCP47] +
A. Phillips, Ed.; M. Davis, Ed.. Tags for Identifying Languages. September 2009. Best Current Practice. URL: https://www.rfc-editor.org/rfc/rfc5646 +
[HydraCG] +
Hydra W3C Community Group. URL: https://www.w3.org/community/hydra/ +
[RDF-Schema] +
Dan Brickley; Ramanathan Guha. RDF Schema 1.1. URL: https://w3c.github.io/rdf-schema/spec/ +
[RFC2119] +
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Best Current Practice. URL: https://datatracker.ietf.org/doc/html/rfc2119 +
[RFC3986] +
T. Berners-Lee; R. Fielding; L. Masinter. Uniform Resource Identifier (URI): Generic Syntax. January 2005. Internet Standard. URL: https://www.rfc-editor.org/rfc/rfc3986 +
[RFC6570] +
J. Gregorio; et al. URI Template. March 2012. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc6570 +
[RFC7240] +
J. Snell. Prefer Header for HTTP. June 2014. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc7240 +
[RFC8288] +
M. Nottingham. Web Linking. October 2017. Proposed Standard. URL: https://httpwg.org/specs/rfc8288.html +
[RFC9457] +
M. Nottingham; E. Wilde; S. Dalal. Problem Details for HTTP APIs. July 2023. Proposed Standard. URL: https://www.rfc-editor.org/rfc/rfc9457 +
[Turtle] +
Eric Prud'hommeaux; Gavin Carothers. RDF 1.1 Turtle. URL: https://w3c.github.io/rdf-turtle/spec/ +
+ + + \ No newline at end of file diff --git a/spec/latest/core/vocabulary.png b/spec/latest/core/vocabulary.png index 805b042..bf31647 100644 Binary files a/spec/latest/core/vocabulary.png and b/spec/latest/core/vocabulary.png differ