@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api eNanoMapper federated search
@base https://api.ideaconsult.net/nanoreg1
@version 1.0
@endpoints 13
@toc select(2), enm(11)

@group select
@endpoint GET /select
@desc Apache Solr powered search
@optional {q: str # The query itself, in the form `:`. The wildcard operator `*` is accepted for both `` and ``. See the schemas below for possible field names., fq: str # Filter query, fl: str # Field list, start: int # Starting page, rows: int # Page size, wt: str(json/xml/csv)=xml # Response format}
@returns(200) {responseHeader: map{zkConnected: bool, status: int, QTime: int, params: map}, response: map{numFound: int, start: int, maxScore: num, docs: [map]}} # Query performed successfully
@errors {400: BAD_REQUEST, 401: UNAUTHORIZED, 403: FORBIDDEN, 404: NOT_FOUND, 409: CONFLICT, 415: UNSUPPORTED_MEDIA_TYPE, 500: SERVER_ERROR, 503: SERVICE_UNAVAILABLE, 510: INVALID_STATE}

@endpoint POST /select
@desc Apache Solr powered search
@optional {wt: str(json/xml)=xml # Response format, params: map{fl: [str], rows: int}, facet: map}
@returns(200) {responseHeader: map{zkConnected: bool, status: int, QTime: int, params: map}, response: map{numFound: int, start: int, maxScore: num, docs: [map]}} # Query performed successfully
@errors {400: BAD_REQUEST, 401: UNAUTHORIZED, 403: FORBIDDEN, 404: NOT_FOUND, 409: CONFLICT, 415: UNSUPPORTED_MEDIA_TYPE, 500: SERVER_ERROR, 503: SERVICE_UNAVAILABLE, 510: INVALID_STATE}

@endgroup

@group enm
@endpoint GET /enm/{db}/investigation
@desc Details of multiple studies
@required {db: str(calibrate/enanomapper/enpra/gracious/marina/nanogenotox/nanoinformatix/nanoreg1/nanoreg2/nanotest/sanowork/sbd4nano/sabydoma)=nanoreg1 # Database ID, type: str(byinvestigation/byassay/bysubstance/byprovider/bycitation/bystudytype/bystructure_inchikey/bystructure_smiles/bystructure_name/bysubstance_name/bysubstance_type) # query type, search: str # Search parameter, UUID of the investigation or a substance}
@optional {inchikey: str # Search parameter, InChI key(s) of the substance component(s), comma delimited, id: str # Search parameter, chemical structure or substance identifier(s), comma delimited, page: int # Starting page, pagesize: int # Page size}
@returns(200) {substanceType: str, name: str, publicname: str, owner_name: str, topcategory: str, endpointcategory: str, guidance: str, endpoint: str, document_uuid: str, reference: str, reference_owner: str, reference_year: str, effectendpoint: str, resulttype: str, textValue: str, loQualifier: str, loValue: num, upQualifier: str, upValue: num, unit: str, errQualifier: str, err: num, s_uuid: str, assay: str, investigation: str, type_s: str, updated: str, studyResultType: str, _childDocuments_: map} # OK. Entries found
@errors {404: Entries not found}

@endpoint GET /enm/{db}/substance
@desc List substances
@required {db: str(calibrate/enanomapper/enpra/gracious/marina/nanogenotox/nanoinformatix/nanoreg1/nanoreg2/nanotest/sanowork/sbd4nano/sabydoma)=nanoreg1 # Database ID}
@optional {search: str # Search parameter, type: str(substancetype/name/like/regexp/uuif/CompTox/DOI/reliability/purposeFlag/studyResultType/isRobustStudy/citation/citationowner/topcategory/endpointcategory/params/owner_name/owner_uuid/related/reference/facet), compound_uri: str # If type=related finds all substances containing this compound; if typ =reference - finds all substances with this compound as reference structure, bundleUri: str # Retrieves if selected in this bundle, addDummySubstance: bool # Adds a compound record as substance in JSON; only if type=related, studysummary: bool # If true retrieves study summary for each substance, page: int # Starting page, pagesize: int # Page size}
@returns(200) {substance: map} # OK. Substances found
@errors {404: Substances not found}

@endpoint GET /enm/{db}/substance/{uuid}
@desc Get a substance
@required {db: str(calibrate/enanomapper/enpra/gracious/marina/nanogenotox/nanoinformatix/nanoreg1/nanoreg2/nanotest/sanowork/sbd4nano/sabydoma)=nanoreg1 # Database ID, uuid: str # Substance UUID}
@optional {property_uris[]: str # Property URIs, page: int # Starting page, pagesize: int # Page size}
@returns(200) {substance: map} # OK. Substances found
@errors {404: Substances not found}

@endpoint GET /enm/{db}/substance/{uuid}/study
@desc get substance study
@required {db: str(calibrate/enanomapper/enpra/gracious/marina/nanogenotox/nanoinformatix/nanoreg1/nanoreg2/nanotest/sanowork/sbd4nano/sabydoma)=nanoreg1 # Database ID, uuid: str # Substance UUID}
@optional {top: str(P-CHEM/ECOTOX/ENV FATE/TOX/EXPOSURE) # Top endpoint category, category: str # Endpoint category (The value in the protocol.category.code field), property_uri: str # Property URI https://data.enanomapper.net/property/{UUID} , see Property service, property: str # Property UUID, investigation_uuid: str # Investigation UUID, a code to link different studies, page: int # Starting page, pagesize: int # Page size}
@returns(200) {study: map} # OK. Substances found
@errors {404: Substances not found}

@endpoint GET /enm/{db}/substance/{uuid}/composition
@desc Substance composition
@required {db: str(calibrate/enanomapper/enpra/gracious/marina/nanogenotox/nanoinformatix/nanoreg1/nanoreg2/nanotest/sanowork/sbd4nano/sabydoma)=nanoreg1 # Database ID, uuid: str # Substance UUID}
@optional {all: bool # true (Show all compositions) false (do not show hidden compositions), page: int # Starting page, pagesize: int # Page size}
@returns(200) {composition: map, feature: map} # OK. compositions found
@errors {404: compositions not found}

@endpoint GET /enm/{db}/substance/{uuid}/structures
@desc Get substance composition as a dataset
@required {db: str(calibrate/enanomapper/enpra/gracious/marina/nanogenotox/nanoinformatix/nanoreg1/nanoreg2/nanotest/sanowork/sbd4nano/sabydoma)=nanoreg1 # Database ID, uuid: str # Substance UUID}
@optional {page: int # Starting page, pagesize: int # Page size}
@returns(200) {query: map, dataEntry: map, model_uri: str, feature: map} # OK. compositions found
@errors {404: compositions not found}

@endpoint GET /enm/{db}/substance/{uuid}/studySummary
@desc Get study summary for the substance
@required {db: str(calibrate/enanomapper/enpra/gracious/marina/nanogenotox/nanoinformatix/nanoreg1/nanoreg2/nanotest/sanowork/sbd4nano/sabydoma)=nanoreg1 # Database ID, uuid: str # Substance UUID}
@optional {top: str(P-CHEM/ECOTOX/ENV FATE/TOX/EXPOSURE) # Top endpoint category, category: str # Endpoint category (The value in the protocol.category.code field), property_uri: str # Property URI https://data.enanomapper.net/property/{UUID} , see Property service, property: str # Property UUID, see Property service, result: bool # If true will group by topcategory,endpointcategory,interpretation result, page: int # Starting page, pagesize: int # Page size}
@returns(200) {facet: map} # OK.
@errors {404: Entries not found}

@endpoint GET /enm/{db}/query/study
@desc Search endpoint summary
@required {db: str(calibrate/enanomapper/enpra/gracious/marina/nanogenotox/nanoinformatix/nanoreg1/nanoreg2/nanotest/sanowork/sbd4nano/sabydoma)=nanoreg1 # Database ID}
@optional {top: str(P-CHEM/ECOTOX/ENV FATE/TOX/EXPOSURE) # Top endpoint category, category: str # Endpoint category (The value in the protocol.category.code field)}
@returns(200) {facet: map} # OK.
@errors {404: Entries not found}

@endpoint GET /enm/{db}/query/compound/{term}/{representation}
@desc Exact chemical structure search
@required {db: str(calibrate/enanomapper/enpra/gracious/marina/nanogenotox/nanoinformatix/nanoreg1/nanoreg2/nanotest/sanowork/sbd4nano/sabydoma)=nanoreg1 # Database ID, term: str(search/url/inchikey) # search term type, representation: str(all/smiles/reach/stdinchi/stdinchikey/names/iupac_name/synonym/cas/einecs)}
@optional {search: str # Compound identifier (SMILES, InChI, name, registry identifiers), b64search: str # Base64 encoded mol file; if included, will be used instead of the 'search' parameter, casesens: bool # Case sensitive search if yes, bundleUri: str # Bundle URI, sameas: str # Ontology URI to define groups of columns, page: int # Starting page, pagesize: int # Page size}
@returns(200) {query: map, dataEntry: map, model_uri: str, feature: map} # OK. Entries found
@errors {404: Entries not found}

@endpoint GET /enm/{db}/query/smarts
@desc Substructure search
@required {db: str(calibrate/enanomapper/enpra/gracious/marina/nanogenotox/nanoinformatix/nanoreg1/nanoreg2/nanotest/sanowork/sbd4nano/sabydoma)=nanoreg1 # Database ID}
@optional {search: str # Compound identifier (SMILES, InChI, name, registry identifiers), b64search: str # Base64 encoded mol file; if included, will be used instead of the 'search' parameter, type: str(smiles/mol/url) # Defines the expected content of the search parameter, dataset_uri: str # Restrict the search within the AMBIT dataset specified with the URI, filterBySubstance: bool # Restrict the search within the set of structures with assigned substances, bundleUri: str # If the structure is used in the specified bundle URI, the selection tag will be returned, sameas: str # Ontology URI to define groups of columns, mol: bool # Only for application/json; to include mol as JSON field, page: int # Starting page, pagesize: int # Page size}
@returns(200) {query: map, dataEntry: map, model_uri: str, feature: map} # OK. Entries found
@errors {404: Entries not found}

@endpoint GET /enm/{db}/query/similarity
@desc Exact similarity search
@required {db: str(calibrate/enanomapper/enpra/gracious/marina/nanogenotox/nanoinformatix/nanoreg1/nanoreg2/nanotest/sanowork/sbd4nano/sabydoma)=nanoreg1 # Database ID}
@optional {search: str # Compound identifier (SMILES, InChI, name, registry identifiers), b64search: str # Base64 encoded mol file; if included, will be used instead of the 'search' parameter, type: str(smiles/mol/url) # Defines the expected content of the search parameter, threshold: num # Similarity threshold, dataset_uri: str # Restrict the search within the AMBIT dataset specified with the URI, filterBySubstance: bool # Restrict the search within the set of structures with assigned substances, bundleUri: str # If the structure is used in the specified bundle URI, the selection tag will be returned, sameas: str # Ontology URI to define groups of columns, mol: bool # Only for application/json; to include mol as JSON field, page: int # Starting page, pagesize: int # Page size}
@returns(200) {query: map, dataEntry: map, model_uri: str, feature: map} # OK. Entries found
@errors {404: Entries not found}

@endgroup

@end
