Skip to content

Notebooks

Mentor supports interactive notebooks that allow you to combine executable SPARQL queries, RDF data snippets and Markdown content for data science, query development and learning RDF. Mentor notebooks have the file extension .mnb.

There are multiple ways to create notebooks in Mentor:

  1. Select the Mentor icon in the sidebar.
  2. Click on the button in the tree view header of the Workspace Tree.
  3. Select “Mentor Notebook” from the list.
  1. Open a SPARQL or RDF data file in the editor
  2. Click on the icon in the upper right corner of the editor
  1. Open the Command Palette (Ctrl+Shift+P)
  2. Type “Create Notebook”
  3. Select “Mentor: Create Notebook” from the dropdown

Mentor notebooks are implemented as native Visual Studio Code Jupyter notebooks. You can create new cells by either clicking on the Code or Markdown buttons in the notebook toolbar or by hovering at the bottom edge of existing cells:

Screenshot of a new Mentor Notebook

The buttons in the toolbar append new cells to the notebook, while clicking on the buttons at the bottom edge of existing cells will create a new cell right below the hovered cell.

Markdown cells allow you to write rich text using Markdown which allows you to add headings, lists, links, images, and more. It’s an ideal format for structured text that focuses on content rather than presentation.

Screenshot of a Markdown cell

It is common practise to use Markdown cells for documenting competency questions the subsequent queries provide answers for. In general, documentation content of the notebooks should focus on the ‘why’ some modeling or queries are structured the way they are instead of the ‘how’ which is usually covered by the code itself.

SPARQL cells allow you to write and execute SPARQL queries against the Workspace Index or any connected SPARQL endpoint. To enable SPARQL cells, simply create a new code cell and select “SPARQL” as the cell language.

Screenshot of a SPARQL cell

All editor features are available within SPARQL cells, including syntax highlighting, autocompletion, and error checking. To execute a SPARQL cell, select the connection in the Code Lens located at the top of the cell and click the button in the cell toolbar.

RDF Data cells allow you to write data in all supported serialization formats. To create an RDF Data cell, simply create a new code cell and select any of the RDF serialization formats as the cell language.

Screenshot of a Turtle cell