Passengers in History Search Index
URL: https://data.history.sa.gov.au:8983/solr/passengers/select
Passengers in History API Documentation
The Passengers in History data endpoint has been provided using an Apache Solr index (see https://lucene.apache.org/solr/) that uses a Drupal Solr 4.x schema (see https://www.drupal.org/project/search_api_solr). See https://wiki.apache.org/solr/QueryParametersIndex for more detail surrounding the query syntax.
An example of a basic implementation can be viewed at https://data.history.sa.gov.au/gallery_pih.php?type=vessel&startindex=0
Replace the type parameter with any of the types listed below to return associated images eg. https://data.history.sa.gov.au/gallery_pih.php?type=passenger&startindex=0
The example code can be downloaded from https://data.history.sa.gov.au/gallery_pih.php.txt
The open_data index contains 7 different types of content:
- voyage
- passenger
- vessel
- master
- port
- source
- organisation
Additionally, the photo index (photo_index) can be used to retrieve photos (specify the index using the index_id query parameter).
A voyage is centric to most other content types contains references to passengers, vessels and ports. A join query should be used to get information about related content (see https://wiki.apache.org/solr/Join for information surrounding the query syntax for joins). The is_nid field is the unique identifier.
The number of rows per query is limited to 999 so the start and rows query parameters would need to be used to iterate over the entire result set.
There are many response formats available (see https://cwiki.apache.org/confluence/display/solr/Response+Writers). Just add the parameter 'wt' to the query and select the response format eg. json or csv. The default is xml.
Examples
A typical workflow might be:
Get the voyage/s that arrived in 1836:
Use a join to get the passengers for one of the voyages (use the voyage is_nid field)
Use a join to find the origin and destination of a particular voyage:
Use a join to find the vessel for the voyage:
Use a join to find photos of the vessel (using the vessel is_nid):
Use a join to find out where a vessel was built (using the vessel is_nid):
Use a join to find the built by organisation for a particular vessel:
Get organisation details (using the organisation is_nid):
Or find all vessels built by the organisation (using the organisation is_nid):
Other Useful Queries
Find all photos that are attached to a passenger:
data.history.sa.gov.au:8983/solr/passengers/select?q={!join from=is_nid to=im_file_usage_list}ss_type:(passenger OR image)
Or find all passengers that have a photo attached (the reverse):
data.history.sa.gov.au:8983/solr/passengers/select?q={!join from=im_file_usage_list to=is_nid}ss_type:(passenger OR image)
All fields are searchable (see listing below). There are many search options using the Apache Solr query syntax. For instance to find all vessels that have the word ‘Adelaide’ in their tm_title field but not the word ‘port’:
data.history.sa.gov.au:8983/solr/passengers/select?q=index_id:open_data AND ss_type:vessel AND tm_title:(adelaide -port)
In this case ss_type is specifically set to be ‘vessel’. The – represents negation of the term. There are many more options – refer to a good blog here https://yonik.com/solr/query-syntax/
Facet search on the voyage destination for a date range between 1834 and 1836:
https://data.history.sa.gov.au:8983/solr/passengers/select?rows=0&q={!join%20from=is_nid%20to=is_field_destination}index_id:open_data&fq=ds_field_depart_date:[1834-01-01T00:00:00Z%20TO%201836-12-31T12:59:59Z]&facet=on&facet.field=is_field_destination
In this case use a port search by node to get the titles of the ports eg.(using the first facet):
The answer is most likely to be Sydney!
Content Type Fields
Passenger
- is_nid
- ss_type
- tm_field_occupation
- tm_field_surname
- tm_field_firstname
- is_field_age
- is_arrival_year
Voyage
- is_nid
- ss_type
- ds_field_depart_date
- is_field_destination
- tm_field_master
- is_field_origin
- is_field_vessel
- is_field_voyage_year
- tm_title
Vessel
- is_nid
- ss_type
- tm_title
- tm_field_services
- im_field_sources
- is_field_year_end
- is_field_year_start
- is_field_built_by
- is_field_built_where
- is_field_built_year
- tm_field_demise
- tm_field_rig
- tm_field_dimensions
- tm_field_tonnage
Source
- is_nid
- ss_type
- tm_title
- tm_field_location
- tm_field_reference
Port
- is_nid
- ss_type
- tm_title
Organisation
- is_nid
- ss_type
- tm_title
Photos
- is_fid: Unique ID for a file
- tm_field_citation: Includes copyright information
- tm_field_file_image_title_text: Image title
- tm_field_location: Location of the image
- tm_field_source: Source of the image
- is_file_usage_count: Number of times this file is used in passengersinhistory.sa.gov.au
- im_file_usage_list: List of content that uses this file
- ss_url: Url to the file
There are no views created for this resource yet.
Additional Information
Last updated | 28 June 2016 |
---|---|
Created | 28 June 2016 |
Format | API |
License | Creative Commons Attribution |