How to develop and register Source Adapters
A Source Adapter supplies knowledge that backs the Business Concept Map. It reads business concepts and relationships from a source and provides the complete graph as JSON-LD for KGM to ingest.
Adapters are registered via KGM configuration.
Refer to the Source Adapter API reference for complete details about the REST endpoints that must be implemented by a Source Adapter.
Implementing an Ingestion Adapter
To support ingestion, your adapter must expose:
GET /v1/graph/jsonld
KGM calls this endpoint to ingest the graph of concepts and relationships from the source.
Requirements
Your adapter must:
- return a valid JSON-LD document (
Content-Type: application/ld+json) - include all concepts and relationships from the source
- represent the graph using RDF in JSON-LD
- return the JSON-LD as a file (OpenAPI:
type: string,format: binary) - support large outputs (KGM streams the file on read)
Example
1. Source
Imagine your upstream source contains the following concepts:
Customer
Definition: "A person or organization that purchases goods or services."
Order
Definition: "A commercial request issued by a customer to purchase goods or services."
Related to: Customer
Invoice
Definition: "A financial document issued to a customer after an order has been created."
Broader than: Order
This is a typical business glossary structure:
- Customer is a top-level concept
- Order is associated to Customer
- Invoice is a subtype/narrower concept of Order
Your Source Adapter must convert this into JSON-LD representing RDF triples.
2. JSON-LD Representation
The ingestion adapter will return one JSON-LD document describing all concepts and relationships.
The adapter may use a custom vocabulary or SKOS or any RDF-compliant schema.
The example below is a generic KGM ingestion example.
To display this data in the Business Concept Map, configure a Business Concept Model that matches the types and predicates supplied by the adapter. The model determines how concepts, labels, definitions, and relationships are interpreted. SKOS is one possible vocabulary, not a requirement for every adapter.
For Business Concept Map-compatible payloads, follow the dedicated guide: How to populate the Business Concept Map.
Below is an example using a simple custom vocabulary, with compact IRIs defined via @context.
{
"@context": {
"ex": "https://example.com/vocab/",
"concept": "https://example.com/concepts/",
"label": "ex:label",
"definition": "ex:definition",
"broader": "ex:broader",
"related": "ex:related"
},
"@graph": [
{
"@id": "concept:Customer",
"@type": "ex:BusinessConcept",
"label": "Customer",
"definition": "A person or organization that purchases goods or services."
},
{
"@id": "concept:Order",
"@type": "ex:BusinessConcept",
"label": "Order",
"definition": "A commercial request issued by a customer to purchase goods or services.",
"related": { "@id": "concept:Customer" }
},
{
"@id": "concept:Invoice",
"@type": "ex:BusinessConcept",
"label": "Invoice",
"definition": "A financial document issued to a customer after an order has been created.",
"broader": { "@id": "concept:Order" }
}
]
}
Remote context loading is disabled
The JSON-LD specification JSON-LD supports loading contexts from external URLs (for example, "@context": "htts://example.tld/context.tld").
Example of a JSON-LD document with remote context:
{
"@context": "https://example.tld/context.tld", // remote context
"@type": "Person",
"prefix:name": "John Doe",
"prefix:email": "john@example.com"
}
In the example above, the JSON-LD processor would normally make an HTTPS request to https://example.tld to fetch the context definition.
However, to prevent outbound network calls from the cluster, remote context loading is disabled.
If your JSON-LD documents rely on specific context definitions, consider including the context inline within your documents rather than referencing remote URLs.
{
// Explicit context object
"@context": {
"prefix": "http://sample.tld"
},
"@type": "Person",
"prefix:name": "John Doe",
"prefix:email": "john@example.com"
}
Configuring an Ingestion Adapter in KGM
Ingestion adapters are registered statically in the KGM configuration.
Example:
kgm:
sources:
- id: domain-glossary
name: My Domain Glossary
baseUrl: 'https://glossary.example.com'
modes:
ingest:
enabled: true
schedule: '0 0 12 ? * * *'
Meaning:
- KGM will call the ingestion endpoint every day at 12 pm
- The entire JSON-LD graph will be streamed and ingested and will replace any previously ingested knowledge from the same source
When a Source Adapter is unregistered (removed from the KGM configuration), all triples previously ingested from that source are automatically removed from KGM.
Verify the Supplied Knowledge
After the scheduled ingestion completes, check that the expected concepts and relationships appear in the Business Concept Map. If data is missing, verify the adapter's JSON-LD export, the ingestion configuration, and the active Business Concept Model.
See How to populate the Business Concept Map for the complete setup and troubleshooting guidance.