# Obtaining information contained within TSV export of data model via JSON and XML

**URL:** https://speciforum.org/t/obtaining-information-contained-within-tsv-export-of-data-model-via-json-and-xml/1610
**Category:** Get Help
**Created:** [March 12, 2024, 4:41pm UTC](https://speciforum.org/t/obtaining-information-contained-within-tsv-export-of-data-model-via-json-and-xml/1610 "2024-03-12T16:41:24Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![markp](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/markp/32/1184_2.png) [@markp](https://speciforum.org/u/markp)
#### Post date: [March 12, 2024, 4:41pm UTC](https://speciforum.org/t/obtaining-information-contained-within-tsv-export-of-data-model-via-json-and-xml/1610/1 "2024-03-12T16:41:24Z")

</div>

## Outline

I have started working on a script that will take a data-schema download from our Specify 7 and split it up into the relevant tables that we use so that these tables can be added to the documentation. I noticed that there are three formats that the data is available in:

- JSON available at [https://sp7demofish.specifycloud.org/context/datamodel.json](https://sp7demofish.specifycloud.org/context/datamodel.json)
- XML available at [https://sp7demofish.specifycloud.org/static/config/specify\_datamodel.xml](https://sp7demofish.specifycloud.org/static/config/specify_datamodel.xml)
- TSV available via a button

My conundrum is that these formats seem to have different data exposed, and I am interested in some of the fields that are only contained in the TSV. `Text1` in Collection Object is used as the example

### JSON

```json
{
name: "text1",
column: "Text1",
indexed: false,
unique: false,
required: false,
type: "text",
length: 65535
}

```

### XML

```xml
<field column="Text1" name="text1" type="text" length="65535" 
updatable="true" required="false" unique="false" indexed="false" 
partialDate="false"/>

```

### TSV

| Table | Label | Is System | Is Hidden | Table ID | Name | Label\_1 | Description | Is Hidden\_2 | Read-only | Is Required | Relationship | Type | Length | Database Column | Related Model | Other side name | Dependent |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| CollectionObject | Collection Object | No | No | 1 | text1 | Other number | User definable. | No | No | No | No | text | 65535 | Text1 | | | |

As outlined above, both the JSON and XML can be accessed through a url, but the TSV seems to be generated by a function instead.

```typescript
<Button.Info
    className="print:hidden"
       onClick={(): void =>
         void downloadFile(
            `${schemaText.schemaExportFileName()} - v${
              getSystemInfo().schema_version
            }.tsv`,
              schemaToTsv()
            ).catch(softFail)
          }
        >
    {schemaText.downloadAsTsv()}
</Button.Info>

```

## Question

**Is there a way for us to expand the information that is included in the JSON or the XML datamodel?** This way, all the information contained within the tsv format could be fetched for all collections with one run, instead of 11 (switch collection, hit button to download, rinse and repeat)

---

<div class="post-metadata">

### Author: ![mcruz](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/mcruz/32/451_2.png) [@mcruz](https://speciforum.org/u/mcruz)
#### Post date: [March 14, 2024, 2:34pm UTC](https://speciforum.org/t/obtaining-information-contained-within-tsv-export-of-data-model-via-json-and-xml/1610/2 "2024-03-14T14:34:47Z")

</div>

What about using a SQL DB to JSON exporter?  
You would connect the tool directly to the Specify SQL DB and then export table definitions, or data, or whatever in JSON form… Some SQL tools have this built in, some do not.

---

<div class="post-metadata">

### Author: ![markp](https://yyz1.discourse-cdn.com/flex029/user_avatar/speciforum.org/markp/32/1184_2.png) [@markp](https://speciforum.org/u/markp)
#### Post date: [March 14, 2024, 4:13pm UTC](https://speciforum.org/t/obtaining-information-contained-within-tsv-export-of-data-model-via-json-and-xml/1610/3 "2024-03-14T16:13:04Z")

</div>

A great idea! I will give this a method a go!
