The following documention outlines the API calls for the Ontario Data Extraction Service and Infrastructure Application (ODESI) which harvests data from several sources including IPCSR, CORA, Dataverse, etc. These API calls are the same as used by the ODESI application itself and can be used by your institution to provide your users with an alternate interface to access these resources. 

Searching

Searching for records in ODESI can be done by calling the Base URL 'http://search1.odesi.ca/search?requestURL=' followed by your search parameters as outlined below, and ending with the URL encoded string '%26options%3Dodesi-opts2%26format%3Djson' which specifies the search options and format type (either json or xml). 

The entire search request is to be surrounded in round brackets with each search term also surrounded with round brackets.
E.g to search for 'smoking' you would add '((smoking))' to the Base URL as follows http://search1.odesi.ca/search?requestURL=((smoking))%26options%3Dodesi-opts2%26format%3Djson

Filter

To filter your search, prefix one of the following two letter codes to your search term; VL for Variable/Category Label, TI for Title, KW for Keywords, AB for Abstract, SE for Series.
E.g to search for 'smoking' in the title of a record, add  '((TI:smoking))' to the end of the Base URL as follows http://search1.odesi.ca/search?requestURL=((TI:smoking))%26options%3Dodesi-opts2%26format%3Djson

Sort

To sort the search results by 'date', add 'AND (sort:date)' within the search request as follows  http://search1.odesi.ca/search?requestURL=((TI:smoking)) AND (sort:date)%26options%3Dodesi-opts2%26format%3Djson

Limiting Results 

To restrict the search results after a specific year (say 1999), add 'AND (date GE 1999)' within the search request as follows  http://search1.odesi.ca/search?requestURL=((TI:smoking)) AND (date GE 1999)%26options%3Dodesi-opts2%26format%3Djson 

To restrict the search results before a specific year (say 1999), add 'AND (date LE 1999)' within the search request as follows http://search1.odesi.ca/search?requestURL=((TI:smoking)) AND (date LE 1999)%26options%3Dodesi-opts2%26format%3Djson 

Paging Results

By default, the first page of results is returned. To go to another page of results, append "%26start%3D" plus the page number to be returned. E.g. http://search1.odesi.ca/search?requestURL=((smoking))%26options%3Dodesi-opts2%26format%3Djson%26start%3D2 for page 2.

More Results Pre Page

Also, by default, only 10 results are returned at a time. To increase the number of results to another amount append "%26pageLength%3D" plus the number results desired (noting the maximum number of results is dependant on your search criteria). E.g. http://search1.odesi.ca/search?requestURL=((smoking))%26options%3Dodesi-opts2%26format%3Djson%26pageLength%3D100 for 100 results.

 

Searches can be quite complex afforded by the underlying MarkLogic database. See https://docs.marklogic.com/guide/search-dev/string-query#id_98389 for examples of more complex searches.

 

To retrieve the metadata for a record, take the URI of a record and append to the end of the GetDetails Base URL 'http://search1.odesi.ca/getDetails?requestURL='.
E.g to show the metadata for the first record of the 'smoking' search results, add '/odesi/sos-82M0008E-E-1994.xml' to the end of the GetDetails Base URL as follows http://search1.odesi.ca/getDetails?requestURL=/odesi/sos-82M0008E-E-1994.xml&format=xml

Results

The returned search response is comprised of the following pertinent information

Parameter
Explanation
Type
totalThe total number of resultsnumeric
startThe starting record of the results pagenumeric
page-lengthThe number of results from the requestnumeric
resultsThe search records returnedObject

The search records returned are comprised of the following information.

Parameter
Explanation
Type
indexThe response numberNumeric
idThe internal id of the recordString
uriThe unique resource identifierString
matchesThe node in the XML file where the search word was found. Includes 'path and 'match-text' attributesObject
metadata

Houses the 'abstract' attribute for the record,

the 'AuthEnty_affiliation' listing the party(s) responsible for the record,

the 'AuthEnty' listing the Authoritative Entity(s),

the 'prodPlac' listing the production place(s),

'keyword'(s),

'producer' where the data was produced,

the 'date' showing the production year for the data,

and 'TI-facet' attribute which represents the title

Object

News Feed

The ODESI harvesters run nightly looking for updates across multiple data repositories. When new resources are made available, the RSS News Feed is updated. To stay abreast of the latest resources available through ODESI please connect your prefered RSS Feed Reader to http://search2.odesi.ca/rss?lang= for XML and http://search1.odesi.ca/feed for json

Additional Documentation

One of the systems which ODESI harvests from is Nesstar. To harvest directly from Nesstar please refer to the following documentation http://www.nesstar.com/software/public_api.html

  • No labels