Skip to content

JUSP API Documentation

Ioannis Latousakis edited this page Mar 9, 2015 · 31 revisions

JUSP API Documentation

Contents

jusp - titleInstitutionProvider

jusp - titleInstProvCoreStatus

jusp - coreTitles

jusp - addCoreAssertionDates

api - fetchAllTips

## jusp/titleInstitutionProvider

Description:

  • Given a jusp title identifier, a jusp institution identifier and optionally a jusp provider id, it returns a list maps of TitleInstitutionProvider json objects as keys, with a list of core dates as values.

Parameters:

  • jusp_ti: jusp title identifier
  • jusp_inst: jusp institution identifier
  • (optional)jusp_prov: jusp content provider id
  • format: response format, json/html

Example:

jusp/TitleInstitutionProvider?jusp_ti=5430&jusp_inst=abd&format=json

Returns:

JSON

{
  "data": {
    "com.k_int.kbplus.TitleInstitutionProvider : 2": [{
      "class": "com.k_int.kbplus.CoreAssertion",
      "id": 2,
      "endDate": "2013-12-31T23:59:59Z",
      "startDate": "2013-01-01T00:00:00Z",
      "tiinp": {
        "class": "com.k_int.kbplus.TitleInstitutionProvider",
        "id": 2
      }
    }]
  },
  "status": "ok",
  "count": 1
}

HTML

<table id="kb_tip_table">
    <thead>
      <tr>
        <td>TIP ID</td>
        <td>Core Date ID</td>
        <td>Start Date</td>
        <td>End Date</td>
      </tr>
    </thead>
    <tbody>              	
        <tr>
          <td>2</td>
          <td>6558</td>
          <td>1991-01-01</td>
          <td>1992-02-02</td>
        </tr>
        
        <tr>
          <td>2</td>
          <td>2</td>
          <td>2013-01-01</td>
          <td>2013-12-31</td>
        </tr>                    
    </tbody>
  </table>
## jusp/titleInstProvCoreStatus

Description:

Given the details for a TitleInstitutionProvider entry, it will evaluate CoreStatus for a given lookupDate, or today if none provided, and return true or false. The evaluation looks for the lookup date to be in range of one of the CoreAssertion dates of the given TIP.

Parameters:

  • jusp_ti: Jusp title identifier
  • jusp_inst: Jusp institution identifier
  • (optional)jusp_prov: Jusp content provider
  • (optional) lookupDate: The date to use for CoreStatus evaluation.Expected in yyyy-MM-dd format

Example:

jusp/titleInstProvCoreStatus?jusp_ti=5430&jusp_inst=abd&lookupDate=2014-10-15

Returns:

{
  "data": false,
  "status": "ok"
}

Errors:

Will return status:error when something is wrong, and also an error message under data.

{
   "data": "Required parameters: jusp_ti, jusp_inst, (optional) lookupDate ",
   "status": "error"
}
## jusp/coreTitles

Description:

Return all available jusp title identifiers, for the given institution and the given core date range. Results include the TIP, its jusp title identifier, and the list of core assertion dates.

Parameters:

  • jusp_inst: Jusp institution identifier
  • core_start: The earliest core start date for results
  • core_end: The latest core end date for results

Example:

/jusp/coreTitles?jusp_inst=abd&core_start=2013-2-1&core_end=2013-6-1

Returns:

{
  "data": "com.k_int.kbplus.TitleInstitutionProvider : 4": {
  "jusp_id": ["633"],
  "coreDateList": [{
    "class": "com.k_int.kbplus.CoreAssertion",
    "id": 4,
    "endDate": "2009-12-31T23:59:59Z",
    "startDate": "2009-01-01T00:00:00Z",
    "tiinp": {
      "class": "com.k_int.kbplus.TitleInstitutionProvider",
      "id": 4
    },
  "status": "ok",
  "count": 1
}
## jusp/addCoreAssertionDates

Description:

Given the details for a TitleInstitutionProvider, a core_start and optionally a core_end date, it will try to either extend current CoreAssertion dates if possible, else it will create a new one to represent this range. If no core_end date is provided, the CoreAssertion date will be null. It returns the resulting list of CoreAssertions for the given TitleInstitutionProvider. Dates need to be in yyyy-MM-dd format.

Parameters:

  • jusp_ti: Jusp title identifier
  • jusp_inst: Jusp institution identifier
  • (optional) jusp_prov: Jusp content provider
  • core_start: The start date for the CoreAssertion
  • (optional) core_end: The end date for CoreAssertion.

Example:

jusp/addCoreAssertionDates?jusp_ti=5430&jusp_inst=abd&core_start=2017-1-1&core_end=2018-2-5

Returns:

  {
    "data": [{
      "class": "com.k_int.kbplus.CoreAssertion",
      "id": 6560,
      "endDate": "2018-02-05T00:00:00Z",
      "startDate": "2017-01-01T00:00:00Z",
      "tiinp": {
        "class": "com.k_int.kbplus.TitleInstitutionProvider",
        "id": 2
      }
    }, {
      "class": "com.k_int.kbplus.CoreAssertion",
      "id": 6559,
      "endDate": "2015-02-05T00:00:00Z",
      "startDate": "2015-01-01T00:00:00Z",
      "tiinp": {
        "class": "com.k_int.kbplus.TitleInstitutionProvider",
        "id": 2
      }
    }],
    "status": "ok",
    "count": 2
  }

Errors:

Will return status:error when something is wrong, and also an error message under data.

{
   "data": "Required parameters: jusp_ti, jusp_inst, core_start, (optional) core_end",
   "status": "error",
   "count": 0
}
## api/fetchAllTips

Description:

This function will return a csv file, with all the jusp titles, jusp institutions, and their core dates. Core dates will be a comma separated list, as seen on example bellow. Currently the CSV file is ~1.5MB, and takes ~5s to download, although these might vary over time. The purpose of this call is to be used overnight by an automated service.

Returns:

CSV named: kbplus_jusp_export_${date}.csv

JUSP Institution ID JUSP Title ID Core Dates
abd 5424 2013-01-01 | 2013-12-31, 2009-01-01 | 2009-12-31
abd 5430 2013-01-01 | 2013-12-31
Clone this wiki locally