When creating an OWL ontology in Protege, you are asked early on to define the URI for that ontology, replacing the default of http://www.owl-ontologies.com/Ontology#######.owl with your own text. But what constitutes the most useful URI for your purposes? This page will serve as a common place to document the best practices for choosing a URI for your ontology so that users of your ontology are best served. Tied up in this subject is the issue of how to distinguish new versions of your ontology from old versions, and how to do so in a way that users can take advantage of your new versions in the easiest manner possible. (9YA)
To begin, let's be clear on the difference between a URI and URL. URI stands for Uniform Resource Identifier, and is sometimes confused by newbies with a URL, Uniform Resource Locator. Wikipedia describes the difference in the following way: (9YB)
"A URI can be classified as a locator or a name or both. A Uniform Resource Locator (URL) is a URI that, in addition to identifying a resource, provides means of acting upon or obtaining a representation of the resource by describing its primary access mechanism or network "location". For example, the URL http://www.wikipedia.org/ is a URI that identifies a resource (Wikipedia's home page) and implies that a representation of that resource (such as the home page's current HTML code, as encoded characters) is obtainable via HTTP from a network host named www.wikipedia.org." (9YC)
The following considerations should factor into your selection of a good URI: (9YD)
- When you are finished with your ontology, what address on the internet (URL) will it live at? You should be able to easily access and update the files at this address, so preferably this will be some web server that you have direct control over. An example of a URL where an ontology file lives is: http://ccdb.ucsd.edu/SAO/1.2.8/SAO.owl (9YE)
- Your URI does not have to match the URL where the file will live. Nor does it even need to bring up a web page or other file when you type the URI into a web browser. In fact, it is better if it does not. However, if you choose a URI that begins with the same domain name as the location where the file will live, you take advantage of something very important. URLs of web sites are guaranteed to be unique because of the system in place for registering domain names. Therefore, choosing a URI that begins with the domain name where the file will reside automatically provides a unique name for your ontology. This is a good thing because it prevents your ontology from being confused with some other ontology in the world. (9YF)
- Should you include a version number in your URI? Doing so gives the following benefit: users will always know which version of your ontology they are using, because all of the classes in your ontology will be prefixed with the URI that includes the version number. However, this comes with the following drawback: one of the principles of the semantic web is that entities prefixed with different URIs are different entities. Thus, when you increment the version number in your URI, all the classes in your new version of the ontology are logically distinct from the same classes in the previous version. As a result, it is recommended that you do not include a version number in your URI. (9YG)
- As such, an example of a good URI for the file at the URL above would be: http://ccdb.ucsd.edu/SAO/ (9YH)
The following considerations should factor into your selection of a good way to choose URLs (9YI)
- The problem with leaving out a version number in the URI occurs when you have a new version of your ontology where you have made substantial changes to the definitions of your classes. If you modify the file at the URL that you have given out previously, you run the risk of causing chaos for anyone who has set their ontology to import your ontology. This is because many ontology browsers, upon seeing a statement to import another ontology, will follow the URL given in the owl:imports statement of that ontology to find it. If they pull down your newest version of your ontology, that is what the browser will try to incorporate with the ontology it is reading. However, the ontology that imported your ontology probably made its definitions depending on the particular structure of your previous version. If their ontology relies on the fact that your ontology defines Neurons as a type of Nerve Cell, but you have now reclassified Neurons to be a sibling of Nerve Cell, their ontology may no longer make sense or mean the same thing it did before. (9YJ)
- In order to avoid this, you can use the URL as a mechanism for distinguishing versions of your ontology. For example, the ontology at http://ccdb.ucsd.edu/SAO/1.2.8/SAO.owl has the following URI http://ccdb.ucsd.edu/SAO/1.2 (ignore the version number in the URI for now, this is not recommended). Previous versions of this ontology reside at http://ccdb.ucsd.edu/SAO/1.2.1/SAO.owl, http://ccdb.ucsd.edu/SAO/1.2.5/SAO.owl, and http://ccdb.ucsd.edu/SAO/1.2.7/SAO.owl. However, all of these files share the same URI, http://ccdb.ucsd.edu/SAO/1.2 (again, ignore the version number in the URI for now, this is not recommended). By managing the locations of these files in different directories, distinguished by version number, users can be sure that the version of your ontology they are pointing to will not change sometime in the future. If they wish to get a new version of the ontology, they can update their owl:imports statement from, for example, http://ccdb.ucsd.edu/SAO/1.2.1/SAO.owl to http://ccdb.ucsd.edu/SAO/1.2.7/SAO.owl. Because users have to consciously make this switch, they are forced to confront any changes that you have made in a new version of your ontology which may change the meaning of their ontology. Because the URI stays the same, the classes in your ontology in one version are not distinct from the classes in a subsequent version. Because you never modify a file that lives at a particular URL once it has been published to the world, and only add changes in subsequently incremented URLs, users of your ontology are never subjected to a surprising change that you have made. (9YK)