Façade-X Mappings
Copyright
©
2026
the Contributors to the Façade-X Mappings
Specification, published by the
Data Façades Community Group under the
W3C Community Contributor License Agreement (CLA). A human-readable
summary
is available.
This page lists the Façade-X format mappings. A format mapping specifies how resources in one source format are represented as Façade-X data sources, using the metamodel and the Schema vocabulary.
This specification was published by the Data Façades Community Group. It is not a W3C Standard nor is it on the W3C Standards Track. Please note that under the W3C Community Contributor License Agreement (CLA) there is a limited opt-out and other conditions apply. Learn more about W3C Community and Business Groups.
This is version 0.1 of this document, released on 2026-10-06, at https://w3c-facade-x.github.io/facade-x-specs/0.1/mappings.html. This version will not change. The latest release is always at https://w3c-facade-x.github.io/facade-x-specs/mappings.html. The editor's draft, which may include changes made after this release, is at https://w3c-facade-x.github.io/facade-x-specs/dev/mappings.html. The issues addressed in this release, and those still open, are listed in the release notes.
This document is currently in active development. The list of formats and the status of each mapping will change as drafts are added.
GitHub Issues are preferred for discussion of this specification.
This document is one of seven Façade-X specification documents produced by the Data Façades Community Group:
This section is non-normative.
Each format mapping specifies:
A format mapping is selected by the media type of the resource, given by
fxe:media-type or inferred by the engine.
The starting point is the idea that Facade-X should not modify the lexical form of data values. Previously, we mapped JSON numerals to xsd:decimal (see also SPARQL-Anything/sparql.anything#620)
However, JSON numerals and xsd:decimal lexical forms are not the same set: JSON allows exponents (1.5e3) and xsd:decimal does not. Keeping the source text, therefore, produces ill-typed literals, so the mappings need a shared rule for when to keep a value's surface form and when to rewrite it as the canonical form. Cases of mismatches between format specifications and XSD datatypes may arise. We should discuss this issue more generally and then make a decision that can guide future mappings.
We review first what SPARQL Anything does, then discuss potential solutions.
SPARQL Anything types every JSON number as xsd:decimal and copies the numeral from the source as the lexical form. From tests/json/2-features:
| JSON | SPARQL Anything output |
|---|---|
42 |
"42"^^xsd:decimal |
3.0 |
"3.0"^^xsd:decimal |
-0 |
"0"^^xsd:decimal |
1.5e3 |
"1.5e3"^^xsd:decimal |
2E-4 |
"2E-4"^^xsd:decimal |
12345678901234567890 |
"12345678901234567890"^^xsd:decimal |
The last two exponent rows are ill-typed literals. The lexical space of xsd:decimal is (\+|-)?([0-9]+(\.[0-9]*)?|\.[0-9]+), with no exponent notation (XSD 1.1 Part 2, §3.3.3.1). A SPARQL engine cannot compute a value for them, so numeric comparisons and arithmetic on them fail. The behaviour is also inconsistent with itself: 3.0 keeps its surface form, but -0 is normalised to 0.
JSON and XSD agree on the values but not on the numerals:
xsd:decimal: numbers of the form i / 10^n (§3.3.3). xsd:decimal can represent every JSON number exactly.xsd:decimal lexical space does not. Conversely, XSD allows forms JSON forbids (+1, .5, 5., 007), but those don't matter here. Every JSON numeral without an exponent is a valid xsd:decimal lexical form; every numeral with an exponent is not.xsd:double. The xsd:double lexical space accepts exponent notation, but its value space is m × 2^e with |m| < 2^53 (§3.3.5). 2E-4 and 12345678901234567890 have no exact double value, so switching to xsd:double would lose information.xsd:decimal.3.0 → "3.0", -0 → "-0").xsd:decimal representation of its value (1.5e3 → "1500", 2E-4 → "0.0002").Every literal produced is well-typed and exactly equal in value to the JSON number. The surface form is kept wherever XSD allows it.
| JSON | SPARQL Anything | Draft |
|---|---|---|
1.5e3 |
"1.5e3"^^xsd:decimal (ill-typed) |
"1500"^^xsd:decimal |
2E-4 |
"2E-4"^^xsd:decimal (ill-typed) |
"0.0002"^^xsd:decimal |
-0 |
"0"^^xsd:decimal |
"-0"^^xsd:decimal |
All other numbers are unchanged. The expected output of tests/json/2-features needs updating to match, and SPARQL Anything needs a fix.
Façade-X aims to represent the source as it is, which argues for keeping the surface form of values. In RDF, though, a typed literal ties the surface form to a datatype's lexical space, and source grammars rarely match XSD lexical spaces exactly. Surface form also matters beyond values: "3.0"^^xsd:decimal and "3"^^xsd:decimal are equal values but different RDF terms, so sameTerm, DISTINCT and joins on literals depend on the lexical form.
This will come up in every mapping whose source format has typed values: YAML (numbers, booleans, dates), spreadsheets (numbers stored as doubles, dates as serial numbers), and possibly XML if schema-aware typing is considered. CSV and plain XML avoid it only because all their values are strings.
Options for a principle shared by all mappings:
3.0 → 3).The source text of every value is its lexical form, and no value is rewritten. The datatype is chosen so that the literal is well-typed. In the case of JSON numerals, we first map to xsd:decimal (design choice) and then verify conformance with the surface form:
42 → "42"^^xsd:decimal, 3.0 → "3.0"^^xsd:decimal, -0 → "-0"^^xsd:decimal);1.5e3 → "1.5e3"^^D): xsd:double in the example.xsd:string.If agreed, this becomes a common principle in the format mappings page: "The lexical form of a value is its source form. The datatype is the natural XML Schema datatype for the value when the source form is in its lexical space; otherwise it is a datatype whose lexical space accepts the source form, as defined by the mapping." The JSON draft and tests/json/2-features would then be updated accordingly. Opinions welcome.
The following principles apply to every format mapping, unless the mapping states otherwise.
Values are strings. Every value is a literal of type xsd:string, unless the source format
defines its own value types. Engines MUST NOT infer types from the lexical form of a string.
Lexical forms are kept. The lexical form of a value is its form in the source; engines MUST NOT rewrite it. When the source format defines value types, the datatype of a value is chosen so that the literal is well-typed:
xsd:string.Each mapping specifies this decision for its value types (see issue #41).
Order is kept. Where the source format orders its members, the order is kept in the numbers of
the container-membership properties rdf:_1, rdf:_2, …, starting from 1.
Names become slot IRIs. Where a source member has a name (a key, a column header, an element or
attribute name), the slot is a property whose IRI is minted from that name and the value of
fxe:namespace. The minting rules are shared by all mappings;
see issue #9.
Container identity. Containers are blank nodes, unless
fxe:blank-nodes is false. Deterministic container IRIs are discussed
in issue #17.
Mapping options apply. The mapping options of the Engine
vocabulary (for example fxe:trim-strings and fxe:null-string) apply to every format.
| Format | Media types | Status | Document | Issue |
|---|---|---|---|---|
| CSV | text/csv, text/tab-separated-values |
Draft | CSV mapping | #29 |
| JSON | application/json |
Draft | JSON mapping | #30 |
| XML | application/xml, text/xml |
Draft | XML mapping | #31 |
| HTML | text/html |
Not started | — | — |
| Markdown | text/markdown |
Not started | — | — |
| YAML | application/yaml |
Not started | — | — |
| Spreadsheets | XLS, XLSX | Not started | — | — |
| Text | text/plain |
Not started | — | — |
| Folders and archives | ZIP, TAR, file system | Not started | — | — |
Whether XML and HTML share a single mapping based on the Document Object Model is an open question (see the 2026-07-06 meeting).
Test cases for the format mappings are maintained in the facade-x-tests repository, organised by format.