264 | | A ''Data View'' serves as a container for representing search results within CLARIN-FCS. Data Views are designed to allow for different representations of results, i.e they are deliberately kept open to allow further extensions with more supported data view formats. Each Data View is identified by a MIME type ([#REF_RFC_6838 RFC6838], [#REF_RFC_3023 RFC3023]). If no existing MIME type can be used, implementors `SHOULD` define a properer private mime type. The type if the Data View is recorded in the `@type` attribute if the `<fcs:DataView>` element. |
265 | | |
266 | | The following formats are defined as part of the specification: |
267 | | Generic Hits (HITS):: |
268 | | Yada ... |
269 | | Component Metadata (CMDI):: |
270 | | Yada ... |
271 | | Images (IMG):: |
272 | | Yada ... |
273 | | |
| 269 | A ''Data View'' serves as a container for representing search results within CLARIN-FCS. Data Views are designed to allow for different representations of results, i.e. they are deliberately kept open to allow further extensions with more supported data view formats. The content of a Data View is called `payload`. Each Data View is identified by a MIME type ([#REF_RFC_6838 RFC6838], [#REF_RFC_3023 RFC3023]). If no existing MIME type can be used, implementors `SHOULD` define a properer private mime type. The type if the Data View is recorded in the `@type` attribute if the `<fcs:DataView>` element. |
| 270 | |
| 271 | The content of a Data View can either be deposited ''inline'' or by ''reference''. In the case of ''inline'', the payload of the Data View `MUST` serialized as an XML fragment below the `<fcs:DataView>` element. This method is the preferred methods payloads that can easily serialized in XML. In the case of by ''reference'', the content cannot easily deposited inline, i.e. it is binary content. In this case, the Data View `MUST` include a `@ref` or `@pid` attribute that links location for Clients to download the payload. This location `SHOULD` be ''openly accessible'', i.e. data can be downloaded freely without any need to perform a login. |
| 272 | |
| 273 | For the ''basic'' profile, the Data Views ''Generic Hits'', ''Component Metadata'', ''Image'' and ''Geolocation'' are defined in this specification. Endpoints `MAY` define custom Data Views, but Clients conforming to the ''basic'' profile `MAY` chose to ignore these. |
| 274 | |
| 275 | The examples in the following sections ''show only'' |
| 276 | ===== Generic Hits (HITS) ===== |
| 277 | ||=Description =|| The representation of the hit || |
| 278 | ||=MIME type =|| `application/x-clarin-fcs-hits+xml` || |
| 279 | ||=Payload Disposition =|| ''inline'' || |
| 280 | The ''Generic Hits'' Data View contains the serialization of a search result hit. |
| 281 | Example (single hit marker): |
| 282 | {{{#!xml |
| 283 | <Result xmlns="http://clarin.eu/fcs/1.0/hits"> |
| 284 | The quick brown <Hit>fox</Hit> jumps over the lazy dog. |
| 285 | </Result> |
| 286 | }}} |
| 287 | Example (multiple hit markers; using XML namespace prefix instead): |
| 288 | {{{#!xml |
| 289 | <hits:Result xmlns:hits="http://clarin.eu/fcs/1.0/hits"> |
| 290 | The quick brown <Hit>fox</Hit> jumps over the lazy dog. |
| 291 | </hits:Result> |
| 292 | }}} |
| 293 | |
| 294 | ===== Component Metadata (CMDI) ===== |
| 295 | ||=Description =|| A CMDI metadata record || |
| 296 | ||=MIME type =|| `application/x-cmdi+xml` || |
| 297 | ||=Payload Disposition =|| ''inline'' or ''reference'' || |
| 298 | The ''Component Metadata'' Data View allows to embed a CMDI metadata record that ''applicable'' to the specific context into the Endpoint response, e.g. metadata about the resource in which the hit was produced. If this CMDI record is applicable for the entire Resource, is `SHOULD` be put in a `<fcs:DataView>` element below the `<fcs:Resource>` element. If it is applicable to the Resource Fragment, i.e. it contains more specialized metadata than the metadata for the encompassing resource, it `SHOULD` be put in a `<fcs:DataView>` element below the `<fcs:ResourceFragment>` element. Endpoints `SHOULD` provide the payload ''inline'', but Endpoints `MAY` also use the ''reference'' method. If an Endpoint uses the ''reference'' method, the CMDI metadata record `MUST` be downloadable without any restrictions. |
| 299 | |
| 300 | ===== Images (IMG) ===== |
| 301 | ||=Description =|| An image related to the hit || |
| 302 | ||=MIME type =|| `image/png`, `image/jpeg`, `image/gif`, `image/svg+xml` || |
| 303 | ||=Payload Disposition =|| ''reference'' || |
| 304 | |
| 305 | The ''Image'' Data View |
| 306 | ===== Geolocation (GEO) ===== |
| 307 | ||=Description =|| An geographic location related to the hit || |
| 308 | ||=MIME type =|| `application/vnd.google-earth.kml+xml` || |
| 309 | ||=Payload Disposition =|| ''inline'' || |
| 310 | The ''Geolocation'' Data View allows to geolocalize the hit. If `MUST` be encoded using the XML representation of the Keyhole Markup Language (KML)]. The KML fragment `MUST` comply with the [=#REF_KML_Spec KML specification]. |
| 311 | |
| 312 | Example: |
| 313 | <kml xmlns="http://www.opengis.net/kml/2.2"> |
| 314 | <Placemark> |
| 315 | <name>Simple placemark</name> |
| 316 | <description>Attached to the ground. Intelligently places itself |
| 317 | at the height of the underlying terrain.</description> |
| 318 | <Point> |
| 319 | <coordinates>-122.0822035425683,37.42228990140251,0</coordinates> |
| 320 | </Point> |
| 321 | </Placemark> |
| 322 | </kml> |
| 323 | |
| 324 | |