How to open .NQ files on Windows

To open .NQ files on Windows, if you only need to view it: open the .nq file in a text editor (it is plain text and line-based).

Step-by-step instructions

  1. If you only need to view it: open the .nq file in a text editor (it is plain text and line-based).
  2. If you need to parse/use it as RDF: open it with an RDF toolchain that supports N-Quads (for example Apache Jena RIOT tools recognize .nq), or import it in software that supports N-Quads (for example Wolfram Language Import).
  3. If the file still won’t open, confirm it is actually N-Quads content (not another unrelated format using .nq) by checking that lines resemble RDF statements ending with a period.

Common issues

The .nq file opens as unreadable or “garbled” text

N-Quads is plain text, but if the file uses an unexpected character encoding or you are opening a very large dataset in a basic editor, it may appear corrupted or the app may struggle.

  1. Try a different text editor that lets you choose the encoding and can handle large files.
  2. If you need structured access, load it with an RDF parser/tool that supports N-Quads (for example Apache Jena RIOT or Eclipse RDF4J) instead of relying on manual viewing.

RDF tools refuse to parse the file (syntax errors)

A single malformed line can cause parsing to fail; common causes include missing terminating periods, invalid IRIs, or incorrect quoting/escaping in literals.

  1. Confirm the file is actually N-Quads and not another format misnamed as .nq (N-Quads should be line-based statements ending with a period).
  2. Re-export/regenerate the dataset from the source system if possible, or isolate the failing line by validating/streaming through an N-Quads parser and fixing the specific syntax issue.

The file opens, but the data seems “incomplete” (missing graphs/contexts)

N-Quads can include an optional graph name; if your loader imports into a single default graph, you may lose or collapse contexts depending on configuration.

  1. Check whether your importer/tool preserves named graphs when loading N-Quads (dataset/quad mode vs. single-graph mode).
  2. If supported by your tooling, load it explicitly as N-Quads/dataset rather than auto-detection based only on extension.

Security note

N-Quads is plain text and does not carry macros or executable code, but it can still be risky to process untrusted .nq files because RDF parsers can be stressed by extremely large files or pathological inputs (denial-of-service style issues).

Back to .NQ extension page