Documentation

Learn how to be productive with RDF, SPARQL and ShEx
Ontologies
Introduction
The RDF and SPARQL plugin transforms your IDE from a simple editor for RDF, SPARQL and ShEx into an intelligent environment for working with the data. This intelligence is powered by the plugin's ability to load and index ontologies from various sources.

Indexing ontologies allows the plugin to provide features like completion suggestions, quick documentation, and inlay hints directly in your editor. This dramatically reduces the need to consult external documentation, accelerating your development workflow.

All ontologies available at Settings→Languages & Frameworks→RDF and SPARQL→Ontologies.
ontologies
Completion Suggestions
The plugin provides completion suggestions for all supported file formats. It looks at your indexed ontologies to suggest relevant classes and properties from your ontologies. This ensures you write accurate IRIs and prefixed names eliminating typos and ensuring your queries and data conform to expected ontologies.

If you use a well-known ontology (like Schema.org) with the prefix registered at https://prefix.cc/, then you can just type the prefix and the completion suggestions will appear. In this case, the plugin loads an ontology using the prefix IRI and indexes it immediately.

If this automatic load fails, the plugin will display a warning alert and suggest you provide a custom location, see the following sections.
ontologies
Quick Documentation
By indexing an ontology, the plugin enables the quick documentation feature. When you place cursor over a prefixed name (e.g., schema:Person or foaf:name) and you will see a tool tip with quick documentation with:

  • Type - class or property or unknown,
  • IRI - the IRI of the element,
  • Label - the label in your preferred language from rdfs:label, skos:prefLabel, or dcterms:title,
  • Description - the description in your preferred language from rdfs:comment, skos:definition, or dcterms:description.

This provides instant schema context without interrupting your coding flow, making it easy to understand the purpose of the element you are using.
ontologies
Ontology from Local File
To configure an ontology from a local file, navigate to Settings → Languages & Frameworks → RDF and SPARQL → Ontologies. Alternatively, you can click the Fix location... link found in the warning alert when the plugin detects an ontology it could not load.

You must provide the absolute path to the file or use the folder icon to select the file using the dialog. When you click the Load and Index button, the plugin automatically fetches the Name, Ontology IRI, and Namespace IRI. If necessary, you can check the Override checkbox to manually edit these properties.

The plugin will monitor this file for changes and automatically re-index it. This ensures that your completion suggestions and quick documentation remain accurate and up-to-date with your latest schema definitions.
ontologies
Ontology from Remote URL
By default, the plugin downloads an ontology by the namespace IRI provided in the prefix declaration of your file. However, you can provided a different remote URL, if required, like in the case of schema.org ontology.

The plugin will load with the HTTP GET request and index the content. This is the most reliable way to ensure you are using the latest version of a publicly managed ontology.

Reloading the Ontology
To update the index of an ontology, you can trigger a reload in two ways:

  • From the Settings panel, use the Load and Index button.
  • From within a file, use the intention action. Place your cursor on the relevant prefix declaration, press Alt+Enter (or Option + Enter), and select Refresh related ontologies in index.
ontologies
Ontology from SPARQL Endpoint
Non-public ontologies frequently stored in private SPARQL endpoints, therefore the plugin supports them too.
The plugin can load and index ontology directly from a named graph of a SPARQL Endpoint. It's a powerful feature especially for enterprises.

Ensure you have already add your desired SPARQL Endpoint (see documentation on SPARQL Endpoints) with the Shared between projects checked.

  1. Go to Settings→Languages & Frameworks→RDF and SPARQL→Ontologies, add a new ontology and select the SPARQL endpoint location type.
  2. Choose the configured endpoint from the dropdown menu.
  3. Provide the named graph IRI where the ontology is stored, or click on the ... button to select it from the list of the ontologies detected by the plugin.

The plugin uses the SPARQL Graph Store HTTP Protocol to retrieve the ontology from the selected named graph and load it into your IDE's index.