openapi: 3.0.3
info:
  title: eNanoMapper federated search
  description: Free text and faceted search on all components of selected project
    database
  termsOfService: https://enanomapper.adma.ai
  contact:
    name: IDEAconsult's technical support
    url: https://phabricator.ideaconsult.net
    email: support@ideaconsult.net
  license:
    name: API available under GNU Lesser General Public License
    url: http://www.gnu.org/licenses/lgpl.html
  version: "1.0"
externalDocs:
  description: Web-based eNanoMapper DB search user interface
  url: https://enanomapper.adma.ai
servers:
- url: https://api.ideaconsult.net/enanomapper
  description: eNanoMapper database
- url: https://api.ideaconsult.net/enanomapper
  description: NANoREG database
tags:
- name: Search
  description: Multi-DB aggregated free text and faceted search
- name: Structures
  description: Chemical structures
  externalDocs:
    url: https://github.com/ideaconsult/apps-ambit/blob/master/ambit-json-docs/
- name: Substances
  description: Chemical substances and (nano)materials
  externalDocs:
    url: https://github.com/ideaconsult/apps-ambit/blob/master/ambit-json-docs/substance.md
- name: Studies
  description: Measurements or calculations attached to a substance
  externalDocs:
    url: https://github.com/ideaconsult/apps-ambit/blob/master/ambit-json-docs/substance.md#study
- name: Data analysis
  description: Machine learning algorithms and models, property prediction models
  externalDocs:
    url: https://github.com/ideaconsult/apps-ambit/blob/master/ambit-json-docs
- name: Facets
  description: Summaries
  externalDocs:
    url: https://github.com/ideaconsult/apps-ambit/blob/master/ambit-json-docs
- name: Task service
  description: Asynchronous jobs
  externalDocs:
    url: https://github.com/ideaconsult/apps-ambit/blob/master/ambit-json-docs
paths:
  /select:
    summary: eNanoMapper Database aggregated search
    description: Apache Solr powered search for Nanosafety data
    get:
      tags:
      - Search
      summary: Apache Solr powered search
      description: This search is powered by [Apache Solr](https://solr.apache.org/)
        and accepts the standard Solr query syntax. If you need more information on
        the parameters and how to use them, check [this guide](https://solr.apache.org/guide/8_8/common-query-parameters.html).
        To better understand how to construct the queries, see also the schemas below.
        Both `GET` and `POST` are supported, with `GET` being simpler to use, but
        with restrictions on the complexity and the lenght of the parameters.
      operationId: solrquery_get
      parameters:
      - name: q
        in: query
        description: The query itself, in the form `<field_name>:<field_content>`.
          The wildcard operator `*` is accepted for both `<field_name>` and `<field_content>`.
          See the schemas below for possible field names.
        required: false
        style: form
        explode: true
        schema:
          type: string
        example: '*:*'
      - name: fq
        in: query
        description: Filter query
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: fl
        in: query
        description: Field list
        required: false
        style: form
        explode: true
        schema:
          type: string
        example: '*'
      - name: start
        in: query
        description: Starting page
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 0
      - name: rows
        in: query
        description: Page size
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 10
      - name: wt
        in: query
        description: Response format
        required: false
        style: form
        explode: true
        schema:
          type: string
          default: xml
          enum:
          - json
          - xml
          - csv
        example: json
      responses:
        200:
          description: Query performed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SolrResponse'
            application/xml:
              schema:
                $ref: '#/components/schemas/SolrResponse'
        400:
          description: BAD_REQUEST
        401:
          description: UNAUTHORIZED
        403:
          description: FORBIDDEN
        404:
          description: NOT_FOUND
        409:
          description: CONFLICT
        415:
          description: UNSUPPORTED_MEDIA_TYPE
        500:
          description: SERVER_ERROR
        503:
          description: SERVICE_UNAVAILABLE
        510:
          description: INVALID_STATE
    post:
      tags:
      - Search
      summary: Apache Solr powered search
      description: POST is more complex to use, but also allows for much for complex
        and lengthy queries.
      operationId: solrquery_post
      parameters:
      - name: wt
        in: query
        description: Response format
        required: false
        style: form
        explode: true
        schema:
          type: string
          default: xml
          enum:
          - json
          - xml
        example: json
      requestBody:
        $ref: '#/components/requestBodies/QueryBody'
      responses:
        200:
          description: Query performed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SolrResponse'
            application/xml:
              schema:
                $ref: '#/components/schemas/SolrResponse'
        400:
          description: BAD_REQUEST
        401:
          description: UNAUTHORIZED
        403:
          description: FORBIDDEN
        404:
          description: NOT_FOUND
        409:
          description: CONFLICT
        415:
          description: UNSUPPORTED_MEDIA_TYPE
        500:
          description: SERVER_ERROR
        503:
          description: SERVICE_UNAVAILABLE
        510:
          description: INVALID_STATE
  /enm/{db}/investigation:
    get:
      tags:
      - Studies
      summary: Details of multiple studies
      description: Multiple studies in tabular form
      operationId: getInvestigationResults
      parameters:
      - $ref: '#/components/parameters/ambitDatabaseId'
      - name: type
        in: query
        description: query type
        required: true
        style: form
        explode: true
        schema:
          type: string
          enum:
          - byinvestigation
          - byassay
          - bysubstance
          - byprovider
          - bycitation
          - bystudytype
          - bystructure_inchikey
          - bystructure_smiles
          - bystructure_name
          - bysubstance_name
          - bysubstance_type
        example: bystudytype
      - name: search
        in: query
        description: Search parameter, UUID of the investigation or a substance
        required: true
        style: form
        explode: true
        schema:
          type: string
        example: PC_GRANULOMETRY_SECTION
      - name: inchikey
        in: query
        description: Search parameter, InChI key(s) of the substance component(s),
          comma delimited
        required: false
        style: form
        explode: true
        schema:
          type: string
        example: YUYCVXFAYWRXLS-UHFFFAOYSA-N
      - name: id
        in: query
        description: Search parameter, chemical structure or substance identifier(s),
          comma delimited
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: page
        in: query
        description: Starting page
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 0
      - name: pagesize
        in: query
        description: Page size
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 10
      responses:
        200:
          description: OK. Entries found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Investigation'
            application/x-javascript:
              schema:
                $ref: '#/components/schemas/Investigation'
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                $ref: '#/components/schemas/Investigation'
            text/csv:
              schema:
                $ref: '#/components/schemas/Investigation'
            text/plain:
              schema:
                $ref: '#/components/schemas/Investigation'
        404:
          description: Entries not found
  /enm/{db}/substance:
    get:
      tags:
      - Substances
      summary: List substances
      description: Returns a list of substances, according to the search criteria
      operationId: getSubstances
      parameters:
      - $ref: '#/components/parameters/ambitDatabaseId'
      - name: search
        in: query
        description: Search parameter
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: type
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: string
          enum:
          - substancetype
          - name
          - like
          - regexp
          - uuif
          - CompTox
          - DOI
          - reliability
          - purposeFlag
          - studyResultType
          - isRobustStudy
          - citation
          - citationowner
          - topcategory
          - endpointcategory
          - params
          - owner_name
          - owner_uuid
          - related
          - reference
          - facet
      - name: compound_uri
        in: query
        description: If type=related finds all substances containing this compound;
          if typ =reference - finds all substances with this compound as reference
          structure
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: bundleUri
        in: query
        description: Retrieves if selected in this bundle
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: addDummySubstance
        in: query
        description: Adds a compound record as substance in JSON; only if type=related
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: studysummary
        in: query
        description: If true retrieves study summary for each substance
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: page
        in: query
        description: Starting page
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 0
      - name: pagesize
        in: query
        description: Page size
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 10
      responses:
        200:
          description: OK. Substances found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Substance'
            application/x-javascript:
              schema:
                $ref: '#/components/schemas/Substance'
            application/isa+json:
              schema:
                $ref: '#/components/schemas/Substance'
            application/ld+json:
              schema:
                $ref: '#/components/schemas/Substance'
            application/rdf+xml:
              schema:
                $ref: '#/components/schemas/Substance'
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                $ref: '#/components/schemas/Substance'
            image/png:
              schema:
                $ref: '#/components/schemas/Substance'
            text/n3:
              schema:
                $ref: '#/components/schemas/Substance'
            text/uri-list:
              schema:
                $ref: '#/components/schemas/Substance'
        404:
          description: Substances not found
  /enm/{db}/substance/{uuid}:
    get:
      tags:
      - Substances
      summary: Get a substance
      description: Returns substance representation
      operationId: getSubstanceByUUID
      parameters:
      - $ref: '#/components/parameters/ambitDatabaseId'
      - name: uuid
        in: path
        description: Substance UUID
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: property_uris[]
        in: query
        description: Property URIs
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: page
        in: query
        description: Starting page
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 0
      - name: pagesize
        in: query
        description: Page size
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 10
      responses:
        200:
          description: OK. Substances found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Substance'
            application/x-javascript:
              schema:
                $ref: '#/components/schemas/Substance'
            application/isa+json:
              schema:
                $ref: '#/components/schemas/Substance'
            application/ld+json:
              schema:
                $ref: '#/components/schemas/Substance'
            application/rdf+xml:
              schema:
                $ref: '#/components/schemas/Substance'
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                $ref: '#/components/schemas/Substance'
            image/png:
              schema:
                $ref: '#/components/schemas/Substance'
            text/n3:
              schema:
                $ref: '#/components/schemas/Substance'
            text/uri-list:
              schema:
                $ref: '#/components/schemas/Substance'
        404:
          description: Substances not found
  /enm/{db}/substance/{uuid}/study:
    get:
      tags:
      - Studies
      - Substances
      summary: get substance study
      description: Returns substance study representation
      operationId: getSubstanceStudy
      parameters:
      - $ref: '#/components/parameters/ambitDatabaseId'
      - name: uuid
        in: path
        description: Substance UUID
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: top
        in: query
        description: Top endpoint category
        required: false
        style: form
        explode: true
        schema:
          type: string
          enum:
          - P-CHEM
          - ECOTOX
          - ENV FATE
          - TOX
          - EXPOSURE
      - name: category
        in: query
        description: Endpoint category (The value in the protocol.category.code field)
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: property_uri
        in: query
        description: Property URI https://data.enanomapper.net/property/{UUID} , see
          Property service
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: property
        in: query
        description: Property UUID
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: investigation_uuid
        in: query
        description: Investigation UUID, a code to link different studies
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: page
        in: query
        description: Starting page
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 0
      - name: pagesize
        in: query
        description: Page size
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 10
      responses:
        200:
          description: OK. Substances found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubstanceStudy'
            application/x-javascript:
              schema:
                $ref: '#/components/schemas/SubstanceStudy'
            application/isa+json:
              schema:
                $ref: '#/components/schemas/SubstanceStudy'
            application/ld+json:
              schema:
                $ref: '#/components/schemas/SubstanceStudy'
            application/rdf+xml:
              schema:
                $ref: '#/components/schemas/SubstanceStudy'
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                $ref: '#/components/schemas/SubstanceStudy'
            image/png:
              schema:
                $ref: '#/components/schemas/SubstanceStudy'
            text/n3:
              schema:
                $ref: '#/components/schemas/SubstanceStudy'
            text/uri-list:
              schema:
                $ref: '#/components/schemas/SubstanceStudy'
        404:
          description: Substances not found
  /enm/{db}/substance/{uuid}/composition:
    get:
      tags:
      - Structures
      - Substances
      summary: Substance composition
      description: Returns substance composition
      operationId: getSubstanceComposition
      parameters:
      - $ref: '#/components/parameters/ambitDatabaseId'
      - name: uuid
        in: path
        description: Substance UUID
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: all
        in: query
        description: true (Show all compositions) false (do not show hidden compositions)
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: page
        in: query
        description: Starting page
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 0
      - name: pagesize
        in: query
        description: Page size
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 10
      responses:
        200:
          description: OK. compositions found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubstanceComposition'
            application/x-javascript:
              schema:
                $ref: '#/components/schemas/SubstanceComposition'
            application/isa+json:
              schema:
                $ref: '#/components/schemas/SubstanceComposition'
            application/ld+json:
              schema:
                $ref: '#/components/schemas/SubstanceComposition'
            application/rdf+xml:
              schema:
                $ref: '#/components/schemas/SubstanceComposition'
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                $ref: '#/components/schemas/SubstanceComposition'
            image/png:
              schema:
                $ref: '#/components/schemas/SubstanceComposition'
            text/n3:
              schema:
                $ref: '#/components/schemas/SubstanceComposition'
            text/uri-list:
              schema:
                $ref: '#/components/schemas/SubstanceComposition'
        404:
          description: compositions not found
  /enm/{db}/substance/{uuid}/structures:
    get:
      tags:
      - Structures
      - Substances
      summary: Get substance composition as a dataset
      description: Returns substance composition
      operationId: getSubstanceStructures
      parameters:
      - $ref: '#/components/parameters/ambitDatabaseId'
      - name: uuid
        in: path
        description: Substance UUID
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: page
        in: query
        description: Starting page
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 0
      - name: pagesize
        in: query
        description: Page size
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 10
      responses:
        200:
          description: OK. compositions found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dataset'
            application/x-javascript:
              schema:
                $ref: '#/components/schemas/Dataset'
            application/isa+json:
              schema:
                $ref: '#/components/schemas/Dataset'
            application/ld+json:
              schema:
                $ref: '#/components/schemas/Dataset'
            application/rdf+xml:
              schema:
                $ref: '#/components/schemas/Dataset'
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                $ref: '#/components/schemas/Dataset'
            image/png:
              schema:
                $ref: '#/components/schemas/Dataset'
            text/n3:
              schema:
                $ref: '#/components/schemas/Dataset'
            text/uri-list:
              schema:
                $ref: '#/components/schemas/Dataset'
        404:
          description: compositions not found
  /enm/{db}/substance/{uuid}/studySummary:
    get:
      tags:
      - Studies
      - Substances
      summary: Get study summary for the substance
      description: Study summary
      operationId: getSubstanceStudySummary
      parameters:
      - $ref: '#/components/parameters/ambitDatabaseId'
      - name: uuid
        in: path
        description: Substance UUID
        required: true
        style: simple
        explode: false
        schema:
          type: string
      - name: top
        in: query
        description: Top endpoint category
        required: false
        style: form
        explode: true
        schema:
          type: string
          enum:
          - P-CHEM
          - ECOTOX
          - ENV FATE
          - TOX
          - EXPOSURE
      - name: category
        in: query
        description: Endpoint category (The value in the protocol.category.code field)
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: property_uri
        in: query
        description: Property URI https://data.enanomapper.net/property/{UUID} , see
          Property service
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: property
        in: query
        description: Property UUID, see Property service
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: result
        in: query
        description: If true will group by topcategory,endpointcategory,interpretation
          result
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: page
        in: query
        description: Starting page
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 0
      - name: pagesize
        in: query
        description: Page size
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 10
      responses:
        200:
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubstanceStudySummary'
            application/x-javascript:
              schema:
                $ref: '#/components/schemas/SubstanceStudySummary'
            application/isa+json:
              schema:
                $ref: '#/components/schemas/SubstanceStudySummary'
            application/ld+json:
              schema:
                $ref: '#/components/schemas/SubstanceStudySummary'
            application/rdf+xml:
              schema:
                $ref: '#/components/schemas/SubstanceStudySummary'
            application/vnd.openxmlformats-officedocument.spreadsheetml.sheet:
              schema:
                $ref: '#/components/schemas/SubstanceStudySummary'
            image/png:
              schema:
                $ref: '#/components/schemas/SubstanceStudySummary'
            text/n3:
              schema:
                $ref: '#/components/schemas/SubstanceStudySummary'
            text/uri-list:
              schema:
                $ref: '#/components/schemas/SubstanceStudySummary'
        404:
          description: Entries not found
  /enm/{db}/query/study:
    get:
      tags:
      - Studies
      - Facets
      summary: Search endpoint summary
      description: Returns endpoint summary
      operationId: getEndpointSummary
      parameters:
      - $ref: '#/components/parameters/ambitDatabaseId'
      - name: top
        in: query
        description: Top endpoint category
        required: false
        style: form
        explode: true
        schema:
          type: string
          enum:
          - P-CHEM
          - ECOTOX
          - ENV FATE
          - TOX
          - EXPOSURE
      - name: category
        in: query
        description: Endpoint category (The value in the protocol.category.code field)
        required: false
        style: form
        explode: true
        schema:
          type: string
      responses:
        200:
          description: OK.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Facet'
        404:
          description: Entries not found
  /enm/{db}/query/compound/{term}/{representation}:
    get:
      tags:
      - Structures
      summary: Exact chemical structure search
      description: Returns compounds found
      externalDocs:
        description: Learn more about operations provided by this API.
        url: http://ambit.sf.net
      operationId: searchByIdentifier
      parameters:
      - $ref: '#/components/parameters/ambitDatabaseId'
      - name: term
        in: path
        description: search term type
        required: true
        style: simple
        explode: false
        schema:
          type: string
          enum:
          - search
          - url
          - inchikey
      - name: representation
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          enum:
          - all
          - smiles
          - reach
          - stdinchi
          - stdinchikey
          - names
          - iupac_name
          - synonym
          - cas
          - einecs
      - name: search
        in: query
        description: Compound identifier (SMILES, InChI, name, registry identifiers)
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: b64search
        in: query
        description: Base64 encoded mol file; if included, will be used instead of
          the 'search' parameter
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: casesens
        in: query
        description: Case sensitive search if yes
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: bundleUri
        in: query
        description: Bundle URI
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: sameas
        in: query
        description: Ontology URI to define groups of columns
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: page
        in: query
        description: Starting page
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 0
      - name: pagesize
        in: query
        description: Page size
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 10
      responses:
        200:
          description: OK. Entries found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dataset'
        404:
          description: Entries not found
  /enm/{db}/query/smarts:
    get:
      tags:
      - Structures
      summary: Substructure search
      description: Returns compounds with the specified substructure
      externalDocs:
        description: Learn more about operations provided by this API.
        url: http://ambit.sf.net
      operationId: searchBySmarts
      parameters:
      - $ref: '#/components/parameters/ambitDatabaseId'
      - name: search
        in: query
        description: Compound identifier (SMILES, InChI, name, registry identifiers)
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: b64search
        in: query
        description: Base64 encoded mol file; if included, will be used instead of
          the 'search' parameter
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: type
        in: query
        description: Defines the expected content of the search parameter
        required: false
        style: form
        explode: true
        schema:
          type: string
          enum:
          - smiles
          - mol
          - url
      - name: dataset_uri
        in: query
        description: Restrict the search within the AMBIT dataset specified with the
          URI
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: filterBySubstance
        in: query
        description: Restrict the search within the set of structures with assigned
          substances
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: bundleUri
        in: query
        description: If the structure is used in the specified bundle URI, the selection
          tag will be returned
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: sameas
        in: query
        description: Ontology URI to define groups of columns
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: mol
        in: query
        description: Only for application/json; to include mol as JSON field
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: page
        in: query
        description: Starting page
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 0
      - name: pagesize
        in: query
        description: Page size
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 10
      responses:
        200:
          description: OK. Entries found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dataset'
        404:
          description: Entries not found
  /enm/{db}/query/similarity:
    get:
      tags:
      - Structures
      summary: Exact similarity search
      description: Returns similar compounds
      externalDocs:
        description: Learn more about operations provided by this API.
        url: http://ambit.sf.net
      operationId: searchBySimilarity
      parameters:
      - $ref: '#/components/parameters/ambitDatabaseId'
      - name: search
        in: query
        description: Compound identifier (SMILES, InChI, name, registry identifiers)
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: b64search
        in: query
        description: Base64 encoded mol file; if included, will be used instead of
          the 'search' parameter
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: type
        in: query
        description: Defines the expected content of the search parameter
        required: false
        style: form
        explode: true
        schema:
          type: string
          enum:
          - smiles
          - mol
          - url
      - name: threshold
        in: query
        description: Similarity threshold
        required: false
        style: form
        explode: true
        schema:
          type: number
      - name: dataset_uri
        in: query
        description: Restrict the search within the AMBIT dataset specified with the
          URI
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: filterBySubstance
        in: query
        description: Restrict the search within the set of structures with assigned
          substances
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: bundleUri
        in: query
        description: If the structure is used in the specified bundle URI, the selection
          tag will be returned
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: sameas
        in: query
        description: Ontology URI to define groups of columns
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: mol
        in: query
        description: Only for application/json; to include mol as JSON field
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: page
        in: query
        description: Starting page
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 0
      - name: pagesize
        in: query
        description: Page size
        required: false
        style: form
        explode: true
        schema:
          type: integer
        example: 10
      responses:
        200:
          description: OK. Entries found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Dataset'
        404:
          description: Entries not found
components:
  schemas:
    SolrQuery:
      type: object
      properties:
        query:
          type: string
        filter:
          type: string
        facet:
          type: string
        sort:
          type: boolean
        start:
          type: integer
        rows:
          type: integer
    SolrResponse:
      type: object
      properties:
        responseHeader:
          type: object
          properties:
            zkConnected:
              type: boolean
            status:
              type: integer
            QTime:
              type: integer
            params:
              type: object
        response:
          type: object
          properties:
            numFound:
              type: integer
            start:
              type: integer
            maxScore:
              type: number
            docs:
              type: array
              items:
                type: object
    Investigation:
      type: object
      properties:
        substanceType:
          type: string
        name:
          type: string
        publicname:
          type: string
        owner_name:
          type: string
        topcategory:
          type: string
        endpointcategory:
          type: string
        guidance:
          type: string
        endpoint:
          type: string
        document_uuid:
          type: string
        reference:
          type: string
        reference_owner:
          type: string
        reference_year:
          type: string
        effectendpoint:
          type: string
        resulttype:
          type: string
        textValue:
          type: string
        loQualifier:
          type: string
        loValue:
          type: number
        upQualifier:
          type: string
        upValue:
          type: number
        unit:
          type: string
        errQualifier:
          type: string
        err:
          type: number
        s_uuid:
          type: string
        assay:
          type: string
        investigation:
          type: string
        type_s:
          type: string
        updated:
          type: string
        studyResultType:
          type: string
        _childDocuments_:
          type: object
    Substance:
      type: object
      properties:
        substance:
          type: object
    SubstanceStudy:
      type: object
      properties:
        study:
          type: object
    SubstanceComposition:
      type: object
      properties:
        composition:
          type: object
        feature:
          type: object
    SubstanceStudySummary:
      type: object
      properties:
        facet:
          type: object
    Facet:
      type: object
      properties:
        facet:
          type: object
    Dataset:
      type: object
      properties:
        query:
          type: object
        dataEntry:
          type: object
        model_uri:
          type: string
        feature:
          type: object
  parameters:
    ambitDatabaseId:
      name: db
      in: path
      description: Database ID
      required: true
      style: simple
      explode: false
      schema:
        type: string
        default: nanoreg1
        enum:
        - calibrate
        - enanomapper
        - enpra
        - gracious
        - marina
        - nanogenotox
        - nanoinformatix
        - nanoreg1
        - nanoreg2
        - nanotest
        - sanowork
        - sbd4nano
        - sabydoma
  requestBodies:
    QueryBody:
      description: a JSON object with Solr query parameters
      content:
        application/json:
          schema:
            type: object
            properties:
              params:
                type: object
                properties:
                  fl:
                    type: array
                    items:
                      type: string
                  rows:
                    type: integer
              facet:
                type: object
            example: |
              {
                "params": {
                  "fl": [
                    "[child parentFilter=type_s:substance childFilter=type_s:composition limit=100]",
                    "dbtag_hss",
                    "name:name_hs",
                    "publicname:publicname_hs",
                    "owner_name:owner_name_hs",
                    "substanceType:substanceType_hs",
                    "s_uuid:s_uuid_hs",
                    "content:content_hss",
                    "SUMMARY.*"
                  ],
                  "rows": 20
                },
                "facet": {
                  "owner_name": {
                    "type": "terms",
                    "field": "owner_name_s",
                    "mincount": 1,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "owner_name_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "reference_owner": {
                    "type": "terms",
                    "field": "reference_owner_s",
                    "mincount": 1,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "reference_owner_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "substanceType": {
                    "type": "terms",
                    "field": "substanceType_s",
                    "mincount": 1,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "substanceType_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "nm_name": {
                    "type": "terms",
                    "field": "publicname_s",
                    "mincount": 451,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "nm_name_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "protocol": {
                    "type": "terms",
                    "field": "guidance_s",
                    "mincount": 1,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "protocol_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "method": {
                    "type": "terms",
                    "field": "E.method_s",
                    "mincount": 1,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "method_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "cell": {
                    "type": "terms",
                    "field": "E.cell_type_s",
                    "mincount": 1,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "cell_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "species": {
                    "type": "terms",
                    "field": "E.animal_model_s",
                    "mincount": 1,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "species_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "route": {
                    "type": "terms",
                    "field": "E.exposure_route_s",
                    "mincount": 1,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "route_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "interpretation": {
                    "type": "terms",
                    "field": "MEDIUM_s",
                    "mincount": 2,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "interpretation_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "dprotocol": {
                    "type": "terms",
                    "field": "Dispersion protocol_s",
                    "mincount": 2,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "dprotocol_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "reference_year": {
                    "type": "terms",
                    "field": "reference_year_s",
                    "mincount": 2,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "reference_year_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "reference": {
                    "type": "terms",
                    "field": "reference_s",
                    "mincount": 2,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "reference_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "release": {
                    "type": "terms",
                    "field": "updated_s",
                    "mincount": 1,
                    "limit": -1,
                    "domain": {
                      "excludeTags": "release_tag",
                      "blockChildren": "type_s:substance"
                    }
                  },
                  "topcategory": {
                    "type": "terms",
                    "field": "topcategory_s",
                    "mincount": 1,
                    "limit": -1,
                    "facet": {
                      "min": "min(loValue_d)",
                      "max": "max(loValue_d)",
                      "avg": "avg(loValue_d)",
                      "endpointcategory": {
                        "type": "terms",
                        "field": "endpointcategory_s",
                        "mincount": 1,
                        "limit": -1,
                        "facet": {
                          "min": "min(loValue_d)",
                          "max": "max(loValue_d)",
                          "avg": "avg(loValue_d)",
                          "effectendpoint": {
                            "type": "terms",
                            "field": "effectendpoint_s",
                            "mincount": 1,
                            "limit": -1,
                            "facet": {
                              "min": "min(loValue_d)",
                              "max": "max(loValue_d)",
                              "avg": "avg(loValue_d)",
                              "unit": {
                                "type": "terms",
                                "field": "unit_s",
                                "mincount": 1,
                                "limit": -1,
                                "facet": {
                                  "min": "min(loValue_d)",
                                  "max": "max(loValue_d)",
                                  "avg": "avg(loValue_d)"
                                }
                              }
                            }
                          }
                        }
                      }
                    },
                    "domain": {
                      "blockChildren": "type_s:substance"
                    }
                  }
                }
              }
