<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://protegewiki.stanford.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Absh1us</id>
		<title>Protege Wiki - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="https://protegewiki.stanford.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Absh1us"/>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/wiki/Special:Contributions/Absh1us"/>
		<updated>2026-04-16T14:48:50Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.27.7</generator>

	<entry>
		<id>https://protegewiki.stanford.edu/index.php?title=Protege4NamingAndRendering&amp;diff=8456</id>
		<title>Protege4NamingAndRendering</title>
		<link rel="alternate" type="text/html" href="https://protegewiki.stanford.edu/index.php?title=Protege4NamingAndRendering&amp;diff=8456"/>
				<updated>2010-08-18T20:20:41Z</updated>
		
		<summary type="html">&lt;p&gt;Absh1us: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div class=&amp;quot;orangeBox&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;span class=&amp;quot;orangeBoxTitle&amp;quot;&amp;gt;Naming and rendering of entities in Protege 4.x&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This page describes the various options for naming entities in an ontology.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Back to [[Protege4UserDocs]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Note on naming in OWL ontologies ==&lt;br /&gt;
&lt;br /&gt;
OWL, being a semantic web language identifies all named things (entities) uniquely with URIs (Uniform Resource Identifiers).&lt;br /&gt;
&lt;br /&gt;
Examples of URIs include URLs (web addresses), URNs and others.&lt;br /&gt;
&lt;br /&gt;
eg The Pizza class in the pizza ontology is identified by its URI (http://www.co-ode.org/ontologies/pizza/pizza.owl#Pizza)&lt;br /&gt;
&lt;br /&gt;
As URLs with fragments are often used, it is worth quickly explaining the terminology used later on:&lt;br /&gt;
&lt;br /&gt;
* '''base URI''' the (leftermost) part of the URI that will likely be common across multiple entities (eg '''http://www.co-ode.org/ontologies/pizza/pizza.owl#''').&lt;br /&gt;
* '''URI fragment''' the part of a URI after the delimiter '''#''' (eg '''Pizza'''). In Protege 4.x, we sometimes broaden this to include the last path element if no fragment is available - particularly for rendering.&lt;br /&gt;
&lt;br /&gt;
It is common for a base URI to be used across many entities with each having its own unique fragment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Rendering of entities in Protege 4.x ==&lt;br /&gt;
&lt;br /&gt;
Because URIs will often be fairly long strings, Protege 4.x uses a '''renderer''' to show a shortened form of the name.&lt;br /&gt;
&lt;br /&gt;
The renderer can be changed in the preferences (see below) and can show the fragment or ending part of the URI, or can show a name provided by an annotation on the entity.&lt;br /&gt;
&lt;br /&gt;
So '''Pizza''' is actually just a rendering of the URI http://www.co-ode.org/ontologies/pizza/pizza.owl#Pizza.&lt;br /&gt;
&lt;br /&gt;
The full URI can always be viewed by hovering over an entity in its tree (the tooltip shows the full name).&amp;lt;br&amp;gt;&lt;br /&gt;
Also, the &amp;lt;span style=&amp;quot;color:#B87A3D; font-weight:bold;&amp;quot;&amp;gt;Refactor | Rename entity&amp;lt;/span&amp;gt; menu item always works with the URI - in fact you can see the full URI by just clicking on the checkbox in the rename dialog.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Rendering preferences ===&lt;br /&gt;
&lt;br /&gt;
[[Image:Renderer-prefs.png|right|400px]]&lt;br /&gt;
&lt;br /&gt;
There are 4 options for the type of renderer you can select&lt;br /&gt;
* '''URI fragment''' the part of the URI following the '''#''' or last '''/''' character&lt;br /&gt;
* '''qnames''' (qualified name) the fragment but with a [[#Prefixes...|prefix]] set&lt;br /&gt;
* '''annotation values''' uses the value of an entity annotation specified in [[#Annotations...|Annotations...]]&lt;br /&gt;
* '''annotation values with prefixes''' uses a combination of the [[#Annotations...|annotation]] value and the qname [[#Prefixes...|prefixes]]&lt;br /&gt;
&lt;br /&gt;
When using the 3rd and 4th option you probably wish to also set the [[#New_entity_creation_preferences|New entities preferences]] to create labels when a new entity is created.[http://www.texas-liability-insurance.com/ Liability Insurance Texas]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Prefixes... ====&lt;br /&gt;
&lt;br /&gt;
[[Image:Prefix-mappings.png|right|400px]]&lt;br /&gt;
&lt;br /&gt;
URIs are long. A short form (prefix) can be specified to represent the commonly used leftmost part of a URI.&lt;br /&gt;
&lt;br /&gt;
eg. if we have a prefix mapping:&lt;br /&gt;
  pizza = http://www.co-ode.org/ontologies/pizza/pizza.owl#&lt;br /&gt;
&lt;br /&gt;
then the following class:&lt;br /&gt;
  http://www.co-ode.org/ontologies/pizza/pizza.owl#CheeseTopping&lt;br /&gt;
&lt;br /&gt;
can be written much more concisely:&lt;br /&gt;
  pizza:CheeseTopping&lt;br /&gt;
&lt;br /&gt;
The prefixes... option is available for both the '''qname''' and the '''annotation values with prefixes'''  renderers.&lt;br /&gt;
&lt;br /&gt;
The table that is brought up allows the user to add new prefixes by hand or get P4 to generate them from the loaded ontologies.&lt;br /&gt;
Several prefixes are available as default.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Annotations... ====&lt;br /&gt;
&lt;br /&gt;
[[Image:Annotation-label-prefs.png|right|400px]]&lt;br /&gt;
&lt;br /&gt;
If you have set the renderer to be either of the annotations versions then this option will be available.&lt;br /&gt;
&lt;br /&gt;
You can specify a list of which annotations are searched for a rendering in order of preference.&lt;br /&gt;
In addition, for each given annotation, you can specify a comma-separated list of languages (again in order of preferences).&lt;br /&gt;
&lt;br /&gt;
eg the setup on the right will first try to find a '''label''' annotation in english, followed by one with no language set, followed by any language. If it fails, then it will look for any '''prefLabel''' it can find.&lt;br /&gt;
&lt;br /&gt;
If the annotations renderer fails to find an appropriate label then it will default to the fragment.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br style=&amp;quot;clear: both;&amp;quot; /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Naming of new entities ==&lt;br /&gt;
&lt;br /&gt;
Until build 65, new entities were created with respect to the renderer settings, ie:&lt;br /&gt;
* if the fragment renderer was selected, new entities would be given a URI using the base of the active ontology and a fragment provided by the name the user entered.&lt;br /&gt;
* if the annotation values renderer was selected, new entities would be given:&lt;br /&gt;
** a URI using the base and a &amp;quot;meaningless&amp;quot; numeric fragment provided by the system time&lt;br /&gt;
** an annotation using the preferred URI and language containing the name the user entered&lt;br /&gt;
&lt;br /&gt;
This was not sufficient for several reasons:&lt;br /&gt;
# the base URI was always the active ontology&lt;br /&gt;
# the user may not want to automatically create meaningless URIs even if the label renderer was being used&lt;br /&gt;
# there was no control over the form of the IDs being generated&lt;br /&gt;
&lt;br /&gt;
So the automatic naming has been revisited to make this more flexible.&lt;br /&gt;
&lt;br /&gt;
=== New entity creation preferences ===&lt;br /&gt;
&lt;br /&gt;
[[Image:New-entities-preferences.png|right|400px]]&lt;br /&gt;
&lt;br /&gt;
A new set of preferences has been created to separate off the renderer from the creation of new entities.&lt;br /&gt;
&lt;br /&gt;
This gives much more flexibility and control over what gets generated in our ontology.&lt;br /&gt;
&lt;br /&gt;
The pane can be found under &amp;lt;span style=&amp;quot;color:#B87A3D; font-weight:bold;&amp;quot;&amp;gt;File | Preferences... | New Entities&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
To the right is the new pane with default settings when first opened, some of the advanced features disabled.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Entity URI ====&lt;br /&gt;
New entities will be given a URI starting with the base:&lt;br /&gt;
* '''Active ontology (default)''' the URI of the currently selected active ontology will always be used as the base URI.&lt;br /&gt;
* '''Specified URI''' the user can specify a static URI that is always used as the base.&lt;br /&gt;
&lt;br /&gt;
Followed by a separator character ('''#''' or '''/''')&lt;br /&gt;
&lt;br /&gt;
And finally ending with:&lt;br /&gt;
* '''user supplied name (default)''' the string typed in when a new entity is being created.&lt;br /&gt;
* '''auto ID''' generated automatically (see below).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Entity label ====&lt;br /&gt;
Selecting one or both of the '''create label''' options generate an annotation on the new entities containing the supplied name (or ID).&lt;br /&gt;
&lt;br /&gt;
Selection also enables control over which annotations get produced when labels are being generated.&lt;br /&gt;
&lt;br /&gt;
* '''Same as label renderer (default)''' mimicks the current behaviour, the top preferred rendering annotation URI and language will always be used when generating a label&lt;br /&gt;
* '''Custom label''' a static annotation URI and language can be set separately from the renderer preferences&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Auto ID ====&lt;br /&gt;
Create a numerical identifier for new entities.&lt;br /&gt;
&lt;br /&gt;
''Auto ID'' must be selected for at least one of the options in '''Entity name''' for these options to be available.&lt;br /&gt;
* '''Numeric (pseudo random) (default)''' generates an number from the system time (so not currently random at all)&lt;br /&gt;
* '''Numeric (iterative)''' generates a sequence of numbers iterating in single steps from the first available (uniqueness only guaranteed for URI fragments)&lt;br /&gt;
** '''Start''' the lowest ID that will be allocated&lt;br /&gt;
** '''End''' the highest ID that will be allocated (an error will be reported if this is superceded) - set to -1 for ''no maximum''&lt;br /&gt;
* '''Digit count''' the length the numeric part of the IDs will be padded/trimmed to - this should always be made big enough to contain the range of IDs you will generate&lt;br /&gt;
* '''Prefix''' (recommended) add a string to the start of the generated ID. Macros are available.&lt;br /&gt;
** ''[type]'' OWLClass, OWLObjectProperty, etc&lt;br /&gt;
** ''[user]'' the name of the current user&lt;br /&gt;
* '''Suffix''' add a string to the end of the generated ID. The same macros are available as above.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Converting URIs to labels ==&lt;br /&gt;
&lt;br /&gt;
Many ontologies have been developed with the meaningful names in the URI fragment.&lt;br /&gt;
&lt;br /&gt;
If you wish to move these names into labels and change the URIs into meaningless IDs, there is a tool for doing this under '''Refactor | Convert entity URIs to labels'''.&lt;br /&gt;
&lt;br /&gt;
Any entities that already have a reasonable label will not be changed (so this is useful if you changed your preferences half way through building).&lt;br /&gt;
&lt;br /&gt;
This refactor uses '''your current new entities preferences''' to determine what labels get generated and how the IDs are created.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Translating ontologies ==&lt;br /&gt;
&lt;br /&gt;
Using a combination of the annotation renderer and label generation (both described above) it is possible to come up with and view an ontology in a given language.&lt;br /&gt;
&lt;br /&gt;
If you wish to provide multiple labels for internationalisation of your ontology, a quick way to do this is using the [http://code.google.com/p/co-ode-owl-plugins/wiki/MatrixViews matrix plugin].&lt;br /&gt;
&lt;br /&gt;
[http://code.google.com/p/co-ode-owl-plugins/wiki/MatrixViews#Translation Instructions for setting up the translation].&lt;/div&gt;</summary>
		<author><name>Absh1us</name></author>	</entry>

	</feed>