What is MIME type "application/rdf+json"?

A MIME type is a string that tells browsers and other tools how to handle a particular kind of file.

application/rdf+json is a MIME type that signals a JSON serialization of RDF data. RDF stands for Resource Description Framework and is used to express relationships in a graph structure.
This format encodes subject-predicate-object triples in a JSON structure that machines can read easily.
Files using this type may have the extension RJ.
You can review further details on the W3C RDF/JSON specification.

Associated file extensions

Usage Examples

HTTP Header

When serving content with this MIME type, set the Content-Type header:


    Content-Type: application/rdf+json    
  

HTML

In HTML, you can specify the MIME type in various elements:


    <a href="file.dat" type="application/rdf+json">Download file</a>    
  

Server-side (Node.js)

Setting the Content-Type header in Node.js:


    const http = require('http');    
    
    http.createServer((req, res) => {    
      res.setHeader('Content-Type', 'application/rdf+json');    
      res.end('Content here');    
    }).listen(3000);    
  

Associated file extensions

FAQs

What is the purpose of the application/rdf+json MIME type?

This MIME type indicates that a file contains RDF (Resource Description Framework) data serialized using JSON syntax. It allows systems to exchange semantic graph data (triples) in a format that can be easily parsed by standard JSON libraries, bridging the gap between Semantic Web standards and modern web development.

How does application/rdf+json differ from application/json?

While application/rdf+json uses valid JSON syntax, it adheres to a specific schema designed to represent RDF subjects, predicates, and objects. application/json is a generic identifier for any JSON data, whereas application/rdf+json explicitly tells the consumer to interpret the content as an RDF graph.

How do I configure Apache or Nginx to serve .rj files correctly?

For Apache, add the line AddType application/rdf+json .rj to your .htaccess or configuration file. For Nginx, include application/rdf+json rj; within the types block of your mime.types file or server configuration to ensure browsers and API clients handle the file correctly.

Is application/rdf+json the same as JSON-LD?

No, they are different serializations. JSON-LD uses the MIME type application/ld+json and is a W3C standard designed to be easier for humans to read and to overlay onto existing JSON. application/rdf+json is an alternative, often older, direct mapping of RDF triples to JSON objects.

How can I open or view an .rj file?

Since files with the rj extension are text-based, you can open them in any standard code editor like VS Code, Notepad++, or Sublime Text. To visualize the data relationships defined in the file, you would need specific Semantic Web tools or an RDF validator.

Why does my browser download the file instead of displaying it?

Most web browsers do not natively render application/rdf+json content and treat it as an unknown binary or download type. To view the raw JSON in a browser, you may need a JSON formatting extension, or the server must send the Content-Disposition: inline header.

General FAQ

What is a MIME type?

A MIME (Multipurpose Internet Mail Extensions) type is a standard that indicates the nature and format of a document, file, or assortment of bytes. MIME types are defined and standardized in IETF's RFC 6838.

MIME types are important because they help browsers and servers understand how to process a file. When a browser receives a file from a server, it uses the MIME type to determine how to display or handle the content, whether it's an image to display, a PDF to open in a viewer, or a video to play.

MIME types consist of a type and a subtype, separated by a slash (e.g., text/html, image/jpeg, application/pdf). Some MIME types also include optional parameters.

How do I find the MIME type for a file?

You can check the file extension or use a file identification tool such as file --mime-type on the command line. Many programming languages also provide libraries to detect MIME types.

Why are multiple MIME types listed for one extension?

Different applications and historical conventions may use alternative MIME identifiers for the same kind of file. Showing them all helps ensure compatibility across systems.