TMW-SolR output formats API-Version: 1.0.2

Version 2017-09-25

Index

help#format

Format Postprocessor

Most formats returning XML code can be converted to a JSON structure or a associative PHP array. This is done by adding the wanted format postprocessor after the format string, separated by a : character:

	/object/164392/media
	/object/164392/media:json
	/object/164392/media:php
	

When the standard metadata is wanted in json or php, the format attribute can be left only using json or php as format attribute:

	/object/164392/json
	/object/164392/php
	

HTML

The HTML format is the default format, if no parameter is given. It can be also selected by adding /html to the normal api access uri, or = html using the direct http parameter queue. It shows the data in human readable format as simple html page. All references to either data present in the api, or external links to resources in the net are hyperlinks and can directly be followed.

XML

The XML format returns a xml structure containing the SolR data and api status informations:

	<api>

	; list of records
		<recordList>
			<record>
				<{field_name}>{field_value}<{field_name}>
				...

		2015-08-06 FORMAT CHANGE
				<{field_name} ="list">
					<text [='{attribute}']> ; attributes are optional
						<string>{field_value[1]}<string> ; field value in field list encapsuled in <string> tag
					</text>
					
					<text>...<text>
					
				</{field_name}>
				...

			; optional open data links
			; ilinks are direct links to open data resources
			; data can be resolved automatically using the resolve preprocessor
				<ilinks type="list">
					<link>
						<uri>uri</uri>

					; resolved data if resolve preprocessor is activated
						<linkedData>
							<pageName>{name_of_platform}</PageName>
							<id>{pageID}</id>
							<title>{title_of_page}</title>
							<summary>{page_summary}</summary>
						</linkedData>

					</link>

					<link>
						...
					</link>
					...
				</ilinks>

			; elinks are inderect links from the open data resource to further links
			; elinks can't be resolved
				<elinks type="list">
					; same format as ilinks list
					...
				</elinks>

			</record>
		</recordList>


	; section with facet data
		<facets>

			; facet fields (text content)
			<{facet_name}>
				<text ='{number of records}'>{keyword}</text>
				...
			</{facet_name}>
			...


			; date range facet
			<facet_ranges>
				; date values are formatted as ISO date: YYYY-MM-DDThh:mm:ssZ
				<isodate ='{number of records}'>{iso_date}</text>
				...
			</facet_ranges>
			...
		</facets>

	; api status section
		<status>
			<infos>
				<num>{num of infos}</num>
				<info>{info text}</info>
				...
				
				; info tags can have alternate names
				; query, filter, version and root are permanent api informations
				<query>{search query}</query>
				<filter>{comma separated list of active query filters}</filter>
				<version>{api software version}</version>
				<root>{api domain root}</root>
				...
			</infos>
			<warnings>
				<num>{num of warnings}</num>
				<warning>{warning text}</warning>
				...
			</warnings>
			<errors>
				<num>{num of errors}</num>
				<error>{error text}</error>
				...
			</errors>
			<count>
				<num>{number of records found}</num>
				<start>{number of first retreaved record}</start>
				<limit>{max records retreaved}</limit>
			</count>
		</status>
	</api>
	

RDF

The link format returns only a list of external links. Combined with the resolve preprocessor it is possible to get the link list enriched with the open data, without the metadata of the dataset. This method can be used to get the link resolve in a second step, without the need of waiting for the open data resource reply.

JSON

This format is a representation of the xml data in a json structure. XML-attributes are listed in the @attributes parameter.

	{

	; list of records
	; content identical to xml version

		"recordList": {
			"record": {
				"id": {recordId},
				"object_number": "{object_number}"
				...
				"object_name": {
					"@attributes: {
						"type": "list"
					},
					"text": [
						{object_name_1},
						{object_name_2},
						...
					]
				},
				...
			},
			"record": {
				...
			},
			...
		},

	; content identical to xml version
		"facets" {
			...
		},

	; content identical to xml version
		"status": {
			...
		}
	}
	

PHP

The PHP format is a representation of the xml data in a PHP associative array. XML-attributes are listet in t @attributes subarray.

Media data

media

The media format returns a xml structure containing the meta data to the linked images. It is a api-standard xml file where in the status/count/num tag the number of available images are set. The records contain the metadata to the different images.

	<api>
		<recordList>
			<record>
				<id>{record_id}<id>
				<name>{image_file_name}<name>
				<resource ="image" ="{format}">{api_link_to_image_data}<resource>
			</record>
		</recordList>

		<status>
			<count>
				<num>{number of images found}</num>
			</count>
		</status>
	</api>
	

thumb/preview/download

The thumb, preview and download formats returns image/jpg data in the corresponding resolution, which are set in the xsl-templates. If used with the query-search function, the image of the first record in the list is returned.

An additional parameter can be added after the format definition, for direct access of another than the first image.

	/object/72357/preview
	/object/72357/preview/1
	

for the first image,

/object/72357/preview/2

for the second image.