Skip to content

Instantly share code, notes, and snippets.

@danyx23
Last active November 22, 2019 16:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save danyx23/0f6877f394f8ea389a8e76402ee21f47 to your computer and use it in GitHub Desktop.
Save danyx23/0f6877f394f8ea389a8e76402ee21f47 to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.1",
"info": {
"title": "ToxPlanet Search Service",
"version": "3.0.0"
},
"servers": [
{
"url": "https://search-service.toxplanetdev.com",
"description": "Development server"
}
],
"paths": {
"/search/databases/chemical-identifiers": {
"post": {
"summary":"Search databases for documents assigned a specific chemical identifier.",
"description":"Search across all databases and collections for all documents that are about the substance specified.",
"operationId":"search_databases_for_chemical_id",
"parameters":[
{
"name":"page_number",
"in":"query",
"description":"Page Number.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"page_size",
"in":"query",
"description":"Page Size.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"sort_field",
"in":"query",
"description":"Name of the field to sort on.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"sort_direction",
"in":"query",
"description":"Direction to sort: asc or desc.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"include_document_counts",
"in":"query",
"description":"Include aggregated document counts across all collections for the chemical identifier.",
"required":false,
"schema": {
"type": "boolean"
}
}
],
"requestBody":{
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"chemical_identifier": {
"description": "Substance's Chemical Identifier. Currently only CAS numbers are valid chemical identifiers.",
"type": "string",
"x-orn-@type": "cas"
},
"filter":{
"$ref": "#/components/schemas/searchFilter"
}
},
"required": ["chemical_identifier"]
}
}
}
},
"responses": {
"200":{
"description": "List of databases, collections and documents that match the search criteria.",
"content": {
"application/json": {
"x-orn:returns": "application/json",
"schema": {
"type":"object",
"allOf":[
{
"$ref": "#/components/schemas/searchResultStandardPaging"
},
{
"type":"object",
"properties": {
"databases":{
"description": "List of databases that contain documents that match the search.",
"type":"array",
"items":{
"$ref": "#/components/schemas/searchResultDatabase"
},
"nullable": true
},
"document_count_details":{
"description": "Document counts.",
"type":"object",
"properties": {
"total_documents":{
"description": "Total number of documents that have been assigned the chemical identifier.",
"type":"integer"
},
"document_counts":{
"description": "List of document count details.",
"type":"array",
"items":{
"$ref": "#/components/schemas/identifierCountResult"
}
}
},
"nullable": true
}
}
}
],
"nullable": true
}
}
}
},
"403":{
"description": "Acess denied.",
"content": {
"application/json": {
"x-orn:returns": "application/json",
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"500":{
"description": "Internal server error.",
"content": {
"application/json": {
"x-orn:returns": "application/json",
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"default":{
"description": "Unexpected error.",
"content": {
"application/json": {
"x-orn:returns": "application/json",
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"security": [
{
"publicSearchService": []
}
]
}
},
"/search/databases/{database_id}/chemical-identifiers": {
"post": {
"summary":"Search the database with database_id for documents assigned a specific chemical identifier.",
"description":"Search across a single database and its collections for all documents that are about the substance specified.",
"operationId":"search_database_for_chemical_id",
"parameters":[
{
"name": "database_id",
"in": "path",
"description": "Id of database to search.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name":"page_number",
"in":"query",
"description":"Page Number.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"page_size",
"in":"query",
"description":"Page Size.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"sort_field",
"in":"query",
"description":"Name of the field to sort on.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"sort_direction",
"in":"query",
"description":"Direction to sort: asc or desc.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"include_document_counts",
"in":"query",
"description":"Include aggregated document counts across all collections for the chemical identifier.",
"required":false,
"schema": {
"type": "boolean"
}
}
],
"requestBody":{
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"chemical_identifier": {
"description": "Substance's Chemical Identifier. Currently only CAS numbers are valid chemical identifiers.",
"type": "string"
},
"filter":{
"$ref": "#/components/schemas/searchFilter"
}
},
"required": ["chemical_identifier"]
}
}
}
},
"responses": {
"200":{
"description": "Collections and documents for a database that match the search criteria.",
"content": {
"application/json": {
"schema": {
"type":"object",
"allOf":[
{
"$ref": "#/components/schemas/searchResultStandardPaging"
},
{
"type":"object",
"properties": {
"databases":{
"description": "List of databases that contain documents that match the search.",
"type":"array",
"items":{
"$ref": "#/components/schemas/searchResultDatabase"
},
"nullable": true
},
"document_count_details":{
"description": "Document counts.",
"type":"object",
"properties": {
"total_documents":{
"description": "Total number of documents that have been assigned the chemical identifier.",
"type":"integer"
},
"document_counts":{
"description": "List of document count details.",
"type":"array",
"items":{
"$ref": "#/components/schemas/identifierCountResult"
}
}
},
"nullable": true
}
}
}
],
"nullable": true
}
}
}
},
"403":{
"description": "Acess denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"500":{
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"default":{
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"security": [
{
"publicSearchService": []
}
]
}
},
"/search/databases/fts": {
"post": {
"summary":"Full Text Search Across all Databases.",
"description":"Perform a Full text Search across all databases and collections for all documents that satisfy the search request.",
"operationId":"fts_search_databases",
"parameters":[
{
"name":"page_number",
"in":"query",
"description":"Page Number.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"page_size",
"in":"query",
"description":"Page Size.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"sort_field",
"in":"query",
"description":"Name of the field to sort on.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"sort_direction",
"in":"query",
"description":"Direction to sort: asc or desc.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"include_document_counts",
"in":"query",
"description":"Include aggregated document counts across all collections for the chemical identifier.",
"required":false,
"schema": {
"type": "boolean"
}
},
{
"name":"include_highlights",
"in":"query",
"description":"Include hit highlights in search results.",
"required":false,
"schema": {
"type": "boolean"
}
}
],
"requestBody":{
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"search_request": {
"description": "Boolean supported full text search expression.",
"type": "string"
},
"filter":{
"$ref": "#/components/schemas/searchFilter"
}
},
"required": ["search_request"]
}
}
}
},
"responses": {
"200":{
"description": "List of databases, collections and documents that match the search request.",
"content": {
"application/json": {
"schema": {
"type":"object",
"allOf":[
{
"$ref": "#/components/schemas/searchResultStandardPaging"
},
{
"type":"object",
"properties": {
"databases":{
"description": "List of databases that contain documents that match the search.",
"type":"array",
"items":{
"$ref": "#/components/schemas/fullTextSearchResultDatabase"
}
}
}
},
{
"allOf":[
{
"type":"object",
"properties": {
"document_count_details":{
"$ref": "#/components/schemas/searchTermCountResult"
}
}
},
{
"nullable":true
}
]
}
]
}
}
}
},
"403":{
"description": "Acess denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"500":{
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"default":{
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"security": [
{
"publicSearchService": []
}
]
}
},
"/search/databases/{database_id}/fts": {
"post": {
"summary":"Full Text Search Across a Databases.",
"description":"Perform a Full text Search across a single databases and collections for all documents that satisfy the search request.",
"operationId":"fts_search_database",
"parameters":[
{
"name":"database_id",
"in":"path",
"description":"Database Id.",
"required":true,
"schema": {
"type": "string"
}
},
{
"name":"page_number",
"in":"query",
"description":"Page Number.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"page_size",
"in":"query",
"description":"Page Size.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"sort_field",
"in":"query",
"description":"Name of the field to sort on.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"sort_direction",
"in":"query",
"description":"Direction to sort: asc or desc.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"include_document_counts",
"in":"query",
"description":"Include aggregated document counts across all collections for the chemical identifier.",
"required":false,
"schema": {
"type": "boolean"
}
},
{
"name":"include_highlights",
"in":"query",
"description":"Include hit highlights in search results.",
"required":false,
"schema": {
"type": "boolean"
}
}
],
"requestBody":{
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"search_request": {
"description": "Boolean supported full text search expression.",
"type": "string"
},
"filter":{
"$ref": "#/components/schemas/searchFilter"
}
},
"required": ["search_request"]
}
}
}
},
"responses": {
"200":{
"description": "List of databases, collections and documents that match the search request.",
"content": {
"application/json": {
"schema": {
"type":"object",
"allOf":[
{
"$ref": "#/components/schemas/searchResultStandardPaging"
},
{
"type":"object",
"properties": {
"databases":{
"description": "List of databases that contain documents that match the search.",
"type":"array",
"items":{
"$ref": "#/components/schemas/fullTextSearchResultDatabase"
}
}
}
},
{
"allOf":[
{
"type":"object",
"properties": {
"document_count_details":{
"$ref": "#/components/schemas/searchTermCountResult"
}
}
},
{
"nullable":true
}
]
}
]
}
}
}
},
"403":{
"description": "Acess denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"500":{
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"default":{
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"security": [
{
"publicSearchService": []
}
]
}
},
"/search/databases/fields": {
"post": {
"summary":"Search on a specific field in documents in all databases.",
"description":"Search across all databases and collections for all documents that satisfy the search request. The search request is applied against the field-to-search.",
"operationId":"search_document_fields",
"parameters":[
{
"name":"page_number",
"in":"query",
"description":"Page Number.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"page_size",
"in":"query",
"description":"Page Size.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"sort_field",
"in":"query",
"description":"Name of the field to sort on.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"sort_direction",
"in":"query",
"description":"Direction to sort: asc or desc.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"include_document_counts",
"in":"query",
"description":"Include aggregated document counts across all collections for the chemical identifier.",
"required":false,
"schema": {
"type": "boolean"
}
}
],
"requestBody":{
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"field_to_search": {
"description": "The document field to apply the search request to.",
"type": "string"
},
"search_request": {
"description": "Boolean supported full text search expression.",
"type": "string"
},
"range_term": {
"description": "The range search term to apply. Search request and range term are mutually exclusive.",
"type": "object",
"properties": {
"gt":{
"description":"Greater than.",
"type":"number"
},
"lt":{
"description":"Less than.",
"type":"number"
},
"gte":{
"description":"Greater thanor equal.",
"type":"number"
},
"lte":{
"description":"Less than or equal.",
"type":"number"
},
"eq":{
"description":"Equal to.",
"type":"number"
}
}
},
"filter":{
"$ref": "#/components/schemas/searchFilter"
}
},
"oneOf":[
{"required": ["search_request"]},
{"required": ["range_term"]}
]
}
}
}
},
"responses": {
"200":{
"description": "List of databases, collections and documents that match the search request.",
"content": {
"application/json": {
"schema": {
"type":"object",
"allOf":[
{
"$ref": "#/components/schemas/searchResultStandardPaging"
},
{
"type":"object",
"properties": {
"databases":{
"description": "List of databases that contain documents that match the search.",
"type":"array",
"items":{
"$ref": "#/components/schemas/searchResultDatabase"
}
}
}
},
{
"allOf":[
{
"type":"object",
"properties": {
"document_count_details":{
"$ref": "#/components/schemas/searchTermCountResult"
}
}
},
{
"nullable":true
}
]
}
]
}
}
}
},
"403":{
"description": "Acess denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"500":{
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"default":{
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"security": [
{
"publicSearchService": []
}
]
}
},
"/search/databases/{database_id}/fields": {
"post": {
"summary":"Search on a specific field in documents in a database.",
"description":"Search across a database and its collections for all documents that satisfy the search request. The search request is applied against the field-to-search.",
"operationId":"search_document_fields_in_a_database",
"parameters":[
{
"name":"database_id",
"in":"path",
"description":"Database Id.",
"required":true,
"schema": {
"type": "string"
}
},
{
"name":"page_number",
"in":"query",
"description":"Page Number.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"page_size",
"in":"query",
"description":"Page Size.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"sort_field",
"in":"query",
"description":"Name of the field to sort on.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"sort_direction",
"in":"query",
"description":"Direction to sort: asc or desc.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"include_document_counts",
"in":"query",
"description":"Include aggregated document counts across all collections for the chemical identifier.",
"required":false,
"schema": {
"type": "boolean"
}
}
],
"requestBody":{
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"field_to_search": {
"description": "The document field to apply the search request to.",
"type": "string"
},
"search_request": {
"description": "Boolean supported full text search expression.",
"type": "string"
},
"range_term": {
"description": "The range search term to apply. Search request and range term are mutually exclusive.",
"type": "object",
"properties": {
"gt":{
"description": "Greater than.",
"type":"number"
},
"lt":{
"description": "Less than.",
"type":"number"
},
"gte":{
"description": "Greater than or equal.",
"type":"number"
},
"lte":{
"description": "Less than or equal.",
"type":"number"
},
"eq":{
"description": "Equal to.",
"type":"number"
}
}
},
"filter":{
"$ref": "#/components/schemas/searchFilter"
}
},
"oneOf":[
{"required": ["search_request"]},
{"required": ["range_term"]}
]
}
}
}
},
"responses": {
"200":{
"description": "List of databases, collections and documents that match the search request.",
"content": {
"application/json": {
"schema": {
"type":"object",
"allOf":[
{
"$ref": "#/components/schemas/searchResultStandardPaging"
},
{
"type":"object",
"properties": {
"databases":{
"description": "List of databases that contain documents that match the search.",
"type":"array",
"items":{
"$ref": "#/components/schemas/searchResultDatabase"
}
}
}
},
{
"allOf":[
{
"type":"object",
"properties": {
"document_count_details":{
"$ref": "#/components/schemas/searchTermCountResult"
}
}
},
{
"nullable":true
}
]
}
]
}
}
}
},
"403":{
"description": "Acess denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"500":{
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"default":{
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"security": [
{
"publicSearchService": []
}
]
}
},
"/search/expert-index": {
"post": {
"summary":"Search EXPERTIndex.",
"description":"Search EXPERTIndex using chemical names, synonyms and molecular formula.",
"operationId":"search_expert_index",
"parameters":[
{
"name":"page_number",
"in":"query",
"description":"Page Number.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"page_size",
"in":"query",
"description":"Page Size.",
"required":false,
"schema": {
"type": "integer",
"minimum":1
}
},
{
"name":"sort_field",
"in":"query",
"description":"Name of the field to sort on.",
"required":false,
"schema": {
"type": "string"
}
},
{
"name":"sort_order",
"in":"query",
"description":"Direction to sort: asc or desc.",
"required":false,
"schema": {
"type": "string"
}
}
],
"requestBody":{
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"search_term": {
"description": "Term to search for (chemical name, synonym or molecular formula).",
"type": "string"
},
"search_type": {
"description": "Type of search to perform.",
"type": "string",
"enum": ["starts_with","contains","exact_match"]
}
}
}
}
}
},
"responses": {
"200":{
"description": "List of databases, collections and documents that match the search criteria.",
"content": {
"application/json": {
"schema": {
"type":"object",
"allOf":[
{
"$ref": "#/components/schemas/eiResultPaging"
},
{
"type":"object",
"properties": {
"search_results":{
"description": "List of chemicals that match the search.",
"type":"array",
"items":{
"type":"object",
"properties": {
"chemical_identifier":{
"description": "The chemical identifier",
"type":"string"
},
"chemical_name":{
"description": "The chemical name/synonym.",
"type":"string"
},
"chemical_number":{
"description": "The chemical number.",
"type":"string"
},
"chemical_formula":{
"description": "The chemical formula.",
"type":"string"
},
"id":{
"description": "Unique Id assigned to the chemical.",
"type":"string"
}
}
}
}
}
}
]
}
}
}
},
"403":{
"description": "Acess denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"500":{
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"default":{
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"security": [
{
"publicSearchService": []
}
]
}
},
"/documents/{id}": {
"get": {
"summary":"Retrieve a Document.",
"description":"By default, this api call retrieves the url to the document. It does not retrieve the document itself.",
"operationId":"get_document",
"parameters":[
{
"name":"id",
"in":"path",
"description":"Id of the document to retrieve.",
"required":true,
"schema": {
"type": "string"
}
},
{
"name":"transform",
"in":"query",
"description":"If set to true and if the document is xml and has an assigned xslt, transform the document and return the url to the result.",
"required":false,
"schema": {
"type": "boolean",
"default": false
}
},
{
"name":"follow_redirect",
"in":"query",
"description":"Instead of returning url to document, respond with an http redirect to the document.",
"required":false,
"schema": {
"type": "string",
"enum":["true","false","pdf"],
"default":"false"
}
}
],
"responses": {
"200":{
"description": "Document location information.",
"content": {
"application/json": {
"schema": {
"type":"object",
"properties": {
"document_url":{
"description": "Url to document.",
"type":"string"
},
"document_stylesheet_url":{
"description": "Document stylesheet if applicable.",
"type":"string"
},
"document_type":{
"description": "Document type.",
"type":"string"
}
},
"example":{
"summary":"Xml document with a stylesheet.",
"value":{
"document_url": "http://webservice.toxplanet.com/documents/8ehq.xml",
"document_type":"xml",
"document_stylesheet_url": "http://files.toxplanet.com/ecis/stylesheets/show.xslt"
}
}
}
}
}
},
"403":{
"description": "Acess denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"500":{
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"default":{
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"security": [
{
"publicSearchService": []
}
]
}
},
"/documents/aggregations/counts/chemical-identifiers": {
"post": {
"summary":"Retrieve Document Counts for list of chemical identifiers with filtering.",
"description":"Retrieve the document counts per database for a given list of chemical identifiers.",
"operationId":"document_counts_for_chemical_ids",
"requestBody":{
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"chemical_identifiers": {
"description": "List of 1 or more chemical identifiers separated by a comma. Currently only CAS numbers are valid chemical identifiers.",
"type": "string"
},
"filter":{
"$ref": "#/components/schemas/searchFilter"
}
},
"required": ["chemical_identifiers"]
}
}
}
},
"responses": {
"200":{
"description": "List of databases, collections and documents that match the search criteria.",
"content": {
"application/json": {
"schema": {
"type":"object",
"properties": {
"total_documents":{
"description": "Total count of all documents.",
"type":"integer"
},
"document_counts":{
"description": "List of Document counts for each chemical identifier submitted.",
"type":"array",
"items":{
"$ref": "#/components/schemas/identifierCountResult"
}
}
}
}
}
}
},
"403":{
"description": "Acess denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"500":{
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"default":{
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"security": [
{
"publicSearchService": []
}
]
}
},
"/databases": {
"get": {
"summary":"Get list of available databases.",
"description":"Get a list of available databases and their collections.",
"operationId":"get_databases",
"responses": {
"200":{
"description": "List of databases.",
"content": {
"application/json": {
"schema": {
"type":"array",
"items":{
"allOf":[
{
"$ref": "#/components/schemas/Database"
},
{
"properties": {
"database_created_at":{
"description": "Date the database was added to the system.",
"type":"integer"
},
"database_collections":{
"description": "Collections in the database.",
"type":"array",
"items":{
"$ref": "#/components/schemas/DatabaseCollection"
}
}
}
}
]
}
}
}
}
},
"403":{
"description": "Acess denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"500":{
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"default":{
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"security": [
{
"publicSearchService": []
}
]
}
},
"/databases/{database_id}": {
"get": {
"summary":"Get a single database.",
"description":"Get a single database and its collections.",
"operationId":"get_database",
"parameters":[
{
"name":"database_id",
"in":"path",
"description":"Id of database to retrieve.",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200":{
"description": "List of databases.",
"content": {
"application/json": {
"schema": {
"type":"object",
"allOf":[
{
"$ref": "#/components/schemas/Database"
},
{
"properties": {
"database_created_at":{
"description": "Date the database was added to the system.",
"type":"integer"
},
"database_collections":{
"description": "Collections in the database.",
"type":"array",
"items":{
"$ref": "#/components/schemas/DatabaseCollection"
}
}
}
}
]
}
}
}
},
"403":{
"description": "Acess denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"500":{
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"default":{
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"security": [
{
"publicSearchService": []
}
]
}
},
"/databases/{database_id}/collections/{collection_id}": {
"get": {
"summary":"Get a single database collection.",
"description":"Get a single database collection and its child collections.",
"operationId":"get_collection",
"parameters":[
{
"name":"database_id",
"in":"path",
"description":"Id of database to retrieve.",
"required": true,
"schema": {
"type": "string"
}
},
{
"name":"collection_id",
"in":"path",
"description":"Id of the collection to retrieve.",
"required": true,
"schema": {
"type": "string"
}
}
],
"responses": {
"200":{
"description": "A single database collection.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/DatabaseCollection"
}
}
}
},
"403":{
"description": "Acess denied.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"500":{
"description": "Internal server error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
},
"default":{
"description": "Unexpected error.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/error"
}
}
}
}
},
"security": [
{
"publicSearchService": []
}
]
}
}
},
"components": {
"securitySchemes": {
"publicSearchService": {
"type": "apiKey",
"name": "Authorization",
"in": "header"
}
},
"schemas": {
"searchFilter":{
"description": "Filter to applied to the search.",
"type":"object",
"properties": {
"must":{
"description": "The document 'must' match the filter clause.",
"type":"array",
"items":{
"$ref": "#/components/schemas/searchFilterClause"
}
},
"should":{
"description": "The document 'should' match the filter clause.",
"type":"array",
"items":{
"$ref": "#/components/schemas/searchFilterClause"
}
},
"must_not":{
"description": "The document 'must not' match the filter clause.",
"type":"array",
"items":{
"$ref": "#/components/schemas/searchFilterClause"
}
}
},
"nullable": true
},
"searchFilterClause":{
"description": "The filter clause.",
"type":"object",
"properties": {
"term":{
"description":"Term to match.",
"type":"object"
},
"terms":{
"description":"Terms to match.",
"type":"object"
},
"match":{
"description":"Expression to match",
"type":"object"
},
"range":{
"description":"Range to match",
"type":"object"
},
"exist":{
"description":"Test for existance of field",
"type":"object"
}
}
},
"searchResultDocument":{
"description": "Document search results.",
"type":"object",
"properties":{
"document_id":{
"description": "Unique id assigned to the document.",
"type":"string",
"example":"NTg5fDEyMDUyNzY5Ni54bWw"
},
"document_identifiers":{
"description": "Array of chemical identifiers assigned to the document.",
"type":"array",
"items":{
"type":"string"
},
"example": ["71-43-2","50-00-0"]
},
"collection_identifier":{
"description":"The id of the collection the document belongs to.",
"type":"string"
},
"collection_display_name":{
"description":"The name of the collection the document belongs to.",
"type":"string"
},
"document_file_name":{
"description": "The document's system file name",
"type":"string",
"example":"benzene.pdf"
},
"document_type":{
"description": "The type of file.",
"type":"string",
"example":"pdf"
},
"document_size":{
"description": "The size of the files in bytes.",
"type":"integer"
},
"document_title":{
"description": "The title of the document.",
"type":"string"
},
"document_categories":{
"description": "A list of categories the document belongs to.",
"type":"array",
"items":{
"type":"string"
},
"example":["Bibliographic Record(s)","Carcinogen"]
},
"document_tags":{
"description": "A list of tags assigned to the document.",
"type":"array",
"items":{
"type":"string"
}
},
"document_created_at":{
"description": "Date the document was added to the system.",
"type":"string",
"example":"2010-08-16T17:29:26.937Z"
},
"document_updated_at":{
"description": "Date the document was last updated in the system.",
"type":"string",
"example":"2016-07-02T23:36:57.383Z"
},
"document_meta":{
"description": "Document meta data.",
"type":"array",
"items":{
"$ref": "#/components/schemas/searchResultDocumentMeta"
},
"nullable": true,
"example":[
{
"meta_key": "PUBYEAR",
"meta_name": "Publication Year",
"meta_value_integer": 2001,
"meta_value_type": "integer"
},
{
"meta_key": "AUTHORS",
"meta_name": "Data Authors",
"meta_value_text": "Donner M;",
"meta_value_type": "text"
}
]
}
}
},
"fullTextSearchResultDocument":{
"description": "Document search results.",
"allOf":[
{
"$ref": "#/components/schemas/searchResultDocument"
},
{
"description": "Hit highlights.",
"type":"object",
"properties": {
"highlight":{
"description": "Hit highlight.",
"type":"object",
"properties": {
"document":{
"description": "Highlight location.",
"type":"array",
"items":{
"type":"string"
}
}
},
"nullable": true
}
}
}
]
},
"searchResultDocumentMeta":{
"type":"object",
"description": "Structure of the document meta data. Not all documents have meta, and not all meta_value types are used.",
"properties":{
"meta_key":{
"description": "Meta data item key.",
"type":"string",
"example":"AUTHORS"
},
"meta_name":{
"description": "Meta data item human readable name.",
"type":"string",
"example":"Data Authors"
},
"meta_value_text":{
"description": "The value of the meta data item.",
"type":"string"
},
"meta_value_integer":{
"description": "The value of the meta data item.",
"type":"integer"
},
"meta_value_float":{
"description": "The value of the meta data item.",
"type":"number"
},
"meta_value_boolean":{
"description": "The value of the meta data item.",
"type":"boolean"
},
"meta_value_type":{
"type":"string",
"description": "The type of meta data.",
"enum": ["text","integer","float","long","boolean"],
"example":"text"
}
}
},
"Collection":{
"description": "Collection the document belongs to.",
"type": "object",
"properties":{
"collection_id":{
"description": "The id of the collection.",
"type":"string"
},
"collection_display_name":{
"description":"The collection display name.",
"type":"string"
}
}
},
"Database":{
"description": "Database",
"type":"object",
"properties": {
"database_id":{
"description": "Id of database.",
"type":"string"
},
"database_display_name":{
"description": "Name of database",
"type":"string"
}
}
},
"DatabaseCollection":{
"type":"object",
"allOf": [
{
"$ref": "#/components/schemas/Collection"
},
{
"properties": {
"collection_children":{
"description": "Child collections.",
"type":"array",
"items":{
"$ref": "#/components/schemas/DatabaseCollection"
}
}
}
}
]
},
"searchResultCollection":{
"description": "Collection the documents belongs to.",
"allOf":[
{
"$ref": "#/components/schemas/Collection"
},
{
"type":"object",
"properties":{
"documents":{
"description": "List of documents in the collection.",
"type":"array",
"items":{
"$ref": "#/components/schemas/searchResultDocument"
},
"nullable": true
},
"collections":{
"description": "List of collections.",
"type":"array",
"items":{
"$ref": "#/components/schemas/searchResultCollection"
},
"nullable": true
}
}
}
]
},
"fullTextSearchResultCollection":{
"description": "Collection the documents belong to.",
"allOf":[
{
"$ref": "#/components/schemas/Collection"
},
{
"type":"object",
"properties":{
"documents":{
"description": "List of documents in the collection.",
"type":"array",
"items":{
"$ref": "#/components/schemas/fullTextSearchResultDocument"
}
},
"collections":{
"description": "List of collections.",
"type":"array",
"items":{
"$ref": "#/components/schemas/fullTextSearchResultCollection"
}
}
}
}
]
},
"searchResultDatabase":{
"description": "Collections and documents.",
"allOf":[
{
"$ref": "#/components/schemas/Database"
},
{
"type":"object",
"properties":{
"collections":{
"description": "List of collections.",
"type":"array",
"items":{
"$ref": "#/components/schemas/searchResultCollection"
},
"nullable": true
}
}
}
]
},
"fullTextSearchResultDatabase":{
"description": "Collections and documents.",
"type":"object",
"properties":{
"database_id":{
"description": "Id of database.",
"type":"string"
},
"database_display_name":{
"description": "Name fo database",
"type":"string"
},
"collections":{
"description": "List of collections.",
"type":"array",
"items":{
"allOf":[
{
"$ref": "#/components/schemas/searchResultCollection"
},
{
"type":"object",
"properties": {
"documents":{
"description": "List of documents in the collection.",
"type":"array",
"items":{
"$ref": "#/components/schemas/fullTextSearchResultDocument"
},
"nullable": true
},
"collections":{
"description": "List of collections.",
"type":"array",
"items":{
"$ref": "#/components/schemas/searchResultCollection"
},
"nullable": true
}
}
}
]
},
"nullable": true
}
}
},
"searchResultStandardPaging":{
"description": "Paging structure for results.",
"type":"object",
"properties": {
"page_number":{
"description": "Page number of the current page.",
"type":"integer",
"minimum": 1
},
"page_size":{
"description": "Page Size.",
"type":"integer"
},
"total_pages":{
"description": "Totla number of pages.",
"type":"integer"
},
"total_results":{
"description": "Total number of items that match the search criteria.",
"type":"integer"
}
}
},
"eiResultPaging":{
"description": "Paging structure for EXPERTIndex results.",
"type":"object",
"properties": {
"page_number":{
"description": "Page number of the current page.",
"type":"integer",
"minimum": 1
},
"page_size":{
"description": "Page Size.",
"type":"integer"
},
"total_pages":{
"description": "Totla number of pages.",
"type":"integer"
},
"total_items":{
"description": "Total number of items that match the search criteria.",
"type":"integer"
}
}
},
"identifierCountResult":{
"description": "Documents count details.",
"type":"object",
"properties":{
"chemical_identifier":{
"description": "Chemical identifier assigned to documents to include in the count.",
"type":"string"
},
"chemical_identifier_total_documents":{
"description": "Total number of documents that have been assigned the chemical identifier.",
"type":"integer"
},
"count_details":{
"description": "Details of the document count.",
"type":"array",
"items":{
"type":"object",
"properties": {
"database_id":{
"description": "Id of database.",
"type":"string"
},
"database_display_name":{
"description": "Name of database.",
"type":"string"
},
"database_document_count":{
"description": "Number of documents in the database that have been assigned the chemical identifier.",
"type":"integer"
},
"counts_by_collection":{
"description": "Details of the document count by collection.",
"type":"array",
"items":{
"type":"object",
"properties": {
"collection_id":{
"description": "Id of the collection.",
"type":"string"
},
"collection_display_name":{
"description": "Name of the collection.",
"type":"string"
},
"document_count":{
"description": "The number of documents in the collection that have been assigned the chemical identifier.",
"type":"integer"
}
}
}
}
}
}
}
}
},
"searchTermCountResult":{
"description": "Document count details.",
"type":"object",
"properties": {
"search_term":{
"description": "The search expression for which the documents match.",
"type":"string"
},
"total_documents":{
"description": "Total number of documents that match the search expression.",
"type":"integer"
},
"document_counts":{
"description": "Document count details by database and collection.",
"type":"array",
"items":{
"type":"object",
"properties": {
"database_id":{
"description": "The id of the database the document appears in.",
"type":"string"
},
"database_display_name":{
"description": "The name of the database the document appears in.",
"type":"string"
},
"database_document_count":{
"description": "The number of documents in the database that match the search expression.",
"type":"integer"
},
"counts_by_collection":{
"description": "The number of documents per collection that match the search expression.",
"type":"array",
"items":{
"type":"object",
"properties": {
"collection_id":{
"description": "The id of the collection the document appears in.",
"type":"string"
},
"collection_display_name":{
"description": "The name of the collection the document appears in.",
"type":"string"
},
"document_count":{
"description": "The number of documents in the collection that match the search expression.",
"type":"integer"
}
}
}
}
}
}
}
},
"nullable": true
},
"error":{
"description": "Error",
"type":"object",
"properties":{
"code":{
"description": "Error code.",
"type":"string"
},
"message":{
"description": "Error message.",
"type":"string"
}
}
}
}
},
"x-orn-@context": {
"@vocab": "http://openrisknet.org/schema#",
"x-orn": "http://openrisknet.org/schema#",
"x-orn-@id": "@id",
"x-orn-@type": "@type",
"cas": "http://semanticscience.org/resource/CHEMINF_000446"
},
"x-orn-@id": "https://search-service.toxplanetdev.com",
"x-orn-@type": "x-orn:Service"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment