RDF Mapping Language (RML) is a declarative, rule-based language for defining custom mappings that transform heterogeneous data from sources like CSV, JSON, XML, and relational databases into RDF triples for knowledge graph population. It extends the W3C's R2RML standard to handle non-relational data, enabling engineers to specify how source fields map to ontology classes, properties, and IRIs in a deterministic, reusable mapping document.
Glossary
RDF Mapping (RML)

What is RDF Mapping (RML)?
RDF Mapping Language (RML) is the declarative standard for transforming heterogeneous raw data into a structured knowledge graph.
RML operates as the core transformation engine in a semantic ETL pipeline, separating mapping logic from application code for maintainability. Mappers use RML rules to define logical sources, subject maps, and predicate-object maps, which a processor engine executes to generate an RDF knowledge graph. This process is foundational for data integration, creating a unified, queryable semantic layer from disparate enterprise systems.
Key Features of RML
RML is a declarative, rule-based language that defines how to generate RDF triples from heterogeneous, non-RDF data sources. It is a superset of the W3C-standard R2RML, extending it to handle diverse formats like JSON, XML, and CSV.
Declarative Mapping Rules
RML uses a declarative approach, where developers specify what the target RDF structure should be, not how to procedurally create it. Rules are defined in a separate mapping document (often Turtle or JSON-LD) that acts as a blueprint, decoupling the transformation logic from the source data. This makes mappings:
- Portable and reusable across different data instances.
- Maintainable, as changes are made in one central document.
- Predictable, enabling validation and reasoning over the mapping logic itself.
Source-Agnostic Data Access
A core extension beyond R2RML is RML's ability to map data from non-relational sources. While R2RML only works with SQL databases, RML processors can connect to and iterate over:
- Structured files: CSV, TSV.
- Semi-structured files: JSON, XML.
- APIs: Data retrieved via HTTP requests.
This is achieved through Logical Sources, which abstract the data access method. A single mapping can even join data across these heterogeneous sources (e.g., linking a CSV row to a JSON object from an API).
Term Maps & Function Ontology
RML defines how to generate each part of an RDF triple using Term Maps:
- Subject Maps: Create the subject IRI or blank node for a resource.
- Predicate Maps: Define the property (predicate) IRI.
- Object Maps: Generate the object, which can be an IRI, blank node, or literal value.
To perform complex transformations during mapping, RML integrates with the FnO (Function Ontology). This allows the execution of built-in or custom functions within mapping rules, such as string concatenation, date formatting, or mathematical operations, to derive new values directly.
Referencing Objects & Joins
RML supports the creation of relationships between resources through Referencing Object Maps. This is crucial for building a connected graph, not just a flat list of entities. It allows the object of one triple to be the subject of another, defined in a separate mapping rule.
For relational or nested data, RML enables joins using the rr:joinCondition property. This allows a mapping rule to reference data from a different logical source or a nested element by specifying matching keys, effectively performing a graph-like link operation during the mapping process.
Standardized & Extensible
RML is a community-driven, open specification maintained by the RML Community. It is formally defined as an ontology (the RML ontology), making the mapping rules themselves machine-readable RDF data. This standardization ensures:
- Interoperability between different RML processor implementations (e.g., SDM-RDFizer, CARML).
- Extensibility, as the ontology-based model allows for custom extensions, such as the RML+ rules for more complex data transformations or the integration with domain-specific function libraries.
Integration in Semantic Pipelines
RML is a foundational component in Semantic ETL and Knowledge Graph Population pipelines. It typically operates in the Transform phase, sitting between data extraction and loading into a triplestore. An RML mapping document is executed by an RML Processor, which reads the source data, applies the rules, and outputs valid RDF (e.g., N-Triples). This output can then be validated, reasoned over, and loaded. Its role is critical for automating the creation of high-quality, instance-level data (ABox) that conforms to a target ontology (TBox).
RML vs. Other Mapping Approaches
A technical comparison of RDF Mapping Language (RML) against other common data mapping and integration methodologies.
| Feature / Capability | RML (RDF Mapping Language) | Direct R2RML | Custom Scripting (e.g., Python) | Traditional ETL Tools |
|---|---|---|---|---|
Declarative Mapping Language | ||||
Native RDF & Knowledge Graph Output | ||||
Support for Non-Relational Sources (JSON, XML, CSV) | Limited/Vendor-Specific | |||
Standardized, Portable Mapping Rules | Vendor-Specific | |||
Logical Source Definition & Iterators | Manual Implementation | Vendor-Specific | ||
Referencing Object Maps (Joins) | Manual Implementation | |||
Function Extension Framework (FnO) | Native Language Libraries | Vendor-Specific | ||
Integration with SPARQL & Reasoning Engines | Native | Native | Manual Integration | Limited/Connector-Based |
Incremental Graph Update Support | Via SPARQL-Update | Via SPARQL-Update | Manual Implementation | Vendor-Specific |
Primary Use Case | Semantic ETL to RDF KGs | Relational DB to RDF | Ad-hoc, Complex Transformations | General Data Warehousing |
Common RML Use Cases
RML is a declarative language for defining custom mapping rules that transform heterogeneous data into RDF triples. These are its primary applications in enterprise knowledge graph construction.
Legacy System Integration
RML is used to map data from legacy relational databases and mainframe systems into a modern knowledge graph without altering the source systems. This involves:
- Defining triples maps that map database tables and columns to RDF classes and properties.
- Using RML views or SQL queries as logical sources to perform joins and transformations at the mapping level.
- Generating globally unique IRIs for each entity, enabling linkage with other datasets. This creates a semantic abstraction layer over CRUD-based systems, making their data queryable via SPARQL and integrable with modern applications.
Unstructured & Semi-Structured Data Lifting
RML processors can parse JSON, XML, CSV, and Parquet files to extract structured facts. This is critical for integrating application logs, API responses, and data exports.
- JSON & XML: Use JSONPath and XPath within RML's
referenceFormulationto navigate nested structures and arrays. - CSV/TSV: Map column headers directly to RDF predicates, often using the file's header row to generate term maps dynamically.
- The mapping defines how to construct subject IRIs from composite keys (e.g.,
{customer_id}-{order_date}) and how to handle repeated elements as multiple triples. This transforms document-oriented data into interconnected graph nodes, ready for semantic querying.
Data Warehouse to Knowledge Graph
Organizations use RML to convert dimensional models (star/snowflake schemas) in a data warehouse into a rich, semantically typed knowledge graph.
- Fact and dimension tables are mapped to interconnected RDF resources, preserving business context often lost in flat tables.
- Slowly Changing Dimensions (SCD) can be mapped to temporal RDF using reification or standard temporal vocabularies.
- Complex ETL transformation logic (business rules, calculated fields) is encoded within the RML mapping rules using functions (FnO). This exposes aggregated, business-ready data as a graph, enabling complex graph analytics and path-based queries not possible in SQL.
Streaming Data Integration
RML mappings can be applied to real-time data streams (e.g., Kafka, Kinesis) for continuous knowledge graph population.
- A stream processor (e.g., Kafka Connect with an RML SMT) applies the mapping to each message, outputting RDF triples.
- This supports event-driven architectures where business events (new customer, completed transaction) instantly update the graph.
- Mappings must handle incremental updates and deletions, often using named graphs to version streamed data. This creates a live knowledge graph that reflects the current state of operational systems, powering real-time decision support.
Cross-Dataset Entity Resolution
RML is used in data harmonization pipelines to prepare datasets for entity linking. While RML itself does not perform matching, it standardizes data for downstream resolution tools.
- Different source schemas for 'Customer' are mapped to a unified target ontology (e.g.,
schema:Person,org:Organization). - Data values are normalized (e.g., phone number formatting, address cleansing) using RML functions during the mapping process.
- The output is a consistent RDF graph where entities from different sources share the same class and property types, enabling efficient similarity computation and link discovery with tools like Silk or LIMES.
Metadata Catalog Generation
RML generates rich, queryable metadata (a knowledge graph about data) by mapping technical metadata from databases, APIs, and files.
- Source system schemas, column descriptions, data types, and lineage information are mapped to vocabularies like DCAT, VoID, or PROV-O.
- This creates a semantic data catalog where users can SPARQL-query for data assets based on meaning, not just names.
- The mappings themselves can be described in RDF using the RML ontology, making the integration pipeline self-documenting and part of the enterprise knowledge graph.
Frequently Asked Questions
RDF Mapping Language (RML) is a core technology for building enterprise knowledge graphs. These questions address its core mechanics, practical applications, and how it fits within modern semantic data pipelines.
The RDF Mapping Language (RML) is a declarative, rule-based language for defining how data from heterogeneous, non-RDF sources (like CSV, JSON, XML, and relational databases) is transformed into RDF triples to populate a knowledge graph. It works by using a mapping document (often serialized as RDF itself using the RML ontology) that specifies logical sources, subject maps, predicate-object maps, and term generation functions. An RML processor (e.g., the RMLMapper, SDM-RDFizer) executes these rules, extracting data from sources, applying transformations, and generating RDF triples conforming to a target ontology. It extends the W3C's R2RML standard to handle non-relational data formats.
Enabling Efficiency, Speed & Accuracy
Intelligent Analysis, Decision & Execution
We build AI systems for teams that need search across company data, workflow automation across tools, or AI features inside products and internal software.
Talk to Us
Search across company data
Give teams answers from docs, tickets, runbooks, and product data with sources and permissions.
Useful when people spend too long searching or get different answers from different systems.

Automate internal workflows
Use AI to route work, draft outputs, trigger actions, and keep approvals and logs in place.
Useful when repetitive work moves across multiple tools and teams.

Add AI to products and internal tools
Build assistants, guided actions, or decision support into the software your team or customers already use.
Useful when AI needs to be part of the product, not a separate tool.
Related Terms
RDF Mapping Language (RML) operates within a broader ecosystem of technologies and methodologies for transforming and integrating data into structured knowledge. These related concepts define the components and processes that surround and enable effective RML implementations.
Semantic ETL
Semantic ETL is a data integration methodology that applies semantic technologies—like ontologies and RDF mapping languages—to transform heterogeneous data into a knowledge graph with explicit, machine-interpretable meaning. Unlike traditional ETL, which focuses on format and structure, semantic ETL prioritizes the preservation of semantic relationships and the creation of linked data.
- Core Difference: Transforms data into RDF triples based on a formal ontology, rather than into relational tables.
- Key Components: Involves an ontology (TBox) to define concepts and an RML mapper to generate instance data (ABox).
- Goal: Produces a knowledge graph ready for logical inference and semantic querying, not just analytics.
Knowledge Graph Population
Knowledge graph population is the specific process of extracting, transforming, and loading instance data—known as ABox assertions—from source systems into the structure defined by an ontology (TBox). RML is a primary tool for this process.
- Input: Raw source data (CSV, JSON, SQL) and a target ontology (e.g., in OWL).
- Process: An RML engine executes mapping rules to generate RDF triples that instantiate the ontology's classes and properties.
- Output: A populated knowledge graph where entities are uniquely identified (via URIs) and semantically connected, enabling complex querying and reasoning.
Ontology Mapping
Ontology mapping is the process of defining semantic relationships—such as equivalence (owl:sameAs) or subsumption (rdfs:subClassOf)—between the concepts and properties of two or more distinct ontologies. While RML maps data to an ontology, ontology mapping aligns ontologies to each other.
- Purpose: Enables interoperability and data integration across different knowledge graphs or domains.
- Common Techniques: Uses declarative languages like SPARQL CONSTRUCT or dedicated frameworks to assert cross-ontology relationships.
- Relation to RML: Often a prerequisite or parallel activity; RML rules may reference terms from multiple aligned ontologies to create a unified graph.
Data Harmonization
Data harmonization is the overarching process of standardizing data from disparate sources by resolving syntactic (format), structural (schema), and semantic (meaning) differences to create a unified, consistent dataset. RML is a tool for the semantic layer of this process.
- Syntactic: Converting CSV dates to ISO 8601 format.
- Structural: Aligning a nested JSON object to a flat relational schema.
- Semantic: Using RML to map a source field
"cust_name"to the ontology propertyfoaf:name, resolving vocabulary conflicts.
Directed Acyclic Graph (DAG)
In data pipeline orchestration, a Directed Acyclic Graph (DAG) is a finite directed graph with no cycles used to represent a workflow where tasks are nodes and dependencies are edges. An RML-based transformation pipeline is typically orchestrated as a DAG.
- Nodes: Individual tasks like data extraction, RML mapping execution, validation, and graph loading.
- Edges: Dependencies (e.g., mapping cannot start until extraction is complete).
- Orchestrators: Tools like Apache Airflow or Prefect use DAGs to schedule, monitor, and manage the execution of complex RML workflows, ensuring reliability and reproducibility.
Data Contract
A data contract is a formal agreement between data producers and consumers that specifies the schema, semantics, quality, and service-level expectations for a data product. In a semantic pipeline, RML mapping documents can serve as executable technical specifications within a broader data contract.
- Schema: The target ontology (OWL/RDFS) that defines allowed classes and properties.
- Semantics: The RML rules themselves, which define the exact transformation logic.
- Governance: Contracts ensure that changes to source data schemas or the ontology are communicated and that RML maps are versioned and tested accordingly, preventing pipeline breaks.

About the author
Prasad Kumkar
CEO & MD, Inference Systems
Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.
His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.
Partnered with leading AI, data, and software stack.
How We Work
Custom AI workflows for your Business
One-fit-all AI don't work for modern businesses. At Inferensys, we aim to understand your business & custom requirements; which we use to define most efficient agentic workflows, the data, and the tools for your business.
01
Review the use case
We understand the task, the users, and where AI can actually help.
Read more02
Pick the right approach
We define what needs search, automation, or product integration.
Read more03
Build the first useful version
We implement the part that proves the value first.
Read more04
Improve from there
We add the checks and visibility needed to keep it useful.
Read moreThe first call is a practical review of your use case and the right next step.
Talk to Us