/AtomOntologyCompleter

An autocompleter for the atom editor that supports completing predicate names within common ontologies when editing RDF turtle files.

Primary LanguageCoffeeScriptMIT LicenseMIT

Turtle Autocompleter package

dependencies Status Build Status Installs! Version! License Gitter chat

This is an autocompleter for the Atom editor, compatible with AutoComplete+ that knows common ontologies and will suggest predicates based on your typing. Both the Turtle and TriG serializations are supported.

Short video of the completer in action

Current ontologies are:

If you'd like others added either raise an issue on the atom package, comment on gitter, tweet @nonodename or do a pull request with the conversion. Contributions are greatly appreciated. Note that the ontology is matched based on common prefixes.

Known ontologies are referenced from the file ontologies.json in \lib. Each ontology has a JSON file that contains the completion info.

To generate a new file, run convert.py over a ttl version of the ontology to generate the JSON. convert.py supports a few command line options, run without any parameters to see them.

Note that quality of anchor links into the specs varies on whether the naming convention for the anchors is sufficiently predictable. Feel free to fix any that are wrong in the relevant JSON file and do a pull request to get added.

Testing ontologies

To test a new ontology without the palaver of pull requests:

  • Create a copy of the file ontologies.json in \lib
  • Convert your ontology to the JSON format required for the completer
  • Update the ontologies.json file, setting the key to the desired prefix and ontology attribute to the filename & path of the converted ontology.
  • The spec, prefix and docprefix attributes aren't part of the code path so can be ignored or completed as you wish
  • Note that if you re-use a predefined prefix you'll override the built in ontology

For example:

"tr":{
  "title":"My First ontology",
  "spec":"URL of the spec",
  "prefix":"tr",
  "docprefix":"URL prefix for documentation",
  "ontology":"/users/dan/ontologies/tr.json"
}