Difference between revisions of "Protege4NamingAndRendering"

From Protege Wiki
Jump to: navigation, search
(New entity creation preferences: Updates of the options)
m (New entity creation preferences)
Line 68: Line 68:
 
=== Entity URI ===
 
=== Entity URI ===
 
New entities will be given a URI starting with the base:
 
New entities will be given a URI starting with the base:
* '''Active ontology (default)''' the URI of the currently selected active ontology will always be used as the base URI (with a separator of # added)
+
* '''Active ontology (default)''' the URI of the currently selected active ontology will always be used as the base URI.
* '''Specified URI''' the user can specify a static URI that is always used as the base. If no separator is specified then # will be added
+
* '''Specified URI''' the user can specify a static URI that is always used as the base.
  
 
Followed by a separator character ('''#''' or '''/''')
 
Followed by a separator character ('''#''' or '''/''')
  
 
And finally ending with:
 
And finally ending with:
* '''user supplied name (default)''' the string typed in when a new entity is being created
+
* '''user supplied name (default)''' the string typed in when a new entity is being created.
* '''auto ID''' generated automatically (see below)
+
* '''auto ID''' generated automatically (see below).
  
  

Revision as of 10:27, November 13, 2008

Naming and rendering of entities in Protege 4.x


This page describes the various options for naming entities in an ontology.

You must install build 65 or higher to access the functionality described on this page.


Back to Protege4UserDocs


Note on naming in OWL ontologies

OWL, being a semantic web language identifies all named things (entities) uniquely with URIs (Uniform Resource Identifiers).

Examples of URIs include URLs (web addresses), URNs and others.

eg The Pizza class in the pizza ontology is identified by its URI (http://www.co-ode.org/ontologies/pizza/pizza.owl#Pizza)

As URLs with fragments are often used, it is worth quickly explaining the terminology used later on:

  • 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#).
  • 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.

It is common for a base URI to be used across many entities with each having its own unique fragment.

Naming of entities in Protege 4.x

Because URIs will often be fairly long strings, Protege 4.x uses a renderer to show a shortened form of the name.

The renderer can be changed in the preferences and can show the fragment or ending part of the URI, or can show a name provided by an annotation on the entity.

So Pizza is actually just a rendering of the URI http://www.co-ode.org/ontologies/pizza/pizza.owl#Pizza.

The full URI can always be viewed by hovering over an entity in its tree (the tooltip shows the full name).
Also, the Refactor | Rename entity 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.

Until build 65, new entities were created with respect to the renderer settings, ie:

  • 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.
  • if the annotation values renderer was selected, new entities would be given:
    • a URI using the base and a "meaningless" numeric fragment provided by the system time
    • an annotation using the preferred URI and language containing the name the user entered

This was not sufficient for several reasons:

  1. the base URI was always the active ontology
  2. the user may not want to automatically create meaningless URIs even if the label renderer was being used
  3. there was no control over the form of the IDs being generated

So the automatic naming has been revisited to make this more flexible.

New entity creation preferences

New-entities-preferences.png

A new set of preferences has been created to separate off the renderer from the creation of new entities.

This gives much more flexibility and control over what gets generated in our ontology.

The pane can be found under File | Preferences... | New Entities
To the right is the new pane with default settings when first opened, some of the advanced features disabled.


Entity URI

New entities will be given a URI starting with the base:

  • Active ontology (default) the URI of the currently selected active ontology will always be used as the base URI.
  • Specified URI the user can specify a static URI that is always used as the base.

Followed by a separator character (# or /)

And finally ending with:

  • user supplied name (default) the string typed in when a new entity is being created.
  • auto ID generated automatically (see below).


Entity label

Selecting one or both of the create label options generate an annotation on the new entities containing the supplied name (or ID).

Selection also enables control over which annotations get produced when labels are being generated.

Create label must be selected for either name or ID in order for these options to be available

  • 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
  • Custom label a static annotation URI and language can be set separately from the renderer preferences


Auto ID

Create a numerical identifier for new entities.

Auto ID must be selected for at least one of the options in Entity name for these options to be available.

  • Numeric (pseudo random) (default) generates an number from the system time (so not currently random at all)
  • Numeric (iterative) generates a sequence of numbers iterating in single steps from the first available (uniqueness only guaranteed for URI fragments)
    • Start the lowest ID that will be allocated
    • End the highest ID that will be allocated (an error will be reported if this is superceded) - set to -1 for no maximum
  • 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
  • Prefix (recommended) add a string to the start of the generated ID. Macros are available.
    • [type] OWLClass, OWLObjectProperty, etc
    • [user] the name of the current user
  • Suffix add a string to the end of the generated ID. The same macros are available as above.