Skip to content

Structure Checker Service

Structure Checker Service makes it possible to reach the chemical functionality provided by Chemaxon's product Structure Checker.

This documentation describes installation, administration and usage of Structure Checker Service. As all JChem Microservices modules, it is available in two modes:

  1. As part of a microservices system
  2. As a standalone web application

Microservices system mode

In microservices system mode, the Structure Checker Service runs together with the Config, Discovery and Gateway Services. These three services are mandatory, and optionally other services can also be part of the system. All configuration must be done in the Config Service.

The default configuration applies to the microservices system mode.

The web application runs on host and listens on port .

Standalone web application mode

In standalone web application mode, the Structure Checker Service runs alone, without the Config, Discovery and Gateway Services (however, the installer installs them as well).

The default configuration must be changed according to the standalone web application mode. Set the following in the application.properties file

  • eureka.client.enabled=false
  • spring.cloud.config.enabled=false
  • If you are using a version earlier than 25.3.0 remove the line that starts with spring.config.import=

All configuration must be done in the Structure Checker module.

The web application runs on host and listens on port .

System requirements

See here.

Download and installation

See here.

Service is installed into folder: jws/jws-structurechecker/

Licenses

See here.

Logging

See here.

Configuration

Default configuration:

application.properties
server.port=8066
logging.file.name=../logs/jws-structurechecker.log
spring.config.import=optional:configserver:${CONFIG_SERVER_URI:http://localhost:8888}
eureka.client.enabled=true set eureka.client.enabled=false to switch to standalone mode

For more configuration options, see the Spring documentation page.

Running the server

Prerequisites in case of microservices system mode:

  1. Config Service is running
  2. Discovery Service is running
  3. Gateway Service is running

Run the service in command line in folder jws/jws-structurechecker:

jws-structurechecker-service.exe --install

jws-structurechecker-service.exe --start (on Windows in administrator's terminal)
jws-structurechecker-service start (on Linux)

or

run-jws-structurechecker.exe (on Windows)
run-jws-structurechecker (on Linux)

API documentation

Find and try out the API on the Swagger UI.

Mode URL of Swagger UI Default URL of Swagger UI
Microservices system <serverhost>:<gateway-port>/jws-checker-fixer/API/ localhost:8080/jws-checker-fixer/API/
Standalone web application mode <serverhost>:<server-port>/API/ localhost:8066/API/

Demo site

For a detailed description, check out the demo site:

https://jchem-microservices.chemaxon.com/jws-checker-fixer/api/index.html

How to write custom structure checker / structure fixer

Using JSON configuration

To send custom structure checker/fixer requests when using JSON format for the checker/fixer configuration, follow our example on GitHub.

Using XML configuration

To send custom structure checker/fixer requests when using XML format for the checker/fixer configuration:

  • Place the custom created jar file in /extra-libs/.
  • Create externalcheckersfixers.xml and place it in /extra-libs/ or in any other folder but jws-user must have the right to read it.
    Example externalcheckersfixers.xml when it is also in /extra-libs/:

    <?xml version="1.0" encoding="UTF-8"?> 
    <configuration> 
    <checker-list>   
        <checker class="com.checkers.MyChecker" editor-class="" id="MyChecker" jar="custom-checkers.jar"/> 
    </checker-list> 
    <fixer-list>   
        <fixer class="com.checkers.MyFixer" id="MyFixer" jar="custom-checkers.jar"/> 
    </fixer-list> </configuration>
    

    If externalcheckersfixers.xml is placed in another folder you have to reference to the jar file as:

    ...
    <checker class="com.checkers.MyChecker" editor-class="" id="MyChecker" jar="file:///home/somebody/custom-checkers.jar"/>
    ...
    <fixer class="com.checkers.MyFixer" id="MyFixer" jar="file:///home/somebody/custom-checkers.jar"/>
    ...
    
  • Add the following line to the .vmoptions file of run-jws-structurechecker and/or jws-structurechecker-service:

    -Dchemaxon.structurechecker.factory.ExternalCheckerFixerConfiguration=../extra-libs/externalcheckersfixers.xml
    

    or

    -Dchemaxon.structurechecker.factory.ExternalCheckerFixerConfiguration=/<dir>/externalcheckersfixers.xml 
    

    where

    is the absolute path of the xml file.

  • Start the service jws-structurechecker
  • Use the /rest-v1/checker-fixer/xml-based endpoint

Usage

Follow the guidelines, examples on the Demo site or on the Swagger UI API documentation of your installed service. They describe the endpoints provided to reach the functionalities of the Structure Checker product.

Checker descriptor

Lists the available checkers, fixers, the checkers with their corresponding fixers and the stored checker-fixer configurations.

Checker-fixer

Provides endpoints for structure checking and fixing together.

Here is an endpoint provided for executing previously stored checker-fixer actions: /rest-v1/checker-fixer/stored/{presetName}

The checker-fixer configurations can be stored in xml or in json format in the application.properties file of Structure Checker Service and also in the application.properties file of Config Service.

Examples:

com.chemaxon.structurechecker.presets.exampleXML=<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<checkers>\n  <AbbreviatedGroupChecker contracted=\"true\" excluded=\"\" expanded=\"true\" fixMode=\"fix\" fixerClassName=\"chemaxon.fixers.ContractGroupFixer\"/>\n</checkers>
com.chemaxon.structurechecker.presets.exampleJSON=[{"checkerSettings": {"checkerClass": "MissingAtomMapChecker","displayName": "MyStructureChecker"},"fixerSettings": {"displayName": "MyStructureFixer","exportFormat": "mrv","fixerClass": "MapMoleculeFixer"}},{"checkerSettings": {"checkerClass": "AtomMapChecker","displayName": "MyStructureChecker"}}]

General checker

Provides endpoint for executing multiple structure checkers simultaneously.

Single checker

Provides endpoints for detecting errors with structure checkers one-by-one.

JSON Converter

Converts different molecular string representations into JSON format and molecular JSON representations to string.