API#

The FAIR Data Station also has an API function. At the moment only the validator is available through the API.

Validator#

To validate an excel file you can use the following command:

curl -X POST http://localhost:8083/api/upload -F "file=@/Users/koeho006/Downloads/ValidationDemo.xlsx"

This is used through the bash environment but it supports any programming language that can post and receive data.

It will either return the RDF file or a validatione error:

curl -X POST http://localhost:8083/api/upload -F "file=@/Users/koeho006/Downloads/ValidationDemo.xlsx"
 does not match the pattern of (female|hermaphrodite|male|neuter|not applicable|not collected|not provided|other|restricted access) regex (female|hermaphrodite|male|neuter|not applicable|not collected|not provided|other|restricted access) such as in example "female"
(female|hermaphrodite|male|neuter|not applicable|not collected|not provided|other|restricted access)
femalee% 

Terms#

To get the terms that are used in the FAIR Data Station you can use the following command:

curl http://localhost:8083/api/terms    

This will return a JSON file with all the terms that are used in the FAIR Data Station.

{
  "total": 893,
  "terms": {
    "plant body site": {
      "label": "plant body site",
      "syntax": null,
      "example": null,
      "preferredUnit": null,
      "definition": "name of body site that the sample was obtained from. For Plant Ontology (PO) (v 20) terms, see http://purl.bioontology.org/ontology/PO",
      "ontology": null,
      "regex": ".*",
      "file": false,
      "date": false,
      "dateTime": false,
      "url": "http://fairbydesign.nl/ontology/plant_body_site"
    },
    "study title": {
      "label": "study title",
      "syntax": "{text}{10,}",
      "example": "Cultivation and characterization of anaerobic Dehalobacter-enriched microbial cultures that dechlorinate monochlorobenzene to benzene ",
      "preferredUnit": null,
      "definition": "Title describing the study",
      "ontology": null,
      "regex": ".*{10,}",
      "file": false,
      "date": false,
      "dateTime": false,
      "url": "http://schema.org/title"
    },
    ...
  }
}

Packages#

The FAIR Data Station is built using several packages. The main packages are: Investigation, Study, Observationunit, Sample and Assay. To get the packages that are used in the FAIR Data Station you can use the following command:

curl http://localhost:8083/api/packages

This will return a JSON file with all the packages that are used in the FAIR Data Station.

{
  "total": 5,
  "packages": {
    "observationunit": [
      {
        "definition": "Identifier corresponding to the entity that is being observed",
        "sheetName": "ObservationUnit",
        "packageName": "default",
        "requirement": "MANDATORY",
        "label": "observation unit identifier",
        "sessionID": "no_session",
        "term": {
          "label": "observation unit identifier",
          "syntax": "{id}{5,25}$",
          "example": "S1005TX",
          "preferredUnit": null,
          "definition": "Identifier corresponding to the entity that is being observed",
          "ontology": null,
          "regex": "^[a-zA-Z0-9-_.]*{5,25}$",
          "file": false,
          "date": false,
          "dateTime": false,
          "url": "http://schema.org/identifier"
        }
      },
      {
        "definition": "Name of the entity being observed",
        "sheetName": "ObservationUnit",
        "packageName": "default",
        "requirement": "MANDATORY",
        "label": "observation unit name",
        "sessionID": "no_session",
        ...
      }
    ],
    ...
    }
}

This overview is very similar to the terms overview but now the terms are grouped by package. It also contains the requirement level of the term and the sheet name where the term is located. Note: Some terms can have different regex patterns depending on the package they are used in.