Old Release

This documentation relates to an old version of VIVO, version 1.9.x. Looking for another version? See all documentation.

The most straightforward way to load additional ontologies into VIVO is to use the Add/Remove RDF Data feature shown on the Site Admin page.  This loads an ontology directly into the triple store.  The disadvantage is that all additional ontologies and local edits are loaded into a single graph.  This can make it cumbersome to update individual ontologies to reflect edits made outside of VIVO.

Filegraphs

There is another mechanism for incorporating ontologies into VIVO.  This involves "filegraphs," and is how the VIVO-ISF ontology is included with the software.  Filegraphs are RDF documents stored in the VIVO home directory.  Each filegraph corresponds to a single graph in the triple store.  Every time Tomcat starts, VIVO checks each of these graphs to ensure that its contents exactly match the triples found in the corresponding file.  If the file has changed, VIVO makes the necessary modifications to the triple store.  If a filegraph is removed from its directory, its graph in the triple store will be deleted the next time Tomcat starts.

Example

vitro.home/
    rdf/
        tbox/
            filegraph/
                agent.owl
                appControls-temp.n3
                bfo-bridge.owl
                bfo.owl
                ...
                myOntology.owl
                ...

Adding myOntology.owl to the directory shown above will automatically create the corresponding graph in the triple store after Tomcat is restarted:

http://vitro.mannlib.cornell.edu/filegraph/tbox/myOntology.owl

Modifying or removing the myOntology.owl file in the filegraph directory and restarting Tomcat will automatically update the ontology VIVO.

Namespace Prefixes

Additional ontologies, whether directly imported via 'Add/Remove RDF data' or implemented as filegraphs, are listed in the ontology list ('Site Admin > Ontology list'). While the ontologies name and namespace are automatically added to the list, the prefix is not. Instead, the note '(not yet specified)' appears. This behavior occurs even if the prefix is correctly specified in the RDF file.

For ontologies that are added to an existing VIVO installation, the prefix needs to be entered manually into the ontology list. If the additional ontology is to be provided with the software before installation, however, the prefix to be added automatically during the build process can be specified beforehand.

Note

The following procedure is only relevant if you want to add an ontology before the software is installed on a server.

VIVO keeps an internal record of prefixes that is read from the /rdf/tbox/firsttime/ directory. The prefixes of the ontologies that are loaded with VIVO are specified in the 'initialTBoxAnnotations.n3' file. You can add an additional prefix by adding the following lines either to this file or to a separate file:

@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix vitro:   <http://vitro.mannlib.cornell.edu/ns/vitro/0.7#> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .

<http://*URI/of/the/added/ontology*>
	rdfs:label "*Name of added ontology*" @en-US;
	vitro:ontologyPrefixAnnot "*OntologyPrefix*"^^xsd:string

Of course, the strings enclosed by asterisks need to be adapted according to your custom ontology. After VIVO is built, you should find the new ontology in the ontology list, with its specified prefix.

 

  • No labels