Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
briehl committed Dec 19, 2024
1 parent aa24fff commit cace658
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 12 deletions.
37 changes: 26 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -819,21 +819,27 @@ Error Connecting to auth service ...
### Parse bulk specifications

This endpoint parses one or more bulk specification files in the staging area
into a data
structure (close to) ready for insertion into the Narrative bulk import or
analysis cell.
into a data structure (close to) ready for insertion into the Narrative bulk
import or analysis cell.

It can parse `.tsv`, `.csv`, and Excel (`.xls` and `.xlsx`) files. Templates for
the currently
supported data types are available in
By default, it can parse `.tsv`, `.csv`, and Excel (`.xls` and `.xlsx`) files.
Templates for the currently supported data types are available in
the [templates](./import_specifications/templates)
directory of this repo. See
the [README.md](./import_specifications/templates/README.md) file
for instructions on template usage.

When given the `dts` flag in the URL, this endpoint can also parse manifest
files that come from the KBase [Data Transfer Service](https://github.com/kbase/dts) (DTS)
See [here](https://kbase.github.io/dts) for further documentation on the service.
This service copies data files from external sources into a KBase user's staging
area, accompanied by a `manifest.json` file. These also contain information on how to
load files into KBase importer apps. However, since they are a very specific format,
this means adding a `dts` flag to the URL. When this flag is present, all files
are expected to be `.json` files and conform to the [DTS schema](./import_specifications/schema/dts_manifest_schema.json).

See the [import specification ADR document](./docs/import_specifications.ADR.md)
for design
details.
for design details.

**URL** : `ci.kbase.us/services/staging_service/bulk_specification`

Expand All @@ -847,15 +853,24 @@ details.

**Code** : `200 OK`

**Content example**
**Content examples**

```
GET bulk_specification/?files=file1.<ext>[,file2.<ext>,...]
```

`<ext>` is one of `csv`, `tsv`, `xls`, or `xlsx`.

Reponse:

```
GET bulk_specification/?files=file1.json[,file2.json,...]&dts
```

When using the `dts` flag, all files must be JSON and have the `.json` extension.

Both versions of the endpoint respond in the same format.

Response:

```
{
Expand Down Expand Up @@ -1041,7 +1056,7 @@ POST write_bulk_specification/
- `data` contains any data to be written to the file as example data, and is analogous to the data structure returned from the parse endpoint. To specify that no data should be written to the template provide an empty list.
- `<value for ID, row N>` is the value for the input for a given `spec.json` ID and import or analysis instance, where an import/analysis instance is effectively a row in the data file. Each data file row is provided in order for each type. Each row is provided in a mapping of `spec.json` ID to the data for the row. Lines > 3 in the templates are user-provided data, and each line corresponds to a single import or analysis.

Reponse:
Response:

```
{
Expand Down
6 changes: 5 additions & 1 deletion import_specifications/readme.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
This directory contains templates for bulk import specifications to be parsed by the
import specfication endpoint, and example code for how to generate them automatically.
import specfication endpoint, and example code for how to generate them automatically.

This also contains a subdirectory for storing JSON Schemas that describe JSON-based
import specifications. These should be referenced by deployment and testing configuration
as necessary.

0 comments on commit cace658

Please sign in to comment.