Triples View
The Triples View is an (optional) view of the current model, providing a very detailed, fine-grained access to the single RDF triples. In order to open the Triples View, go to Window > Show View > Triples View.
A reasonable knowledge of RDF (and the layering of OWL on top of RDF) is required to use this view. On the other hand, the Triples View can also be used to learn RDF because it shows how resources and their property values are stored in the model.
The Triples View consists of two parts, and you can use the mouse to resize the relative size of each part. The upper part shows a list of all sub-graphs in the current model, with the main graph on top followed by all imports (transitively). The lower part shows a triples table, with columns for subjects, predicates and objects. The selection of triples shown here is driven by which graphs are selected in the upper part. The table can contains triples from multiple graphs, providing a merged view.
You can drag statements or individual resources from the Triples View
to be used in other views of TopBraid Composer like
Basket View.
The triples table can be sorted by clicking on the table headers. The table can also be filtered to only show certain triples. The filter is driven by the following buttons in the view's tool bar:
- Filter by subject... can be used to hide triples that don't have a given resource as their subject.
- Filter by predicate... can be used to hide triples that don't have a given property as their predicate.
- Filter by object... can be used to hide triples that don't have a given resource as their object. (There is currently no facility to match literals here.)
- Hide blank nodes can be used to hide hides all triples that have a blank node (for example, an anonymous class) as subject or object.
All these filters are backed by toggle buttons and can be combined freely.
In addition to providing a fine grained view of the model, the Triple View is an extremely powerful mechanism for refactoring tasks if your ontology consists of multiple imported modules: it is possible to select one or more triples in the table and then to drag them from one model into another one!
Here are some common refactoring operations on the Triples View:
- Move resources between files
- Merge files: Just select one of more files that provide the source triples, select them all and drag them to the target model
- Split instances and classes:
If you have a file A and want put all individuals into a separate file B
- Create an empty new OWL file B with an "individuals" namespace
- Import the classes ontology A into B
- Use the Basket View to collect all individuals (using Add all individuals in the basket's drop down menu)
- If desired, change the namespace of these individuals using a Batch Operation
- Drag the resulting triples (or individuals) from the basket or the triples table into the instances file B
Don't hesitate to contact Composer's support team if you have questions on such operations.
In all drag and drop operations the system will automatically apply some safety features to prevent you from accidentally creating invalid RDF graphs:
- It is not possible to drag triples that have an owl:Ontology as subject. Otherwise, users could accidentally delete the main owl:Ontology object of a module and remove the imports statements.
- If a selected triple contains a URI resource as subject and rdf:type as predicate, then the system will automatically move all depending triples of the subject. The typical use case for this is if you want to move an individual from one model to another: here you typically also intend to move the property values of the individual.
- You cannot move triples that have a blank node as subject, unless you also move the root of the bnode tree. This prevents you from dragging away parts of a class expression while the class is still in the original place.
- If a triple has an anonymous object, then all depending triples referenced by that anonymous object will be moved as well. In other words, if you move the rdf:type triple of an owl:Class, then the system will also move all depending restrictions and other anonymous classes with it.
- Triples can only be moved if the sub-model is editable, i.e. it must be a local file with no lock attached. Also, the source triples themselves need to be deletable, i.e. from an editable model.