Interoperability
Learn how Knowledge Graphs enable seamless data exchange across systems through standard formats, protocols, and vocabularies. Master interoperability patterns for connected AI systems.
Interoperability
Interoperability is the ability of different systems, applications, and organizations to exchange and use data seamlessly. In Knowledge Graph systems like TrustGraph, interoperability is achieved through standard formats (RDF, JSON-LD, GraphML), standard protocols (SPARQL, GraphQL, REST), and shared vocabularies (Schema.org, FOAF), enabling AI systems to connect and share knowledge across boundaries.
Why Interoperability Matters
Without Interoperability
// System A: Custom format
const systemA = {
personID: "123",
fullname: "Alice Johnson",
company: { companyID: "456", companyName: "TechCorp" }
};
// System B: Different custom format
const systemB = {
employee_id: "123",
name: { first: "Alice", last: "Johnson" },
employer: "TechCorp",
org_id: "456"
};
// Problem: How to integrate these?
// - Different field names (fullname vs name)
// - Different structures (nested vs flat)
// - Different identifiers (personID vs employee_id)
// - No semantic meaning
❌ Manual mapping required ❌ Brittle integrations ❌ Semantic ambiguity ❌ Difficult to scale
With Interoperability
// Both systems use Schema.org standard
{
"@context": "https://schema.org",
"@type": "Person",
"@id": "http://example.org/people/alice",
"name": "Alice Johnson",
"worksFor": {
"@type": "Organization",
"@id": "http://example.org/orgs/techcorp",
"name": "TechCorp"
}
}
✅ Standard format (JSON-LD) ✅ Shared vocabulary (Schema.org) ✅ Global identifiers (URIs) ✅ Semantic clarity ✅ Automatic integration
Dimensions of Interoperability
1. Technical Interoperability
Definition: Systems can exchange data through standard protocols and formats.
// Standard protocols
const apis = {
rest: "https://api.example.org/v1/entities",
graphql: "https://api.example.org/graphql",
sparql: "https://api.example.org/sparql",
grpc: "api.example.org:50051"
};
// Standard formats
const formats = [
"application/json",
"application/ld+json", // JSON-LD
"text/turtle", // Turtle (RDF)
"application/rdf+xml", // RDF/XML
"text/csv",
"application/graphml+xml" // GraphML
];
// TrustGraph supports all standard protocols
await trustgraph.enableAPIs({
rest: true,
graphql: true,
sparql: true,
grpc: true,
// Content negotiation
formats: formats
});
2. Semantic Interoperability
Definition: Systems understand the meaning of exchanged data.
// Semantic interoperability through shared vocabulary
const person = {
"@context": "https://schema.org",
"@type": "Person",
// All systems understand these terms
"name": "Alice Johnson",
"email": "alice@techcorp.com",
"jobTitle": "Software Engineer",
// Linked to external identifiers
"sameAs": [
"https://www.linkedin.com/in/alicejohnson",
"https://orcid.org/0000-0001-2345-6789"
]
};
// Import into TrustGraph with semantic understanding
await trustgraph.import({
data: person,
vocabulary: "https://schema.org",
semanticMapping: true
});
3. Syntactic Interoperability
Definition: Systems use compatible data structures and schemas.
// Define schema for interoperability
const schema = {
"@context": {
"@vocab": "https://schema.org/",
"name": "https://schema.org/name",
"email": "https://schema.org/email",
"worksFor": {
"@id": "https://schema.org/worksFor",
"@type": "@id"
}
},
// JSON Schema for validation
"type": "object",
"properties": {
"@type": { "const": "Person" },
"name": { "type": "string" },
"email": { "type": "string", "format": "email" },
"worksFor": { "$ref": "#/definitions/Organization" }
}
};
// Validate data against schema
await trustgraph.validateSchema(person, schema);
Standard Formats for Interoperability
1. RDF (Resource Description Framework)
Universal format for graph data:
# Turtle format (human-readable RDF)
@prefix schema: <https://schema.org/> .
@prefix ex: <http://example.org/> .
ex:alice a schema:Person ;
schema:name "Alice Johnson" ;
schema:email "alice@techcorp.com" ;
schema:worksFor ex:techcorp .
ex:techcorp a schema:Organization ;
schema:name "TechCorp" .
TrustGraph RDF Support:
// Import RDF
await trustgraph.importRDF({
source: "data.ttl",
format: "turtle"
});
// Export RDF
await trustgraph.exportRDF({
output: "export.ttl",
format: "turtle"
});
// Convert between RDF formats
await trustgraph.convertRDF({
input: "data.ttl",
inputFormat: "turtle",
output: "data.rdf",
outputFormat: "rdf-xml"
});
2. JSON-LD (JSON for Linked Data)
JSON with semantic meaning:
{
"@context": "https://schema.org",
"@graph": [
{
"@id": "http://example.org/people/alice",
"@type": "Person",
"name": "Alice Johnson",
"worksFor": {
"@id": "http://example.org/orgs/techcorp"
}
},
{
"@id": "http://example.org/orgs/techcorp",
"@type": "Organization",
"name": "TechCorp"
}
]
}
TrustGraph JSON-LD Support:
// Import JSON-LD
await trustgraph.importJSONLD({
source: "data.jsonld"
});
// Export JSON-LD
const jsonld = await trustgraph.exportJSONLD({
entities: ["alice", "techcorp"],
context: "https://schema.org",
frame: {
"@type": "Person",
"worksFor": {
"@embed": true
}
}
});
3. GraphML
Standard XML format for graphs:
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">
<key id="name" for="node" attr.name="name" attr.type="string"/>
<key id="type" for="edge" attr.name="type" attr.type="string"/>
<graph id="G" edgedefault="directed">
<node id="alice">
<data key="name">Alice Johnson</data>
</node>
<node id="techcorp">
<data key="name">TechCorp</data>
</node>
<edge source="alice" target="techcorp">
<data key="type">worksFor</data>
</edge>
</graph>
</graphml>
TrustGraph GraphML Support:
// Import GraphML
await trustgraph.importGraphML({
source: "graph.graphml"
});
// Export GraphML
await trustgraph.exportGraphML({
output: "export.graphml",
includeAttributes: true
});
4. CSV (Comma-Separated Values)
Simple tabular format:
# nodes.csv
id,type,name,email
alice,Person,Alice Johnson,alice@techcorp.com
techcorp,Organization,TechCorp,
# edges.csv
source,target,type,since
alice,techcorp,WORKS_AT,2020-01-15
TrustGraph CSV Support:
// Import CSV
await trustgraph.importCSV({
nodes: "nodes.csv",
edges: "edges.csv",
nodeIdColumn: "id",
edgeSourceColumn: "source",
edgeTargetColumn: "target"
});
// Export CSV
await trustgraph.exportCSV({
nodesOutput: "nodes.csv",
edgesOutput: "edges.csv"
});
Standard Protocols for Interoperability
1. REST API
// TrustGraph REST API
const api = {
// Get entity
GET: "/api/v1/entities/{id}",
// Create entity
POST: "/api/v1/entities",
// Update entity
PUT: "/api/v1/entities/{id}",
// Delete entity
DELETE: "/api/v1/entities/{id}",
// Query graph
POST: "/api/v1/query",
// Search
GET: "/api/v1/search?q={query}"
};
// Use REST API
const response = await fetch("https://api.example.org/api/v1/entities/alice", {
headers: {
"Accept": "application/ld+json" // Request JSON-LD format
}
});
const entity = await response.json();
2. SPARQL Endpoint
// Query via SPARQL
const query = `
PREFIX schema: <https://schema.org/>
SELECT ?person ?name ?company
WHERE {
?person a schema:Person ;
schema:name ?name ;
schema:worksFor ?org .
?org schema:name ?company .
}
`;
// Execute SPARQL query
const results = await fetch("https://api.example.org/sparql", {
method: "POST",
headers: {
"Content-Type": "application/sparql-query",
"Accept": "application/sparql-results+json"
},
body: query
});
const data = await results.json();
3. GraphQL API
// GraphQL schema
const schema = `
type Person {
id: ID!
name: String!
email: String
worksFor: Organization
}
type Organization {
id: ID!
name: String!
employees: [Person!]!
}
type Query {
person(id: ID!): Person
organization(id: ID!): Organization
search(query: String!): [Entity!]!
}
`;
// Query via GraphQL
const query = `
query {
person(id: "alice") {
name
email
worksFor {
name
}
}
}
`;
const response = await fetch("https://api.example.org/graphql", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ query })
});
4. gRPC
// Protocol Buffers definition
syntax = "proto3";
service KnowledgeGraph {
rpc GetEntity(EntityRequest) returns (Entity);
rpc CreateEntity(Entity) returns (EntityResponse);
rpc QueryGraph(GraphQuery) returns (stream QueryResult);
}
message Entity {
string id = 1;
string type = 2;
map<string, string> properties = 3;
}
// Use gRPC client
import { KnowledgeGraphClient } from "./generated/kg_grpc_pb";
const client = new KnowledgeGraphClient("api.example.org:50051");
const entity = await client.getEntity({ id: "alice" });
Shared Vocabularies
Schema.org
Most widely used vocabulary for structured data:
{
"@context": "https://schema.org",
"@type": "Person",
"name": "Alice Johnson",
"jobTitle": "Software Engineer",
"worksFor": {
"@type": "Organization",
"name": "TechCorp",
"industry": "Technology"
},
"alumniOf": {
"@type": "EducationalOrganization",
"name": "MIT"
}
}
FOAF (Friend of a Friend)
Social network vocabulary:
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
ex:alice a foaf:Person ;
foaf:name "Alice Johnson" ;
foaf:mbox <mailto:alice@techcorp.com> ;
foaf:knows ex:bob ;
foaf:workplaceHomepage <http://techcorp.com> .
Dublin Core
Metadata vocabulary:
@prefix dc: <http://purl.org/dc/elements/1.1/> .
ex:document a dc:Text ;
dc:title "Knowledge Graphs for AI" ;
dc:creator "Alice Johnson" ;
dc:date "2025-12-24" ;
dc:subject "Artificial Intelligence" ;
dc:format "application/pdf" .
Interoperability Patterns
1. Data Exchange
// System A exports data
const exportedData = await systemA.export({
format: "json-ld",
vocabulary: "https://schema.org"
});
// System B imports data
await systemB.import({
data: exportedData,
format: "json-ld",
validate: true
});
2. Federation
Query across multiple systems:
// Federated query across multiple Knowledge Graphs
const results = await trustgraph.federatedQuery({
query: "Find all people who work in technology",
endpoints: [
"https://kg1.example.org/sparql",
"https://kg2.example.org/sparql",
"https://kg3.example.org/sparql"
],
// Merge results
merge: true,
// Resolve entity matches
entityResolution: true
});
3. Entity Linking
Link entities across systems:
// Link local entity to external entities
await trustgraph.linkEntity({
localEntity: "alice",
externalEntities: [
"https://dbpedia.org/resource/Alice_Johnson",
"https://www.wikidata.org/wiki/Q123456",
"https://www.linkedin.com/in/alicejohnson"
],
linkType: "owl:sameAs"
});
// Query linked entities
const enrichedData = await trustgraph.getEntity("alice", {
followLinks: true,
maxDepth: 2
});
4. Schema Mapping
Map between different schemas:
// Define mapping between schemas
const mapping = {
source: "custom_schema",
target: "https://schema.org",
mappings: [
{
source: "fullname",
target: "name",
transform: (value) => value
},
{
source: "company.companyName",
target: "worksFor.name",
transform: (value) => value
},
{
source: "email_address",
target: "email",
transform: (value) => value.toLowerCase()
}
]
};
// Apply mapping during import
await trustgraph.import({
data: customData,
mapping: mapping
});
TrustGraph Interoperability Features
Multi-Format Support
// Import from any format
await trustgraph.import({
source: "data",
format: "auto-detect", // Detects format automatically
supportedFormats: [
"json-ld",
"turtle",
"rdf-xml",
"n-triples",
"graphml",
"csv",
"json",
"yaml"
]
});
// Export to any format
await trustgraph.export({
output: "export",
format: "json-ld", // or any supported format
prettify: true
});
Protocol Support
// Enable all protocols
await trustgraph.enableProtocols({
rest: { port: 8001, auth: "jwt" },
graphql: { port: 8002, introspection: true },
sparql: { port: 8003, federatedQuery: true },
grpc: { port: 50051, tls: true }
});
Vocabulary Integration
// Register vocabularies
await trustgraph.registerVocabularies([
"https://schema.org",
"http://xmlns.com/foaf/0.1/",
"http://purl.org/dc/terms/",
"custom_vocabularies/domain.ttl"
]);
// Auto-map to vocabularies
await trustgraph.import({
data: customData,
autoMapVocabularies: true
});
Best Practices
- Use Standard Formats: Prefer JSON-LD, RDF/Turtle over custom formats
- Adopt Standard Vocabularies: Use Schema.org, FOAF instead of inventing terms
- Provide Multiple Protocols: Support REST, GraphQL, SPARQL for flexibility
- Use Global Identifiers: URIs/IRIs for entities
- Document Mappings: Clear documentation for schema mappings
- Version APIs: Semantic versioning for API changes
- Content Negotiation: Support multiple formats via Accept headers
- Test Interoperability: Validate with external systems regularly
Challenges and Solutions
| Challenge | Solution |
|---|---|
| Schema Mismatches | Use schema mapping and transformation |
| Semantic Ambiguity | Adopt standard vocabularies (Schema.org) |
| Identifier Conflicts | Use URIs and owl:sameAs linking |
| Format Incompatibility | Support multiple formats with conversion |
| Performance | Cache conversions, optimize serialization |
| Versioning | Semantic versioning, backward compatibility |
Related Concepts
- Semantic Web - Web of machine-readable data
- Semantic Structures - Structured knowledge representation
- GraphQL - Query language for APIs
- SPARQL - RDF query language
- Vocabulary - Standardized terms
- Triples - RDF data model