diff --git a/core/openapi/ogcapi-features-1.yaml b/core/openapi/ogcapi-features-1.yaml index 4f14a51a..1113b0c7 100644 --- a/core/openapi/ogcapi-features-1.yaml +++ b/core/openapi/ogcapi-features-1.yaml @@ -154,6 +154,10 @@ components: - href: http://example.com/concepts/buildings.html rel: describedby type: text/html + linkTemplates: + type: array + items: + $ref: "#/components/schemas/linkTemplate" extent: $ref: "#/components/schemas/extent" itemType: @@ -442,6 +446,25 @@ components: example: Trierer Strasse 70, 53115 Bonn length: type: integer + linkTemplate: + type: object + required: + - uriTemplate + - rel + properties: + uriTemplate: + type: string + example: https://data.example.org/collections/buildings/items/{featureId} + rel: + type: string + title: + type: string + example: Link template for building features + type: + type: string + example: application/geo+json + varBase: + type: string multilinestringGeoJSON: type: object required: diff --git a/core/openapi/schemas/collection.yaml b/core/openapi/schemas/collection.yaml index 52591acd..5077ef39 100644 --- a/core/openapi/schemas/collection.yaml +++ b/core/openapi/schemas/collection.yaml @@ -25,6 +25,10 @@ properties: - href: http://example.com/concepts/buildings.html rel: describedby type: text/html + linkTemplates: + type: array + items: + $ref: linkTemplate.yaml extent: $ref: extent.yaml itemType: diff --git a/core/openapi/schemas/link.yaml b/core/openapi/schemas/link.yaml index 52318fd0..4de68c55 100644 --- a/core/openapi/schemas/link.yaml +++ b/core/openapi/schemas/link.yaml @@ -1,22 +1,10 @@ -type: object -required: - - href - - rel -properties: - href: - type: string - example: http://data.example.com/buildings/123 - rel: - type: string - example: alternate - type: - type: string - example: application/geo+json - hreflang: - type: string - example: en - title: - type: string - example: Trierer Strasse 70, 53115 Bonn - length: - type: integer +allOf: + - $ref: 'linkBase.yaml' + - type: object + required: + - href + properties: + href: + type: string + description: The URI of the link target. + example: http://data.example.com/buildings/123 diff --git a/core/openapi/schemas/linkBase.yaml b/core/openapi/schemas/linkBase.yaml new file mode 100644 index 00000000..c8177ddb --- /dev/null +++ b/core/openapi/schemas/linkBase.yaml @@ -0,0 +1,30 @@ +--- +type: object +required: + - rel +properties: + rel: + type: string + description: The type or semantics of the relation. + example: alternate + type: + type: string + description: + A hint indicating what the media type of the + result of dereferencing the link should be. + example: application/geo+json + hreflang: + type: string + description: + A hint indicating what the language of the + result of dereferencing the link should be. + example: en + title: + type: string + description: + Used to label the destination of a link + such that it can be used as a human-readable + identifier. + example: "Trierer Strasse 70, 53115 Bonn" + length: + type: integer diff --git a/core/openapi/schemas/linkTemplate.yaml b/core/openapi/schemas/linkTemplate.yaml new file mode 100644 index 00000000..8197b485 --- /dev/null +++ b/core/openapi/schemas/linkTemplate.yaml @@ -0,0 +1,20 @@ +--- +allOf: + - $ref: 'linkBase.yaml' + - type: object + required: + - uriTemplate + properties: + uriTemplate: + type: string + description: + Supplies a URI template that when expanded using + a set of variables, results in a URI. + example: http://data.example.com/buildings/{building-id} + varBase: + type: string + description: + The base URI to which the variable name can be + appended to retrieve the definition of the + variable as a JSON Schema fragment. + format: uri-reference diff --git a/core/standard/clause_7_core.adoc b/core/standard/clause_7_core.adoc index 880554ab..6d4a8d10 100644 --- a/core/standard/clause_7_core.adoc +++ b/core/standard/clause_7_core.adoc @@ -657,15 +657,17 @@ Reference system information is not provided as the service provides geometries { "href": "https://data.example.org/collections/buildings/items", "rel": "items", "type": "application/geo+json", "title": "Buildings" }, - { "href": "https://data.example.org/collections/buildings/items/{featureId}", - "rel": "item", "title": "Link template for building features", - "templated": true }, { "href": "https://creativecommons.org/publicdomain/zero/1.0/", "rel": "license", "type": "text/html", "title": "CC0-1.0" }, { "href": "https://creativecommons.org/publicdomain/zero/1.0/rdf", "rel": "license", "type": "application/rdf+xml", "title": "CC0-1.0" } + ], + "linkTemplates": [ + { "uriTemplate": "https://data.example.org/collections/buildings/items/{featureId}", + "rel": "item", "title": "Link template for building features", + "varBase": "https://data.example.org/collections/buildings/var-base/" } ] } ] @@ -690,7 +692,7 @@ link: ; anchor="#/collections/0" link: ; anchor="#/collections/0"; rel="items"; type="application/geo+json"; title="Buildings" link: ; anchor="#/collections/0"; rel="license"; type="text/html"; title="CC0-1.0" link: ; anchor="#/collections/0"; rel="license"; type="application/rdf+xml"; title="CC0-1.0" -link-template: ; anchor="#/collections/0"; rel="item"; title="Link template for buildung features" +link-template: ; anchor="#/collections/0"; rel="item"; title="Link template for buildung features"; var-base="https://data.example.org/collections/buildings/var-base/" vary: Accept,Accept-Language,Accept-Encoding content-length: 6178 ---- diff --git a/core/standard/recomendations/core/REC_fc-md-item-link-templates.adoc b/core/standard/recomendations/core/REC_fc-md-item-link-templates.adoc index 9574f2cc..21ad3364 100644 --- a/core/standard/recomendations/core/REC_fc-md-item-link-templates.adoc +++ b/core/standard/recomendations/core/REC_fc-md-item-link-templates.adoc @@ -2,7 +2,7 @@ [width="90%",cols="2,6a"] |=== ^|*Recommendation {counter:rec-id}* |*/rec/core/fc-md-item-link-templates* -^|A |For each feature collection included in the response, the `links` property of the collection SHOULD include a link template to the URI of the features (relation: `item`). -^|B |The link template SHALL be encoded as a Link object with a property `templated` set to `true` and the URI template in `href`. +^|A |For each feature collection included in the response, the `linkTemplates` property of the collection SHOULD include a link template to the URI of the features (relation: `item`). +^|B |The link template SHALL be encoded as a LinkTemplate object with the URI template in `uriTemplate`. ^|C |If links are included in `Link` HTTP headers of the response, the link templates SHOULD also be included in `Link-Template` HTTP headers according to the https://datatracker.ietf.org/doc/draft-ietf-httpapi-link-template/[draft "The Link-Template HTTP Header Field" specification]. |===