What is the RDF file format?
An .rdf file is a document used for defining data related to resources on the web. .rdf files contain metadata such as page descriptions, keywords, or update logs for online resources.
The .rdf format specification was created by the World Wide Web Consortium (W3C), with RDF 1.0 ratified as a Recommendation in 1999 and RDF 1.1 following in 2014. RDF document files are written in the Resource Description Framework language and are used to share information with applications in order for them to process it in a machine-readable way - a foundation of the Semantic Web and Linked Data.
An .rdf document uses XML syntax to store data. XML is used due to its simplicity regarding data representation. The model describes data using three types of expression:
- Subject - defines the resource (an IRI or blank node)
- Predicate - defines traits or aspects of that resource
- Object - stores the value of the predicate (an IRI or a literal)
Each such statement is called a *triple*; a set of triples forms an RDF graph. An .rdf file typically opens with <?xml version="1.0"?> and an <rdf:RDF xmlns:rdf="..."> root element.
Besides representing information about web resources, .rdf files have been used by Mozilla Firefox for purposes such as storing extension manifests (install.rdf) and toolbar configuration - though modern Firefox replaced this with the WebExtensions format. The standard MIME type is application/rdf+xml. The same RDF graph can also be serialized as a Turtle (.ttl) or JSON-LD file, while OWL ontologies typically reuse RDF/XML as their primary serialization.
Security & safety
RISK: LOWAn .rdf file is text/XML data and contains no executable code, so opening one to read it is safe. The only general XML caution applies: very large or maliciously crafted XML can trigger 'XML bomb' (billion-laughs) or external-entity (XXE) issues in a poorly configured parser, so process untrusted RDF with a hardened, entity-expansion-limited parser.
Format details
in a nutshell- RSS 1.0 (RDF Site Summary) news feed - RSS 1.0 is an RDF/XML feed that uses .rdf and is subscribed to in a feed reader; it's distinct from the common RSS 2.0 (.rss/.xml) and is rare today.
- Legacy Mozilla configuration file - Old Mozilla/Firefox/Thunderbird used .rdf internally for bookmarks, toolbar state and extension manifests; Mozilla removed RDF years ago, so modern Firefox no longer uses it.
Programs that open RDF files
Technical details
deep spec| MIME type | application/rdf+xml |
| Character encoding | UTF-8 declared in the XML header; UTF-16 also permitted by the XML specification |
| Data model | Subject-Predicate-Object triples forming a directed RDF graph |
| Root XML element | <rdf:RDF> with xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" |
| Resource identification | IRIs (Internationalized Resource Identifiers) or anonymous blank nodes |
| Literal value types | Typed literals with XSD datatypes, or language-tagged strings via the xml:lang attribute |
| Alternative serializations | Turtle (.ttl), N-Triples (.nt), JSON-LD (.jsonld), Notation3 (.n3) - same graph data, different syntax |
| Standard query language | SPARQL (W3C Recommendation); used to query RDF graphs loaded from .rdf files or held in a triple store |
| Blank node scope | Blank node identifiers are local to a single document and are not globally dereferenceable |
| Common namespace prefixes | rdf:, rdfs:, owl:, xsd:, dc: (Dublin Core), foaf: - each declared as an xmlns attribute |
| Typical structural elements | rdf:Description or typed node elements (e.g. foaf:Person) nested inside the rdf:RDF root |
| OWL relationship | OWL ontology files (.owl) use RDF/XML as their default on-disk serialization |
| Triple store loading | Compatible with SPARQL-capable triple stores such as Apache Jena Fuseki, Virtuoso, and GraphDB |
| Typical use cases | Semantic Web metadata, Linked Data publishing, library catalogues, FOAF social profiles, ontology exchange |
| Parser libraries | Apache Jena (Java), RDFLib (Python), Redland/Raptor (C), EasyRDF (PHP) |
| Released | RDF 1.0 W3C Recommendation 1999 (RDF 1.1 in 2014) |
| Open standard | Yes · royalty-free |
| Specification | www.w3.org |
RDF conversions
Community Q&A
asked by usersNo questions yet - be the first to ask about RDF files.