File
The File connector is a generic connector that can be used to bulk-create datasources with corresponding metadata using a CSV, JSON, or XSD file. Use this connector when direct datasource network connectivity is not an option, or to quickly onboard exported schema snapshots.
The file can either be manually uploaded or referred to using a URL (if it is hosted and accessible over HTTP).
The connector accepts a UTF-8 encoded delimited text file using either comma (,) or semicolon (;) as the delimiter; choose one delimiter and use it consistently throughout the file. Note that fields that include the delimiter must be enclosed in double quotes.
The first row must be a header row, where the values represent the field names specified in the Custom Import Query and Custom Relationship Import Query.
In addition, there is a column parent_field_path that accepts the full hierarchical field path within the same dataset, e.g. <field_name_1>::<field_name_2>. Any additional columns will be ignored.
Columns describing the dataset rather than the field — such as dataset_description, dataset_url, dataset_technical_definition, dataset_source_created and dataset_source_modified — only need a value on one row per dataset; it is applied to every row of that dataset.
The connector accepts a JSON file using the same schema as a system export returned by the Katalogue REST API.
That is, the JSON file should describe a system with a list of associated datasources. The JSON file must have at least one datasource.
// REST API system export (`/api/system/export/<system_id>`)// System declaration{ "system_id": "...", "datasources": [] // required}Datasources
Section titled “Datasources”Each datasource is processed for its name (required), description (optional), and associated dataset groups (required).
// Datasource declaration{ "datasource_id": "...", "datasource_name": "...", // required "datasource_description": "...", // optional "dataset_groups": [] // required}Dataset Groups
Section titled “Dataset Groups”Each dataset group is described by a name (required), description (optional), and associated datasets (required).
// Dataset group declaration{ "dataset_group_id": "...", "dataset_group_name": "...", // required "dataset_group_description": "...", // optional "datasets": [] // required}Datasets
Section titled “Datasets”Each dataset is described by a name (required), description (optional), type (optional), and associated fields.
// Dataset declaration{ "dataset_id": "...", "dataset_name": "...", // required "dataset_type_name": "...", // defaults to `table` "dataset_description": "...", // optional "dataset_source_created": "...", // optional — see Timestamps "dataset_source_modified": "...", // optional — see Timestamps "fields": [] // required}Fields
Section titled “Fields”Each field within a dataset is described by its name, type, and optional metadata.
// Field declaration{ "field_id": 1, // optional — used as a stable reference for parent_field_id and relationships "parent_field_id": null, // optional — field_id of the parent field (for nested/hierarchical fields) "field_name": "...", // required "field_source_description": "...", // optional "field_datatype": "...", // optional "field_datatype_length": null, // optional "field_datatype_precision": null, // optional "field_datatype_scale": null, // optional "field_is_primary_key": false, // optional "field_is_nullable": true, // optional "field_default_value": null, // optional "field_ordinal_position": null, // optional "field_to_relationships": [] // optional — see below}Nested fields
Section titled “Nested fields”Fields can be nested by setting parent_field_id to the field_id of another field in the same file. The matching happens after all fields from the import have been written to the database, so the parent does not need to pre-exist — it just needs to be present in the same import file.
field_id can be any unique string or integer within the file; it does not need to be a database ID.
Relationships
Section titled “Relationships”field_to_relationships is an array of outgoing field-level relationships from this field to fields in other datasets. Each entry must identify the target fully:
{ "to_datasource_name": "...", // required "to_dataset_group_name": "...", // required "to_dataset_name": "...", // required "to_field_name": "...", // required "relationship_name": "...", // optional — auto-generated if omitted "relationship_ordinal_position": 1 // optional — defaults to 1}XSD (experimental)
Section titled “XSD (experimental)”The connector accepts one well-formed XML Schema Definition file and imports the schema as one Katalogue dataset.
To get started, download the XSD connector example .
The example demonstrates supported elements, attributes, reusable types, groups, enumerations, lists, inheritance, simple content, documentation, and XML comments.
Connection configuration
Section titled “Connection configuration”Because one XSD file creates one dataset, its location and Katalogue context must be supplied in the connection form:
| Connection field | Purpose |
|---|---|
| File Type | Set to XSD. |
| Import File URL | URL or local path to the XSD file. Also used as the dataset name. |
| Datasource Name | Datasource under which the dataset is created. |
| Dataset Group Name | Dataset group under which the dataset is created. |
The connector uses Folder as the datasource type and markup as the dataset
type.
Namespace handling
Section titled “Namespace handling”The connector identifies XML Schema declarations through the W3C XML Schema namespace URI, not through a particular prefix.
These schema roots are therefore equivalent:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"><xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"><schemaDefinition:schema xmlns:schemaDefinition="http://www.w3.org/2001/XMLSchema">QName-valued attributes such as type, base, and ref are resolved using
their in-scope namespace declarations.
Named declarations are identified by expanded name:
{namespace-uri}localNameThis allows declarations with the same local name in different namespaces to remain distinct within the loaded schema document.
Imported fields
Section titled “Imported fields”The connector expands each global XSD element into a root Katalogue field.
Nested elements produce nested Katalogue fields. XSD attributes become child
fields using an @ prefix:
Customer├── Version└── @VersionThe @ prefix distinguishes an attribute from a child element with the same
local name.
The connector processes parents before children and rejects duplicate final field paths.
Supported constructs
Section titled “Supported constructs”The current single-document connector supports:
- Global elements
- Global element references
- Named and inline
complexType - Named and inline
simpleType sequence,choice, andallcomplexContent/extensionsimpleType/restrictionsimpleContent/extensionsimpleContent/restriction- Named and nested
groupreferences - Named and nested
attributeGroupreferences - Local attributes
- Built-in XSD datatypes
- Named simple-type restriction chains
enumerationlist- Restriction facets
- Abstract complex types and concrete implementations
- Optional, repeating, and nillable elements
- Optional and required attributes
- Recursive complex types
- Multiple global elements
Complex-content extension
Section titled “Complex-content extension”A complex type may extend another named complex type:
<xs:complexType name="CustomerType"> <xs:complexContent> <xs:extension base="tns:PartyType"> <xs:sequence> <xs:element name="CustomerId" type="tns:IdentifierType"/> </xs:sequence> </xs:extension> </xs:complexContent></xs:complexType>The inherited fields are imported before the locally declared fields.
complexContent/restriction is not currently supported. See
Limitations.
Model groups
Section titled “Model groups”Named model groups are expanded transparently:
<xs:group name="AuditFields"> <xs:sequence> <xs:element name="CreatedDateTime" type="xs:dateTime"/>
<xs:element name="CreatedBy" type="xs:string" minOccurs="0"/> </xs:sequence></xs:group><xs:group ref="tns:AuditFields"/>The group does not become a Katalogue field. Its contained elements become children of the surrounding field.
The connector supports:
- Nested group references
- Occurrence constraints on group references
- Choice semantics inside groups
- Reuse on independent schema branches
- Circular-reference detection
- Clear errors for unresolved group references
An optional group makes its contained fields nullable. A repeating group makes its contained fields repeating.
Attribute groups
Section titled “Attribute groups”Named attribute groups are also expanded transparently:
<xs:attributeGroup name="CommonAttributes"> <xs:attribute name="version" type="xs:string" use="required"/>
<xs:attribute name="language" type="xs:language"/></xs:attributeGroup><xs:attributeGroup ref="tns:CommonAttributes"/>The resulting fields are:
@version@languageNested attribute groups, declaration order, independent reuse, unresolved references, and circular references are handled explicitly.
Simple content
Section titled “Simple content”simpleContent represents an XML element containing a scalar value and
attributes.
Example:
<xs:complexType name="AmountType"> <xs:simpleContent> <xs:extension base="tns:PriceType"> <xs:attribute name="currency" type="xs:string" use="required"/> </xs:extension> </xs:simpleContent></xs:complexType>An instance may look like:
<Price currency="SEK">125.50</Price>Katalogue represents it as:
Price decimal└── @currency string, requiredBoth simpleContent/extension and simpleContent/restriction support:
- Built-in XSD base types
- Named simple-type bases
- Local attributes
- Attribute groups
- Inherited and local facets
- Enumeration narrowing
Arrays and lists
Section titled “Arrays and lists”A repeating XML element imports as array:
<xs:element name="Item" type="tns:ItemType" maxOccurs="unbounded"/>An XSD list imports as list:
<xs:simpleType name="TagsType"> <xs:list itemType="xs:string"/></xs:simpleType>These represent different XML structures:
- An array consists of repeated XML elements.
- A list is one XML value containing whitespace-separated items.
Abstract types and concrete implementations
Section titled “Abstract types and concrete implementations”If an element declares an abstract complex type, the connector expands its concrete derived implementations.
Payment├── CardPaymentType└── InvoicePaymentTypeConcrete implementations are represented as nullable type alternatives because an individual XML instance uses one implementation rather than all of them.
Recursive types
Section titled “Recursive types”Recursive complex types are represented as finite hierarchies.
The first occurrence is expanded normally. When the same type is encountered again on the active expansion path, the connector:
- Retains the real field.
- Retains the real complex datatype.
- Marks the semantic node as recursive.
- Stops expanding its children.
Conceptually:
CreatedFrom: IdentityHistory├── EstimateIdentity└── CreatedFrom: IdentityHistory [recursive reference]The connector does not expand a recursive schema to an arbitrary fixed depth and does not add a synthetic circular-reference field.
Nullability and repetition
Section titled “Nullability and repetition”Element nullability can result from
="0"nillable="true"- An optional surrounding compositor or group
- An alternative inside
choice - A concrete implementation being one of several type alternatives
An attribute is nullable unless it declares:
use="required"Repetition can result from the element itself or from a surrounding repeating compositor or group.
Restriction facets
Section titled “Restriction facets”Four facets populate Katalogue datatype properties. Other facets, such as
pattern or minInclusive, are not imported:
| XSD facet | Katalogue property |
|---|---|
length | Datatype length |
maxLength | Datatype length |
totalDigits | Datatype precision |
fractionDigits | Datatype scale |
When a derived restriction repeats a facet kind, the most-derived value is used for the Katalogue datatype property.
Example:
Inherited maxLength: 20Local maxLength: 12Katalogue length: 12Descriptions, comments, and enumerations
Section titled “Descriptions, comments, and enumerations”Descriptions are extracted from standard annotation/documentation
declarations:
<xs:element name="MessageId" type="xs:string"> <xs:annotation> <xs:documentation> Unique identifier for the message. </xs:documentation> </xs:annotation></xs:element>Without documentation, the XML comments directly before a declaration become its description:
<!-- Unique identifier for the message. Assigned by the sending system.--><!-- Never reused. --><xs:element name="MessageId" type="xs:string"/>- Every comment directly before the declaration is used, each on its own line. Line breaks inside a comment are kept, and empty lines are removed.
- A comment belongs to the declaration that follows it, so write it above the element or attribute it describes, not after it on the same line.
- A comment that starts with
<or ends with>is commented-out markup, such as<!-- No longer used <xs:element name="Old"/> -->. It is skipped, together with any comments directly before it, since they describe the removed declaration. - When a declaration has documentation, the first
xs:documentationis its description and its comments are not used.
A field without a description of its own takes the description of the global element it references, and otherwise the description of its type.
Enumeration values are not appended to the field description and are not yet persisted as Katalogue Attribute Values.
Limitations
Section titled “Limitations”The following constructs are intentionally deferred:
complexContent/restrictionincludeimportunion- Global
attributereferences redefineoverride- Configurable parser and schema-set resource limits
Complex-content restrictions
Section titled “Complex-content restrictions”A complex-content restriction defines a narrower effective content model. It cannot be represented correctly by simply merging all inherited fields with the locally declared fields, because that may retain elements or attributes that the restricted type excludes.
The connector rejects complexContent/restriction rather than importing an
inaccurate hierarchy.
Includes and imports
Section titled “Includes and imports”The connector processes one XSD document. All referenced declarations must therefore be present in that document.
External schema loading would require path and URI resolution, namespace-aware schema-set merging, dependency-cycle detection, duplicate handling, and resource limits.
Choice and repeated-group representation
Section titled “Choice and repeated-group representation”Choice alternatives are flattened beneath their semantic parent. Katalogue does not currently persist the rule that only one alternative may occur.
Repeating groups are flattened into their contained fields. Katalogue does not retain tuple-like grouping between corresponding child values in each runtime occurrence.
XSD-specific metadata
Section titled “XSD-specific metadata”Some XSD semantics are retained by the connector but do not currently have a dedicated persistence target in Katalogue, including:
- Type category
- Collection and list item type
- Type-alternative and synthetic-node flags
- Recursive-reference metadata
- Nullability causes
- Structured description provenance
- Enumeration values
- Complete inherited and local facet provenance
Template files
Section titled “Template files”The following downloadable examples can be used as starting points for file connector imports:
- sample database with relationships: [CSV, JSON, JSON light]
- hierarchical dataset with nested fields: [CSV]
- respresentative XSD schema: [XSD]
Validations
Section titled “Validations”Import is all-or-nothing. If any record in the file fails validation, the entire import is rejected and no data is written.
Timestamps
Section titled “Timestamps”dataset_source_created and dataset_source_modified accept any timestamp PostgreSQL understands, and a value that does not state a time zone is read as UTC — so 2025-11-17T13:43:52 and 2025-11-17T13:43:52Z mean the same thing, and 2025-11-17T13:43:52+02:00 means an hour earlier. A value that is not a timestamp fails the import and names the column.
Format Checks
Section titled “Format Checks”| Format | Checks |
|---|---|
| CSV | Delimiter must be , or ;. The header row must contain all required columns (see below). Quoted fields must have a matching closing quote. |
| JSON | File must be a JSON object ({...}). Must contain at least one datasource. Must produce at least one field record. |
| XSD | File must be well-formed XML with a schema root in the W3C XML Schema namespace. The namespace may use xs, xsd, or another declared prefix. The parsed schema must produce at least one field record and must not contain duplicate flattened field paths. |
Required Fields Per Record
Section titled “Required Fields Per Record”The following fields are required and must be non-empty for every record in the file, regardless of format. Validation fails immediately if any of these are missing.
| Field | CSV column | JSON field |
|---|---|---|
| Datasource name | datasource_name | datasource_name |
| Dataset group name | dataset_group_name | dataset_group_name |
| Dataset name | dataset_name | dataset_name |
| Dataset type | dataset_type_name | dataset_type_name |
| Field name | field_name | field_name |
| Data type | datatype_name | field_datatype |
Controlled Vocabulary Fields
Section titled “Controlled Vocabulary Fields”The following fields must match a value that exists in the Katalogue database (case-insensitive). If the value is not found, the import fails with an error listing the allowed values.
| Field | Allowed values | Default if omitted |
|---|---|---|
datasource_type_name | Values from the Datasource Types list (e.g. Database, Folder, API, …) | Other |
dataset_type_name | Values from the Dataset Types list (e.g. table, view, …) | (none — required) |
Parent Field References
Section titled “Parent Field References”CSV: parent_field_path must match the full path of an existing field in the same file. Paths are built by joining ancestor field names with :: (e.g. root::child). A reference to a non-existent parent fails the import.
JSON: parent_field_id is resolved after the import by matching it against field_id values from the same file. There is no pre-import validation — an unresolvable reference is silently ignored rather than causing the import to fail.
Relationship References
Section titled “Relationship References”For CSV and JSON, if a relationship target is partially specified the import will fail. All four target fields must be present together:
to_datasource_nameto_dataset_group_nameto_dataset_nameto_field_name