HUB
Sign inSign up

tetrascience/ts-service-allotrope-web

By tetrascience

•Updated over 7 years ago

TetraScience Allotrope Conversion As A Service

Image
0

263

tetrascience/ts-service-allotrope-web repository overview

⁠ts-service-allotrope-web

A web app (API only) to convert JSON to ADF or ADF to JSON.

⁠Docker

⁠Install

docker pull tetrascience/ts-service-allotrope-web

⁠Run docker container

docker run --env-file my.env -p 8085:8085 tetrascience/ts-service-allotrope-web:latest

An example env file should have the following defined:

SERVICE_NAME=ts-service-allotrope-web
LOG_TRANSPORT=console
TENANT=multi
ENV=local

⁠APIs

⁠POST /allotrope/api/v1/files

Send a file to this service to convert JSON to ADF format, or from ADF to JSON

  • Content-Type: multipart/form-data
  • Form parameters
    • file: file content
  • Response
    • Content-Type: application/json
    • Body
    {
      "success": true,
       "file": {
          "id": "P3l0ezBjfcqTDc5ErQtrjwqwrjplxJ",
          "title": "bloodgasanalyzer-leafnode-v0.8.0.xlsx",
          "workflow_id": "1d673dcf-6b4f-434a-91ec-af4ce30841fc"   
       }
    }
    

This is an example JSON file⁠:

⁠GET /allotrope/api/v1/workflows/<workflow_id>

Get the current status of the workflow

  • Response
    • Content-Type: application/json
    • Body
    {
      "success": true,
      "id": "1d673dcf-6b4f-434a-91ec-af4ce30841fc",
      "workflow_files": [
        "filename.json.adf",
        "filename.json.dd.ttl",
        "filename.json.shacl.result",
        "filename.json.shacl.ttl"
      ]
    }  
    
⁠GET /allotrope/api/v1/workflows/<workflow_id>/<artifact_name>

Get the workflow artifact by passing in the artifact's name. You can find the file name from the response of the previous API

  • Response
    • Content-Type: application/octet-stream
⁠GET /status

Get the status of the service. You can use this for health check or heart beat.

  • Response
    • Content-Type: application/json
    • Body
    {
      "success": true
    }
    

⁠Example JSON File

{
  "leafnodes": [
    {
      "pref_label": "measurement id",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001121",
      "string_value": "413befdd-c7e2-4edd-9e9b-06cf1cb0283f",
      "value_type": "xsd:string",
      "required": false
    },
    {
      "pref_label": "measurement time",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0000952",
      "string_value": "2015-09-24T03:47:13.001Z",
      "value_type": "xsd:dateTime",
      "required": true
    },
    {
      "pref_label": "analyst",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001116",
      "string_value": "operator-1",
      "value_type": "xsd:string",
      "required": false
    },
    {
      "pref_label": "sample id",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001118",
      "string_value": "unknown-10",
      "value_type": "xsd:string",
      "required": true
    },
    {
      "pref_label": "equipment serial number",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001119",
      "string_value": "serial-number",
      "value_type": "xsd:string",
      "required": false
    },
    {
      "pref_label": "batch id",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001120",
      "string_value": "batch-number",
      "value_type": "xsd:string",
      "required": false
    },
    {
      "pref_label": "cell type (cell counter)",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001110",
      "string_value": "CHO",
      "value_type": "xsd:string",
      "required": false
    },
    {
      "pref_label": "cell density dilution factor",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001109",
      "numerical_value_double": 1.0,
      "value_type": "xsd:double",
      "required": false
    },
    {
      "pref_label": "viability",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001111",
      "unit_symbol": "percent",
      "unit_qudt_uri": "http://qudt.org/vocab/unit#Percent",
      "numerical_value_double": 0.1,
      "value_type": "xsd:double",
      "required": true
    },
    {
      "pref_label": "total cell density (cell counter)",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001112",
      "unit_symbol": "10^6*cells/ml",
      "unit_qudt_uri": "http://purl.allotrope.org/ontology/qudt-ext/unit#MillionCellsPerMilliliter",
      "numerical_value_double": 102.24,
      "value_type": "xsd:double",
      "required": false
    },
    {
      "pref_label": "viable cell density (cell counter)",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001108",
      "unit_symbol": "10^6*cells/ml",
      "unit_qudt_uri": "http://purl.allotrope.org/ontology/qudt-ext/unit#MillionCellsPerMilliliter",
      "numerical_value_double": 0.05,
      "value_type": "xsd:double",
      "required": true
    },
    {
      "pref_label": "average live cell diameter (cell counter)",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001113",
      "unit_symbol": "micrometer",
      "unit_qudt_uri": "http://qudt.org/vocab/unit#Micrometer",
      "numerical_value_double": 21.07,
      "value_type": "xsd:double",
      "required": false
    },
    {
      "pref_label": "viable cell count",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001115",
      "unit_symbol": "cell",
      "unit_qudt_uri": "http://purl.allotrope.org/ontology/qudt-ext/unit#Cell",
      "numerical_value_double": 1.0,
      "value_type": "xsd:double",
      "required": false
    },
    {
      "pref_label": "total cell count",
      "parameter_allotrope_uri": "http://purl.allotrope.org/ontologies/result#AFR_0001114",
      "unit_symbol": "cell",
      "unit_qudt_uri": "http://purl.allotrope.org/ontology/qudt-ext/unit#Cell",
      "numerical_value_double": 1972.0,
      "value_type": "xsd:double",
      "required": true
    }
  ],
  "datacubes": [
    {
      "name": "3D chromatogram",
      "description": "More information about the data cube. (Optional)",
      "uri": "http://some.uri.org/123",
      "measures": [
        {
          "name": "intensity",
          "uri": "http://some.uri.org/123/measure",
          "unit": "ArbitraryUnit",
          "unit_uri": "http://some.uri.org/123",
          "values": [
            [111, 112, 113, 114, 115],
            [221, 222, 223, 224, 225],
            [331, 332, 333, 334, 335]
          ]
        }
      ],
      "dimensions": [
        {
          "name": "wavelength",
          "uri": "http://www.example.org/test#test",
          "unit": "Nanometer",
          "unit_uri": "http://some.uri.org/123",
          "values": [
            180,
            190,
            200
          ]
        },
        {
          "name": "time",
          "uri": "http://some.uri.org/123/dimensiontime",
          "unit": "MinuteTime",
          "unit_uri": "http://some.uri.org/123",
          "values": [
            1,
            2,
            3,
            4,
            5
          ]
        }
      ]
    }
  ]
}

Tag summary

Content type

Image

Digest

Size

727.1 MB

Last updated

over 7 years ago

docker pull tetrascience/ts-service-allotrope-web