acardona/CATMAID — pull request #493 by tomka (2013-04-10 10:42:16+00:00)
Title: Classification editor

This editor tool is part of the ontology sub-tools and is available through a button next to the ontology editor. It is a widget and a back-end part that allows the instantiation of classes that are part of an ontology *O* designed before. Such instantiations are called *classification graphs*. The tool recognizes all ontologies *O* that are follow the ontology statement *O IS_A classification_root*. When a new classification graph is created, one must choose which ontology it should be based on. This ontology defines then the space of possible instantiations.

On top of relations, the ontology editor allows to add restrictions (OWL terminology for constraints). For instance that a particular class-class relation can only exist once or that every sub-type (*sub-type IS_A super-type*) must be there twice in a valid instantiation. The classification editor makes use of this by providing menus to add new class instances, based on the effective available options. If a restriction in the ontology allows only for a certain set of classes, the classification editor will only show those as options.

It is also possible to let the classification system infer types. The "Auto fill this graph" link in the editor will create new class instances if it can be inferred that those instances *have* to be there. This works for example if there is a constraint in the underlying ontology that says "Exactly one instance of each sub-type of this class". There, the tool will create exactly one instance of each sub-type. Restrictions can therefore really simplify the process of creating classification graphs.

In CATMAID, the semantic space (ontologies, classes) and instantiations of it (classification graphs, class instances) are bound to a specific project. Unfortunately, we currently have the requirement to use one classification graph for multiple projects. Therefore, I defined the notion of workspaces that ontologies and classification graphs live in. The two possible workspaces are: *project specific* and *project independent*. The former actually means that that relations, classes and class instances one is currently working with are bound to the current project (default). The latter binds these things to a dummy project with ID -1, of course also with is a link to the current project.

With the help of the "Add/Link new graph" button, one can also link multiple graphs to a single project (creating new ones or linking existing ones). If multiple classification graphs are linked to a project, the tool will ask the user which classification graph to work on when opened.

It is the plan to create clusterings based on the classification graphs available. Work on a CATMAID tool for this has already been started.

The documentation on this tool and the ontology editor will follow in a few days.

The picture shows the ontology editor (middle window) with an ontology that can be (and is) used by the classification editor (right window). The workspace is currently set to *project independent* and an instantiation (classification graph) of the opened ontology can be seen.

![catmaid_classification_tool](https://f.cloud.github.com/assets/112226/361012/da446bc8-a1b3-11e2-8415-7d719a577d98.png)