TMW-API Help | API-Version: 1.0.2 |
Fileversion: 2021-02-28
For detailed documentation see here.
Search the database.
The TMW-SolR api retrieves data from the Solr-database containing all information about objects, persons/institutions, thesaurus and exhibitions. The data can be returned in different formats. If no format is defined, a html page is displayed.
For easy use, the api is configured with a webserver url rewrite engine. For setting up the rewrite engine, see the documentation.
For data retrieval of a single record the simple pair of domain-id can be used. The query parameter is reduced to the integer of the id. The uri format is:
Without a format definition the defaultFormat setting is used.
If a language code is added, the format has to be defined.
The TMW-API offers four domains:
One record from the object domain in different formats:
https://data.tmw.at/object/164392# (default format) https://data.tmw.at/object/164392/rdf https://data.tmw.at/object/164392/xml https://data.tmw.at/object/164392/xml/en (with additional language parameter)
For data retrieval using the search functionality, a query string has to be used instead of the ID:
The query string can contain the following parameters seprated by the pipeline character |. The query string should be the first and can also be given in the simplified format.
; query string with special characters: =title :"I am a string with whitspaces (and brackets)" ; comma separated list of values: =title :"Haus mit Dach,Dampf*" ; only a list of ids: 30123,30125 "30123,30125"
https://data.tmw.at/object/query=title:*Silberpfeil* https://data.tmw.at/object/title:*Silberpfeil*|limit=2/rdf https://data.tmw.at/object/164392/xml https://data.tmw.at/object/query=title:*Silberpfeil*/xml/en (with additional language parameter)
A date range search is supported with the extra parameter .
The range parameter can consist three values,
={start_date} ,{end_date} [,{search_type} ]
The type determines, how the date range is used to find
corresponding records. If no type is defined,
: start_date and end_date have to be inside the object start/end dating. Object dating start end Search dates start_date end_date
: start_date or end_date have to be inside the object start/end dating, Object dating start end Search dates start_date e._d. s_d. end_date or the object dating range is completely inside the search dates. Object dating start end Search dates start_date end_date
https://data.tmw.at/object/query=*:*|range=1850,1900,inner https://data.tmw.at/object/query=*:*|range=1850,1900,outer
A predefined search is a query string, set up in an ini file, where
the search string is represented by
The search definition is done in the
[object] ="object_name_broader:*{}* OR title:*{}* OR description:*{}* OR object_number:{}*"
In this example, the search is done in the fields , and , using left and right side truncation in all cases.
https://data.tmw.at/object/search=default:dampf*
It is possible to set up global filters for each domain stored as {domainName}.ini in the config directory. In each config file multiple filters can be defined, witch can contain include and exclude parameters. Includes are AND joined with the query, Excludes are AND NOT joined.
The filters are used by adding the =
Two filters are currently defined:
https://data.tmw.at/object/object_name_broader:personenkraftwagen https://data.tmw.at/object/object_name_broader:personenkraftwagen|filter=exhibited
Multiple filters are AND joined. A filter is a global preselection and can be combined with any spezial query string.
The facet parameter can contain a comma separated list of fields. With
=
The following facets are defined in the config.ini:
With the format parameter the output of the api can be controlled. Without a format definition the defaultFormat set in the config.ini.
There are several formats available for the different demains:
By adding a language code as last parameter, the data is returned in the corresponding language. If this language does not exist, the default language is returned instead. The default language code is set in the config.ini.
The supported language codes are:
The preprocessor can be used to change data loaded from the SolR database, before it is transformed in the output format. The following preprocessors are available: