Skip to content
Vladimir Alexiev edited this page Mar 26, 2019 · 11 revisions

The following is a list of the main features of the Xturtle editor. Note that we will not load resources dynamically from the web. All the vocabulary you need will have to be present as turtle files in your workspace.

Code Completion

Code completion is invoked via ctrl-space at any position in the editor, in some cases there will be no suggestions though.

  • There are built-in templates for base and prefix definitions. Start a new statement with "pr" or "ba" and invoke code completion.

  • Within prefix definitions, prefix names are suggested based on a recent dump of popular prefixes (prefix.cc), for known prefixes the corresponding name space is suggested as well. Currently, they are not configurable. We plan to have a preference page with import/export functionality similar to the templates preference page.

  • Wherever a Qname is possible, defined prefix names are suggested. Simple names are than proposed based on the subjects defined the for prefix's name space. These names are proposed based on sub-string matching, so if you start 'prefix:Per' then 'prefix:AcademicPerson' will be among the proposals. If the subject definition contains other label definitions, these will be taken into account as well. Predicate URIs which are interpreted for extraction the alternative labels are configurable via the editor's preference page

  • If you invoke code completion within a URI-reference (<...), all known subjects whose URI starts with that prefix will be proposed.

  • String literal content will be proposed based on other string literals defined for the same predicate within the current file.

Templates

In addition to the built-in templates, you can define your own templates via the editor's preference page.

Validation

There is some basic validation, e.g. whether prefixes are unused or whether prefix and namespace match according the prefix.cc dump. Of course, we check whether predicate and object resources are defined (in a file visible from where they are used).

For most of the validations you can define the error level via the editor's preference page. In version 1.1.1 the validation preference page has been redesigned. Error levels can now also be defined on a per project basis.

Quickfix

Currently, the most important quickfix is adding a project reference to a namespace that is known, but not referenced yet (and hence its subjects would not be known in the current file).

Navigation

Note that navigation is only possible within the workspace context. Only subjects defined in .ttl files located in a project with Xtext nature are indexed. Project references are used to control the visibility among projects (they can be configured via the project's properties).

Find declaration

F3 jumps to one ("arbitrary") definition of a predicate/object (simple name in a Qname or URI).

Hyperlinks

Ctrl-click on a URI/Qname shows a list of all known definitions. A web browser may be opened with the resource's URI as well.

Find references

Shift-ctrl-g / shift-cmd-g searches for all references to the given resource. For predicates and objects the action behaves as if invoked on the linked subject. Note that there is currently a bug for this feature in case the same subject is defined multiple times in the same file.

Open Model Element Dialog

Shift-ctrl-F3 / shift-cmd-F3 opens a dialog that allows locating any defined subject. The search uses the Xtext index of all known model files (not only .ttl). In case other Xtext-languages are installed, you may want to narrow the search by filtering the EClass name using "Resource".

Information

Outline and Quick Outline

The outline view shows a list of all prefix and base definitions as well as all subjects (simple name+full URI). The Quick Outline (ctrl-o or cmd-o) is an easy way to search for a subject name within the current file using the wildcard filter.

Hover

If you move the mouse over a resource, the resolved URI is shown in a hover. In case the definition contains a description as string literal, this description is also displayed. The predicate URIs to be used for extraction the description as well as the languages can be configured via the editor's preference page.

Highlighting

Highlighting can be configured via the editor's preference page. In particular you can choose a style for string and number literals, comments, URIs, URIs that cannot be resolved locally, Qname prefixes and their simple names (based on the casing of the first letter).

Folding

You can collapse multi-line definitions (e.g. String literals or entire triple-definitions) and directive blocks. Besides "Collapse all", there is a "Collapse string" entry in the folding section of the ruler context menu (left editor margin). This action will collapse all multi-line string literals, but will leave other folding regions unaffected. In the editor's preference page you can configure which type of region should be collapsed automatically when opening a file.

Customisation

The preference page for the Xturtle editor can be used for customising

  • Folding
  • Highlighting
  • Validation
  • Code completion (Templates, alternative labels)
  • Hover information

One way of opening it is from the context menu in the editor window (right-click) which contains an entry for the preference page. Some of the changes will take effect only after a rebuild of the file/workspace as the Xtext index has to be populated with new information. As a complete rebuild may take some time, we do not invoke it automatically. Use the "Run"-menu entry "clean" in order to do so manually.

Clone this wiki locally