An RDF file (Resource Description Framework) is a text file that stores a graph of statements. Each statement is a triple — a subject, a predicate and an object. RDF is a W3C standard, and the same graph can be written in several file formats: RDF/XML, Turtle, N-Triples or N-Quads.
The most readable form is Turtle (.ttl). A statement reads "subject → predicate → object", and a semicolon repeats the subject on the next line:
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
<http://example.org/alice> foaf:name "Alice" ;
foaf:age 42 ;
foaf:knows <http://example.org/bob> .
The same three facts written as RDF/XML (.rdf, .owl) are valid XML, which is why an RDF file often opens in an XML editor. N-Triples (.nt) writes one full triple per line, and N-Quads (.nq) adds a fourth term, the named graph.
| RDF (Turtle) | XML | JSON-LD | |
|---|---|---|---|
| Data model | graph of triples | tree of elements | graph of triples |
| Syntax | compact text | tags, verbose | JSON |
| Typical files | .ttl, .nt, .nq, .rdf, .owl | .xml | .jsonld, and JSON-LD inside HTML |
| Common use | linked data, knowledge graphs, ontologies | documents, configuration | schema.org structured data |
RDF/XML is RDF in XML clothing; JSON-LD is RDF in JSON clothing. Turtle and N-Triples are the same graph again, just easier to read and to parse line by line.
The most common conversions are RDF to Excel, RDF to CSV, RDF to JSON and RDF to SQL. Every RDF serialization — RDF/XML, Turtle, N-Triples and N-Quads — can go to the same flat table. Withdata DataFileConverter does this locally:
To convert an RDF file into another RDF format (for example Turtle to RDF/XML, or N-Triples to Turtle) without flattening it into a table, see RDFConverter (coming soon).
It is a text file that stores a graph of subject-predicate-object triples, per the W3C Resource Description Framework standard. The same graph exists in several serializations: RDF/XML, Turtle, N-Triples and N-Quads.
Open it in a plain text editor to read it raw. To see it as rows and columns, use a converter such as RDF to Excel, because a text editor cannot split triples into a table.
Not directly — Excel has no concept of triples. Convert the RDF file to CSV or Excel first, then open the result.
Because RDF/XML is a valid XML serialization of RDF, so a .rdf or .owl file is XML. Turtle and N-Triples express the same triples without XML tags.
A .ttl file is RDF written in Turtle — the most human-readable RDF syntax, using prefixes such as foaf: instead of full URLs.
Use the RDF to Excel converter or the RDF to CSV converter, or the desktop app for large files, batch conversion and scheduling.
Start with RDF to Excel or RDF to CSV for a single file, or see the full RDF tool set for Turtle, N-Triples and N-Quads. Related reading: CSV vs JSON vs XML: file size and speed compared.