RDF and SPARQL

This plugin adds RDF, SPARQL and ShEx support for JetBrains IDEs. Features syntax highlighting and validation, prefixed name completion, SPARQL 1.1 Protocol and much more.

Smart editor

Supported formats and languages

RDF 1.1 Turtle, RDF 1.1 TriG, RDF 1.1 N-Triples, RDF 1.1 N-Quads formats, SPARQL 1.1 language and ShExC 2.1 are supported. Supported file extensions: .ttl, .trig, .rq, .ru, .sparql, .nt, .nq, .shex.

Code commenting

After selecting a block, you can apply a block comment (Ctrl+Shift+/) or line comment (Ctrl+/) to it. The same shortcuts will remove existing comments from selected lines too.

Refactoring

Select a variable in a SPARQL query or a prefixed name (prefix label is renamed) and rename it with Refactor / Rename... or Shift+F6.

Code formatter

You can format your file according to pre-defined rules by pressing Ctrl+Alt+L in it. Also press Ctrl+Alt+O to remove unused prefix declarations.

Quick documentation

Press Ctrl+Q to open the quick documentation popup for a prefixed name from an indexed ontology. Also hover the cursor over it to see its IRI.

Inlay hints

Each prefixed name from an indexed ontology has the value of rdfs:label attached on the right.

Code folding

Code folding, auto-insertion of braces, brackets & quotes, matching brace/bracket highlighting, etc.

On-the-fly analysis

Errors are shown as you type. Among others, we catch syntax errors, undeclared prefixes, braces, etc.

Code completion

Turtle code completion
URI prefix declaration

RDF and SPARQL looks up an URI prefix in prefix.cc or in the list of custom prefix declarations. Call the context actions on a prefixed name with Alt+Enter.

Custom URI prefix declarations

You can override an URI prefix declaration from prefix.cc by registering it in the project settings. Also you can share your custom declaration with team members.

Completion suggestions for prefixed names

Once your declared an URI prefix, you can fetch completion suggestions for corresponding prefix names with Ctrl+Space or just start typing if the prefixed name is from an indexed ontology.

Indexing of RDFS/OWL ontologies

The completion suggestions work the best with ontologies that are indexed locally. Press Alt+Enter on the URI of a prefix declaration to download the ontology.

Ontology mirrors for local indexing

For an RDFS/OWL ontology which isn't downloadable on its base URL in an RDF format, e.g. https://schema.org/, you can define a mirror URL that is used instead.

LOV as the fallback option

In case, an RDFS/OWL ontology isn't indexed locally, the Linked Open Vocabularies API is employed to find completion suggestions for prefixed names.

SPARQL 1.1 Query/Update & Graph Store Protocols

SPARQL 1.1 endpoint

RDF and SPARQL, supports all endpoints that comply with SPARQL 1.1 Protocol standard. They are registered in SPARQL Endpoint tool window on the right.

All SPARQL query forms

All SPARQL query forms are supported. The query results are collected in 8:Services tool window at the bottom. Press Alt+8 to open it up.

Cancelable query execution

Any query execution may be cancelled with the red square button in Query Results tab or 8:Services tool window. The query request will be properly closed.

Query results formatting

URI prefix declarations are considered in the format of query results. RDF Literals are formatted following RDF Turtle 1.1 standard.

HTTP Basic Authentication

You can use SPARQL endpoints protected with the HTTP Basic Authentication. Enter username and password when registering an endpoint, they are stored safely with the Intellij IDEA SDK, read more.

Export query results to file

SPARQL query results may be exported into a file. Supported file formats: CSV, TSV, XML, JSON, Apache Thrift, Text. In case, the query results is RDF, all major RDF file formats are supported.

Upload RDF file to SPARQL endpoint

You can upload an RDF file to a SPARQL endpoint over SPARQL 1.1 Graph Store HTTP Protocol. The existing data can be removed or kept in place.