# Advanced: Extending an additional model

DCH's model generation tooling features the ability to provide existing model(s) as inputs and to extend those models. Note the tool has no capability to remove things from provided models, only to update them via the operations and information in the input CSVs.

To do this the provided zip file needs to contain a folder called `input_ttls`.  Any existing turtle files that you want to update need to be place in that folder with the file extension ".ttl".  Other than the .ttl extension the file names are not important; all files in the folder will be available to be updated.  Care must be taken to match URI's in provided turtle files with the manifest and model\_id used in the csv's.  There is one further combination of manifest id\_mapping, turtle file URIs and prefixes and csv model\_id's not covered in the URI discussion above:

#### Example 5: **Turtle file URIs matching manifest without prefixes matching model\_id's**

***

#### Inputs

{% code title="manifest.json" %}

```json
{
  "manifest_version": "1.0.0",
  "id_mapping": {
    "mySiteModel": "dch:org/documentation/site/Usage_Eg5_Tasmanian_Maritime_Museum#",
    "myBuildingModel": "dch:org/documentation/site/Usage_Eg5_Tasmanian_Maritime_Museum/building/museum_eg5#"
  },
  "operations": [
    {
      "operation_type": "CREATE",
      "config": {
        "object_file": "objects.csv"
      }
    }
  ]
}
```

{% endcode %}

{% code title="objects.csv" fullWidth="false" %}

```
Model_ID|Entity_Name,Class
mySiteModel|siteName,Site
myBuildingModel|buildingName,Building
```

{% endcode %}

Also providing the following input turtle files in the `input_ttls` folder in the provided zip file:

{% code title="input\_ttls/model\_site.ttl" %}

```turtle
@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix SITE: <dch:org/demo/site/Usage_Eg5_Tasmanian_Maritime_Museum#> .

SITE:siteName a brick:Site .
```

{% endcode %}

{% code title="input\_ttls/model\_building.ttl" %}

```turtle
@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix BUILDING: <dch:org/demo/site/Usage_Eg5_Tasmanian_Maritime_Museum/building/museum#> .

BUILDING:buildingName a brick:Building .
```

{% endcode %}

The key thing to note with this set of inputs is that the prefix in the provided `model_site.ttl`, "SITE"  is different to the model\_id used within `objects.csv`, "mySiteModel". Similarly, `model_building.ttl` defines the prefix as "BUILDING", while `objects.csv` sets the model\_id as myBuildingModel. However, the URIs defined within the `id_mapping` field of manifest.json match the model\_ids defined within `objects.csv`. In this situation the tool correctly identifies and maps the URIs irrespective of the different turtle file prefix.

{% file src="/files/Ua3cX8nKzi3pe1pW25UK" %}
Example 5: Full input archive
{% endfile %}

***

**Outputs**

Zipping up the Manifest, the input\_csvs folder and the input\_ttls folder and running the script will produce the following two output files.  No warnings are generated in the Log.

{% code title="mySiteModel.ttl" %}

```turtle
@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix mySiteModel: <dch:org/documentation/site/Usage_Eg5_Tasmanian_Maritime_Museum#> .

mySiteModel:siteName a brick:Site ;
    brick:keyValue [ brick:key "mgtool" ;
            brick:value "build date: 2024-04-08" ],
        [ brick:key "mgtool" ;
            brick:value "version: 2.0" ] .
```

{% endcode %}

{% code title="myBuildingModel.ttl" %}

```turtle
@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix myBuildingModel: <dch:org/documentation/site/Usage_Eg5_Tasmanian_Maritime_Museum/building/museum_eg5#> .

myBuildingModel:buildingName a brick:Building ;
    brick:keyValue [ brick:key "mgtool" ;
            brick:value "version: 2.0" ],
        [ brick:key "mgtool" ;
            brick:value "build date: 2024-04-08" ] .

```

{% endcode %}

The full output archive can be found below:

{% file src="/files/nQaexsdyWFYzIPZGQMCJ" %}
Example 5: Full output archive
{% endfile %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.dataclearinghouse.org/dch-2.0-documentation/si-docs/dch-onboarding-brick-model-construction/usage/advanced-extending-an-additional-model.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
