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'' |
| 272 | 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 Payload is typed and the type of the Payload is recorded in the `@type` attribute if the `<fcs:DataView>` element. The Payload type is 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. |
| 273 | |
| 274 | The Payload of a Data View can either be deposited ''inline'' or by ''reference''. In the case of ''inline'', it `MUST` be 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. |
| 275 | |
| 276 | 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` choose to ignore them. The ''Generic Hits'' Data View is mandatory, thus all Endpoints `MUST` provide hits represented in the ''Generic Hits'' Data View. |
| 277 | |
| 278 | '''NOTE''': The examples in the following sections ''show only'' the payload with the enclosing `<fcs:DataView>` element of a Data View. Of course, the Data View must be embedded either in a `<fcs:Resource>` or a `<fcs:ResourceFragment>` element. The `@pid` and `@ref` attributes have been omitted for all ''inline'' payload types. |
| 279 | |
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 | | }}} |
| 284 | The ''Generic Hits'' Data View contains the serialization of a search result hit. It supports multiple maskers for suppling highlighting for the hit. Each hit `SHOULD` be presented within the context of a complete sentence. If that is not possible due to the nature of the type of the resource, the the Endpoint `SHALL` provide an equivalent reasonable unit of context (e.g. within a phrase of a orthographic transcription of an utterance). All Endpoints `MUST` provide hits represented in this Data View. The XML fragment of the Generic Hits payload `MUST` be valid according to the XML schema "[source:FederatedSearch/schema/DataView-Hits.xsd DataView-Hits.xsd]" ([source:FederatedSearch/schema/DataView-Hits.xsd?format=txt download]) |
| 285 | * Example (single hit marker): |
| 286 | {{{#!xml |
| 287 | <!-- potential @pid and @ref attributes omitted --> |
| 288 | <fcs:DataView type="application/x-clarin-fcs-hits+xml"> |
| 289 | <hits:Result xmlns:hits="http://clarin.eu/fcs/1.0/hits"> |
| 290 | The quick brown <hits:Hit>fox</hits:Hit> jumps over the lazy dog. |
| 291 | </hits:Result> |
| 292 | </fcs:DataView> |
| 293 | }}} |
| 294 | * Example (multiple hit markers): |
| 295 | {{{#!xml |
| 296 | <!-- potential @pid and @ref attributes omitted --> |
| 297 | <fcs:DataView type="application/x-clarin-fcs-hits+xml"> |
| 298 | <hits:Result xmlns:hits="http://clarin.eu/fcs/1.0/hits"> |
| 299 | The quick brown <hits:Hit>fox</hits:Hit> jumps over the lazy <hits:Hit>dog</hits:Hit>. |
| 300 | </hits:Result> |
| 301 | </fcs:DataView> |
| 302 | }}} |
| 303 | |
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 | | |
325 | | *WIP* |
326 | | The type of each data view is identified by the {{{type}}} attribute of the {{{<fcs:DataView>}}} element. The value if defined to be a [http://en.wikipedia.org/wiki/MIME_Type MIME type]. The following formats are currently being considered: |
327 | | Keyword-In-Context (KWIC):: |
328 | | Description: a keyword-in-context view, where each hit should be presented within the context of a complete sentence (if possible) or any other reasonable unit of context (e.g. if sentences cannot be determined by the endpoint). The keyword-in-context data view is '''mandatory''' for all endpoints. The appropriate XML schema can be found at [source:FederatedSearch/Resource-KWIC.xsd Resource-KWIC.xsd] ([source:FederatedSearch/Resource-KWIC.xsd?format=txt download]). \\ |
329 | | Type: {{{application/x-clarin-fcs-kwic+xml}}} \\ |
330 | | Example for a keyword-in-context data view (formatted for brevity): |
331 | | {{{#!xml |
332 | | <fcs:DataView type="application/x-clarin-fcs-kwic+xml"> |
333 | | <kwic:kwic xmlns:kwic="http://clarin.eu/fcs/1.0/kwic"> |
334 | | <kwic:c type="left">Some text with the </kwic:c> |
335 | | <kwic:kw>keyword</kwic:kw> |
336 | | <kwic:c type="right">highlighted.</kwic:c> |
337 | | </kwic:kwic> |
| 345 | The ''Geolocation'' Data View allows to geolocalize a 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]. |
| 346 | |
| 347 | * Example: |
| 348 | {{{#!xml |
| 349 | <!-- potential @pid and @ref attributes omitted --> |
| 350 | <fcs:DataView type="application/vnd.google-earth.kml+xml"> |
| 351 | <kml xmlns="http://www.opengis.net/kml/2.2"> |
| 352 | <Placemark> |
| 353 | <name>IDS Mannheim</name> |
| 354 | <description>Institut für Deutsche Sprache, R5 6-13, 68161 Mannheim, Germany</description> |
| 355 | <Point> |
| 356 | <coordinates>8.4719510,49.4883700,0</coordinates> |
| 357 | </Point> |
| 358 | </Placemark> |
| 359 | </kml> |