Protégé-OWL 3.3.1

edu.stanford.smi.protegex.owl.model.framestore
Class OWLFrameStore

java.lang.Object
  extended by edu.stanford.smi.protege.model.framestore.AbstractFrameStore
      extended by edu.stanford.smi.protege.model.framestore.FrameStoreAdapter
          extended by edu.stanford.smi.protegex.owl.model.framestore.OWLFrameStore
All Implemented Interfaces:
edu.stanford.smi.protege.model.framestore.FrameStore

public class OWLFrameStore
extends edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

A FrameStore with specific support for OWL ontologies. While most calls simply forward to their default implementation, some calls are intercepted to do some extra work:

The goal of this architecture is to make sure that there a no unused anonymous classes around. This cannot be done through a garbage collection because then components such as the Jena synchronizers could not be able to delete a class when it should be deleted.
Normally, all anonymous classes are used only in one place (their host class). The host can be a restriction (as facet override in the all and some restrictions), a slot (e.g. via domain and range), or a named class (e.g. as superclass or disjoint class). Much of the logic for this deleting of depending classes is encapsulated in the subtypes of RDFSClass. Some extra cases, however (especially restrictions) must be handled with care.
With restrictions, the rule that anonymous classes are only attached to a single host is no longer valid. Restrictions store their filler as a facet override. In the case of all and some restrictions, these overrides can be (anonymous) classes. The same classes are mapped into facet overrides in the host class -- they are not cloned because there is only one representation in the corresponding Jena/OWL model.
These anonymous classes have the restriction as host, and they are deleted when the restriction is deleted or changes its filler. As a consequence, the following actions are performed by this FrameStore:
Finally, the OWLFrameStore also makes sure that if a named class has an intersection as equivalent class, then all named operands of these intersections are also superclasses of the host class. Note that this is maintained in both direction, i.e. if someone removes an intersection, then the named operands are also automatically removed, no matter whether the user intended to also add the class as a superclass. These side effects need to be considered by OWL API users.

Author:
Holger Knublauch

Field Summary
static boolean allowDuplicateOwnSlotValues
           
static boolean autoDeleteOfAnonymousClses
          An ugly trick to prevent anonymous classes from being deleted as a side effect
protected  boolean facetHandlingBlocked
          A flag to prevent infinite recursion when a superclass has been added or removed
static String IGNORE_PREFIXES_IN_SEARCH
           
protected  boolean superclassHandlingBlocked
          A flag to prevent infinite recursion when a facet override has been changed.
 boolean suppressUpdateRDFSDomain
           
 
Fields inherited from interface edu.stanford.smi.protege.model.framestore.FrameStore
UNLIMITED_MATCHES
 
Constructor Summary
OWLFrameStore(AbstractOWLModel owlModel)
           
 
Method Summary
 void addDirectSuperclass(edu.stanford.smi.protege.model.Cls cls, edu.stanford.smi.protege.model.Cls superCls)
           
 void addDirectSuperslot(edu.stanford.smi.protege.model.Slot slot, edu.stanford.smi.protege.model.Slot superSlot)
           
 void addDirectTemplateSlot(edu.stanford.smi.protege.model.Cls cls, edu.stanford.smi.protege.model.Slot slot)
           
 void addDirectType(edu.stanford.smi.protege.model.Instance instance, edu.stanford.smi.protege.model.Cls type)
           
 void copyFacetValuesIntoNamedClses()
           
 edu.stanford.smi.protege.model.Cls createCls(edu.stanford.smi.protege.model.FrameID id, String name, Collection directTypes, Collection directSuperclasses, boolean loadDefaults)
           
 edu.stanford.smi.protege.model.SimpleInstance createSimpleInstance(edu.stanford.smi.protege.model.FrameID id, String name, Collection directTypes, boolean loadDefaults)
           
 edu.stanford.smi.protege.model.Slot createSlot(edu.stanford.smi.protege.model.FrameID id, String name, Collection directTypes, Collection directSuperslots, boolean loadDefaults)
           
 void deleteCls(edu.stanford.smi.protege.model.Cls cls)
           
 void deleteQuantifierRestrictions(OWLProperty property)
          Deletes all QuantifierRestrictions (and the expressions where they are used) which restrict a given propertyerty.
 void deleteSimpleInstance(edu.stanford.smi.protege.model.SimpleInstance simpleInstance)
           
 void deleteSlot(edu.stanford.smi.protege.model.Slot slot)
          Deletes the depending classes (anonymous domains and ranges) of the slot being deleted.
 Collection getClsesToDelete(edu.stanford.smi.protege.model.Cls cls)
          A slighly adjusted version of DeleteSimplificationFrameStore that ignores links through the anonymous root class.
 Set getClsesWithMatchingBrowserText(String value, Collection superclasses, int maxMatches)
           
 Set getFramesWithMatchingDirectOwnSlotValue(edu.stanford.smi.protege.model.Slot slot, String value, int maxMatches)
           
 List getLiteralValues(List values)
          Deprecated. This method was moved into AbstractOWLModel
 Set getMatchingReferences(String value, int maxMatches)
           
static boolean isIgnorePrefixesInSearch(OWLModel owlModel)
           
 void removeDirectSuperclass(edu.stanford.smi.protege.model.Cls cls, edu.stanford.smi.protege.model.Cls superCls)
           
 void removeDirectSuperslot(edu.stanford.smi.protege.model.Slot slot, edu.stanford.smi.protege.model.Slot superslot)
           
 void removeDirectTemplateSlot(edu.stanford.smi.protege.model.Cls cls, edu.stanford.smi.protege.model.Slot slot)
           
 void removeDirectType(edu.stanford.smi.protege.model.Instance instance, edu.stanford.smi.protege.model.Cls directType)
           
 void setDirectOwnSlotValues(edu.stanford.smi.protege.model.Frame frame, edu.stanford.smi.protege.model.Slot slot, Collection values)
           
 void setDirectTemplateFacetValues(edu.stanford.smi.protege.model.Cls cls, edu.stanford.smi.protege.model.Slot slot, edu.stanford.smi.protege.model.Facet facet, Collection values)
           
 void setDirectTemplateSlotValues(edu.stanford.smi.protege.model.Cls cls, edu.stanford.smi.protege.model.Slot slot, Collection values)
           
 void setSuperclassSynchronizationBlocked(boolean value)
           
 
Methods inherited from class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter
beginTransaction, commitTransaction, createFacet, deleteFacet, executeQuery, getClsCount, getClses, getClsesWithAnyDirectTemplateSlotValue, getClsesWithDirectTemplateFacetValue, getClsesWithDirectTemplateSlotValue, getClsesWithMatchingDirectTemplateFacetValue, getClsesWithMatchingDirectTemplateSlotValue, getDirectDomain, getDirectInstances, getDirectlyOverriddenTemplateFacets, getDirectlyOverriddenTemplateSlots, getDirectOwnSlotValues, getDirectOwnSlotValuesClosure, getDirectOwnSlotValuesCount, getDirectSubclasses, getDirectSubslots, getDirectSuperclasses, getDirectSuperslots, getDirectTemplateFacetValues, getDirectTemplateSlots, getDirectTemplateSlotValues, getDirectTypes, getDomain, getEvents, getFacetCount, getFacets, getFrame, getFrame, getFrameCount, getFrameName, getFrames, getFramesWithAnyDirectOwnSlotValue, getFramesWithDirectOwnSlotValue, getInstances, getOverriddenTemplateFacets, getOverriddenTemplateSlots, getOwnFacets, getOwnFacetValues, getOwnSlots, getOwnSlotValues, getReferences, getSimpleInstanceCount, getSlotCount, getSlots, getSubclasses, getSubslots, getSuperclasses, getSuperslots, getTemplateFacets, getTemplateFacetValues, getTemplateSlots, getTemplateSlotValues, getTransactionStatusMonitor, getTypes, moveDirectOwnSlotValue, moveDirectSubclass, moveDirectSubslot, moveDirectTemplateSlot, moveDirectType, reinitialize, removeDirectTemplateFacetOverrides, rollbackTransaction, setFrameName
 
Methods inherited from class edu.stanford.smi.protege.model.framestore.AbstractFrameStore
close, getDelegate, getName, onSetDelegate, setDelegate, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

facetHandlingBlocked

protected boolean facetHandlingBlocked
A flag to prevent infinite recursion when a superclass has been added or removed


superclassHandlingBlocked

protected boolean superclassHandlingBlocked
A flag to prevent infinite recursion when a facet override has been changed.


IGNORE_PREFIXES_IN_SEARCH

public static final String IGNORE_PREFIXES_IN_SEARCH
See Also:
Constant Field Values

autoDeleteOfAnonymousClses

public static boolean autoDeleteOfAnonymousClses
An ugly trick to prevent anonymous classes from being deleted as a side effect


allowDuplicateOwnSlotValues

public static boolean allowDuplicateOwnSlotValues

suppressUpdateRDFSDomain

public boolean suppressUpdateRDFSDomain
Constructor Detail

OWLFrameStore

public OWLFrameStore(AbstractOWLModel owlModel)
Method Detail

addDirectSuperclass

public void addDirectSuperclass(edu.stanford.smi.protege.model.Cls cls,
                                edu.stanford.smi.protege.model.Cls superCls)
Specified by:
addDirectSuperclass in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
addDirectSuperclass in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

addDirectSuperslot

public void addDirectSuperslot(edu.stanford.smi.protege.model.Slot slot,
                               edu.stanford.smi.protege.model.Slot superSlot)
Specified by:
addDirectSuperslot in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
addDirectSuperslot in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

addDirectType

public void addDirectType(edu.stanford.smi.protege.model.Instance instance,
                          edu.stanford.smi.protege.model.Cls type)
Specified by:
addDirectType in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
addDirectType in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

copyFacetValuesIntoNamedClses

public void copyFacetValuesIntoNamedClses()

createCls

public edu.stanford.smi.protege.model.Cls createCls(edu.stanford.smi.protege.model.FrameID id,
                                                    String name,
                                                    Collection directTypes,
                                                    Collection directSuperclasses,
                                                    boolean loadDefaults)
Specified by:
createCls in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
createCls in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

createSlot

public edu.stanford.smi.protege.model.Slot createSlot(edu.stanford.smi.protege.model.FrameID id,
                                                      String name,
                                                      Collection directTypes,
                                                      Collection directSuperslots,
                                                      boolean loadDefaults)
Specified by:
createSlot in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
createSlot in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

createSimpleInstance

public edu.stanford.smi.protege.model.SimpleInstance createSimpleInstance(edu.stanford.smi.protege.model.FrameID id,
                                                                          String name,
                                                                          Collection directTypes,
                                                                          boolean loadDefaults)
Specified by:
createSimpleInstance in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
createSimpleInstance in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

deleteCls

public void deleteCls(edu.stanford.smi.protege.model.Cls cls)
Specified by:
deleteCls in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
deleteCls in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

deleteQuantifierRestrictions

public void deleteQuantifierRestrictions(OWLProperty property)
Deletes all QuantifierRestrictions (and the expressions where they are used) which restrict a given propertyerty. This is needed when a property changes its type.

Parameters:
property - the restricted property

deleteSimpleInstance

public void deleteSimpleInstance(edu.stanford.smi.protege.model.SimpleInstance simpleInstance)
Specified by:
deleteSimpleInstance in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
deleteSimpleInstance in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

deleteSlot

public void deleteSlot(edu.stanford.smi.protege.model.Slot slot)
Deletes the depending classes (anonymous domains and ranges) of the slot being deleted.

Specified by:
deleteSlot in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
deleteSlot in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter
Parameters:
slot - the Slot being deleted

getClsesToDelete

public Collection getClsesToDelete(edu.stanford.smi.protege.model.Cls cls)
A slighly adjusted version of DeleteSimplificationFrameStore that ignores links through the anonymous root class.

Parameters:
cls -
Returns:
see the super method

getLiteralValues

public List getLiteralValues(List values)
Deprecated. This method was moved into AbstractOWLModel


getClsesWithMatchingBrowserText

public Set getClsesWithMatchingBrowserText(String value,
                                           Collection superclasses,
                                           int maxMatches)
Specified by:
getClsesWithMatchingBrowserText in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
getClsesWithMatchingBrowserText in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

getFramesWithMatchingDirectOwnSlotValue

public Set getFramesWithMatchingDirectOwnSlotValue(edu.stanford.smi.protege.model.Slot slot,
                                                   String value,
                                                   int maxMatches)
Specified by:
getFramesWithMatchingDirectOwnSlotValue in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
getFramesWithMatchingDirectOwnSlotValue in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

getMatchingReferences

public Set getMatchingReferences(String value,
                                 int maxMatches)
Specified by:
getMatchingReferences in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
getMatchingReferences in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

isIgnorePrefixesInSearch

public static boolean isIgnorePrefixesInSearch(OWLModel owlModel)

removeDirectSuperclass

public void removeDirectSuperclass(edu.stanford.smi.protege.model.Cls cls,
                                   edu.stanford.smi.protege.model.Cls superCls)
Specified by:
removeDirectSuperclass in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
removeDirectSuperclass in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

removeDirectSuperslot

public void removeDirectSuperslot(edu.stanford.smi.protege.model.Slot slot,
                                  edu.stanford.smi.protege.model.Slot superslot)
Specified by:
removeDirectSuperslot in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
removeDirectSuperslot in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

removeDirectType

public void removeDirectType(edu.stanford.smi.protege.model.Instance instance,
                             edu.stanford.smi.protege.model.Cls directType)
Specified by:
removeDirectType in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
removeDirectType in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

setDirectOwnSlotValues

public void setDirectOwnSlotValues(edu.stanford.smi.protege.model.Frame frame,
                                   edu.stanford.smi.protege.model.Slot slot,
                                   Collection values)
Specified by:
setDirectOwnSlotValues in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
setDirectOwnSlotValues in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

setSuperclassSynchronizationBlocked

public void setSuperclassSynchronizationBlocked(boolean value)

addDirectTemplateSlot

public void addDirectTemplateSlot(edu.stanford.smi.protege.model.Cls cls,
                                  edu.stanford.smi.protege.model.Slot slot)
Specified by:
addDirectTemplateSlot in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
addDirectTemplateSlot in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

removeDirectTemplateSlot

public void removeDirectTemplateSlot(edu.stanford.smi.protege.model.Cls cls,
                                     edu.stanford.smi.protege.model.Slot slot)
Specified by:
removeDirectTemplateSlot in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
removeDirectTemplateSlot in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

setDirectTemplateFacetValues

public void setDirectTemplateFacetValues(edu.stanford.smi.protege.model.Cls cls,
                                         edu.stanford.smi.protege.model.Slot slot,
                                         edu.stanford.smi.protege.model.Facet facet,
                                         Collection values)
Specified by:
setDirectTemplateFacetValues in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
setDirectTemplateFacetValues in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

setDirectTemplateSlotValues

public void setDirectTemplateSlotValues(edu.stanford.smi.protege.model.Cls cls,
                                        edu.stanford.smi.protege.model.Slot slot,
                                        Collection values)
Specified by:
setDirectTemplateSlotValues in interface edu.stanford.smi.protege.model.framestore.FrameStore
Overrides:
setDirectTemplateSlotValues in class edu.stanford.smi.protege.model.framestore.FrameStoreAdapter

Protégé-OWL 3.3.1

Submit a bug report or feature request
Copyright (c) 1998-2007 Stanford University.