Skip to content

grossd/protege-plugins

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Protege Plugins

Extensions for Protégé Desktop that go beyond the standard OWL class/individual meta-model.

If this plugin is useful to you, consider sponsoring the project — it helps keep the work going. Sponsor


protege-plugin-roles

Adds first-class Roles and Context Types to Protégé.

The problem

Standard OWL lets you define classes, subclasses, and individuals, but there is no direct way to express:

Teacher is a role played by a Person in the context of a Teaching Situation

This plugin adds that concept directly into Protégé's editing interface.

Concepts

Concept Description
Context Type A situation type in which roles are played (e.g. TeachingSession)
Role A capacity that one or more classes can fill in a context (e.g. Teacher)
Played by The classes whose instances can take on this role — a role may have multiple player classes
Sub-role A more specific role; e.g. HeadTeacher is a sub-role of Teacher

OWL encoding

Everything is stored as standard OWL 2 annotations — no spec extensions, fully round-trippable through any OWL 2 serialiser and queryable with SPARQL.

Namespace: http://www.loa-cnr.it/ontologies/role-plugin.owl#

Annotation Value Set on Meaning
rp:isRole "true"^^xsd:boolean Role class Marks a class as a Role
rp:isContextType "true"^^xsd:boolean Context class Marks a class as a Context Type
rp:playedBy <ClassIRI> Role class A class that can play this role (one annotation per player; repeatable)
rp:inContextType <ClassIRI> Role class The Context Type this role belongs to
rp:isContextFor <ClassIRI> Context class Back-reference: a Role that uses this class as its context — added automatically when a role's context is set, removed when it is changed or cleared

Sub-roles use standard OWL SubClassOf axioms between role classes.


Roles tab

The plugin adds a Roles tab with two panels.

Left — Roles by Context tree

TeachingSession               ← Context Type
  └─ Teacher                  ← Role
       └─ HeadTeacher         ← Sub-role (SubClassOf Teacher)
EmploymentRelation
  ├─ Employee
  └─ Manager
       └─ SeniorManager
(No Context)                  ← Roles without an assigned context

Toolbar buttons:

Button Action
Add Context Type Create a brand-new class as a Context Type, or promote any existing class from the ontology to a Context Type
Add Role Create a Role under the selected Context Type, or a sub-role under the selected Role
Delete Remove the selected Role or Context Type

Right — Role Description panel

When a Role is selected:

Role:  Teacher
──────────────────────────────────────────────────
Played by:                          [+ Add] [- Remove]
┌──────────────────────────────────────────────────┐
│ Person                                           │
│ Employee                                         │
└──────────────────────────────────────────────────┘
Context Type:  TeachingSession                [Edit]
  • [+ Add] / [- Remove] — manage the list of classes that can play this role
  • [Edit] on Context Type — opens a picker showing all classes in the ontology; classes already marked as Context Types are shown with a ✓ prefix; selecting any other class promotes it automatically

When a Context Type is selected, the standard OWL class description frame is shown. Because of the rp:isContextFor back-references, the Annotations section will list every Role that uses this class as its context.


Context Types — using existing classes

A key design choice: any OWL class can become a Context Type — you are not forced to create a new class. When you assign a class as the context for a role (via Add Context Type → Promote an existing class or the Edit button on a role), the plugin:

  1. Adds rp:isContextType "true" to the chosen class (if not already present)
  2. Adds rp:isContextFor <RoleIRI> to the chosen class as a back-reference

This means context information is navigable from both directions: from a Role you can see its Context Type, and from a Context Type class you can see in the standard Protégé annotations view which Roles use it.


Installation

A precompiled jar is available on the Releases page — no build step needed.

  1. Download protege-plugin-roles-<version>.jar from Releases
  2. Copy it into Protégé's plugins/ directory
    (e.g. /path/to/Protege-5.6.9/plugins/)
  3. Start (or restart) Protégé
  4. A Roles tab appears in the tab bar

Tested with Protégé 5.6.9 on Linux. Should work on any Protégé 5.5+ installation (Java 11+).


Building from source

Requirements: Java 11+, Maven 3.8+

git clone https://github.com/grossd/protege-plugins.git
cd protege-plugins/protege-plugin-roles
mvn package -DskipTests

The jar is produced at target/protege-plugin-roles-<version>.jar.
The pom.xml compiles against the Protégé 5.5.0 artifacts on Maven Central, which are binary-compatible with Protégé 5.6.x at runtime.


License

BSD 3-Clause — see LICENSE

About

Adding Protege UIs for Ontological language extensions

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

 
 
 

Contributors

Languages