Overview | Package | Class | Tree | Deprecated | Index | Help
| Protégé-OWL 3.4 rc1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.stanford.smi.protegex.owl.model.impl
Class OWLUtil

    java.lang.Object
      edu.stanford.smi.protegex.owl.model.impl.OWLUtil

    public class OWLUtil

extends Object

A collection of static utility methods for OWL classes. Many of them are used to "simulate" the multiple inheritance between the various implementations of RDFResource.

Author:
  Holger Knublauch

Constructor Summary
`OWLUtil()`

Method Summary
`static void` | `addComment(RDFResource resource, String comment)`
`static void` | `addDifferentFrom(RDFResource resource, RDFResource differentFrom)`
`static void` | `addIsDefinedBy(edu.stanford.smi.protege.model.Instance source, edu.stanford.smi.protege.model.Instance instance)`
`static void` | `addLabel(RDFResource source, String label, String language)`
`static void` | `addPropertyValue(RDFResource resource, RDFProperty property, Object value)`
`static void` | `addPropertyValueListener(RDFResource resource, PropertyValueListener listener)`
`static void` | `addProtegeType(RDFResource resource, RDFSClass type)`
`static void` | `addRDFType(RDFResource resource, RDFSClass type)`
`static void` | `addResourceListener(RDFResource resource, ResourceListener listener)`
`static void` | `addSameAs(edu.stanford.smi.protege.model.Instance source, edu.stanford.smi.protege.model.Instance instance)`
`static void` | `addVersionInfo(edu.stanford.smi.protege.model.Instance source, String versionInfo)`
`static RDFResource` | `as(RDFResource resource, Class javaInterface)`
`static RDFUntypedResource` | `assignUniqueURI(RDFUntypedResource eri)`
`static boolean` | `canAs(RDFResource resource, Class javaInterface)`
`static boolean` | `confirmSaveAndReload()` Deprecated. use the version with project parameter instead
`static boolean` | `confirmSaveAndReload(edu.stanford.smi.protege.model.Project project)`
`static boolean` | `containsAnonymousClass(Collection clses)`
`static void` | `convertEquivalentClsIntoSuperClses(RDFSClass ownerClass, RDFSClass equivalentClass)`
`static void` | `convertSuperClsIntoEquivalentCls(OWLNamedClass ownerCls, RDFSClass superClass)`
`static void` | `convertSuperClsIntoEquivalentCls(OWLNamedClass ownerCls, RDFSClass superClass, RDFSClass definition)`
`static void` | `copyAnnotations(edu.stanford.smi.protege.model.Instance source, edu.stanford.smi.protege.model.Instance target)`
`static edu.stanford.smi.protege.model.Cls` | `createClone(edu.stanford.smi.protege.model.Cls cls)` Deprecated. use CloneFactory and ResourceCopier instead
`static RDFSClass` | `createClone(OWLModel owlModel, String expression)` Deprecated. use CloneFactory and ResourceCopier instead
`static void` | `ensureSubclassesDisjoint(OWLNamedClass cls)`
`static boolean` | `equalsStructurally(Collection collection1, Collection collection2)`
`static OWLOntology` | `getActiveOntology(OWLModel owlModel)`
`static RDFResource` | `getAllValuesFromOnTypes(RDFResource resource, RDFProperty property)`
`static Collection` | `getComments(RDFResource resource)`
`static Collection` | `getDifferentFrom(RDFResource resource)`
`static RDFSClass` | `getDirectRDFType(RDFResource resource)`
`static Collection` | `getDirectRDFTypes(RDFResource resource)`
`static Collection` | `getDocumentation(edu.stanford.smi.protege.model.Instance source)`
`static Collection` | `getHasValuesOnTypes(RDFResource resource, RDFProperty property)`
`static Collection` | `getInferredDirectTypes(RDFResource resource)`
`static String` | `getInternalFullName(OWLModel owlModel, String name)`
`static String` | `getInternalFullName(OWLModel owlModel, String name, boolean expandShortNames)`
`static Collection` | `getIsDefinedBy(edu.stanford.smi.protege.model.Instance source)`
`static Collection` | `getLabels(RDFResource source)`
`static URI` | `getOWLFileURI(OWLModel owlModel)`
`static Collection` | `getPathsToRoot(edu.stanford.smi.protege.model.Cls cls)` Gets all paths from a given class to the root.
`static Collection` | `getPossibleRDFProperties(RDFResource resource)`
`static List` | `getPotentiallyDisjointSubclasses(OWLNamedClass cls)`
`static Object` | `getPropertyValue(RDFResource resource, RDFProperty property, boolean includingSubproperties)`
`static RDFResource` | `getPropertyValueAs(RDFResource resource, RDFProperty property, Class javaInterface)`
`static int` | `getPropertyValueCount(RDFResource resource, RDFProperty property)`
`static RDFSLiteral` | `getPropertyValueLiteral(RDFResource resource, RDFProperty property)`
`static Collection` | `getPropertyValueLiterals(RDFResource resource, RDFProperty property)`
`static Collection` | `getPropertyValues(RDFResource resource, RDFProperty property, boolean includingSubproperties)`
`static Collection` | `getPropertyValuesAs(RDFResource resource, RDFProperty property, Class javaInterface)`
`static Collection` | `getRDFProperties(RDFResource resource)`
`static RDFSClass` | `getRDFType(RDFResource resource)`
`static Collection` | `getRDFTypes(RDFResource resource)`
`static Set` | `getReferringAnonymousClses(RDFResource instance)`
`static void` | `getReferringLogicalClasses(RDFList list, Set set)`
`static Collection` | `getSameAs(edu.stanford.smi.protege.model.Instance source)`
`static Collection` | `getSelectableNamedClses(OWLModel owlModel)`
`static Collection` | `getVersionInfo(edu.stanford.smi.protege.model.Instance source)`
`static boolean` | `hasDirectRestriction(edu.stanford.smi.protege.model.Cls cls, edu.stanford.smi.protege.model.Slot slot, edu.stanford.smi.protege.model.Cls metaCls)`
`static boolean` | `hasOWLDLProfile(OWLModel owlModel)`
`static boolean` | `hasOWLFullProfile(OWLModel owlModel)`
`static boolean` | `hasPropertyValue(RDFResource resource, RDFProperty property)`
`static boolean` | `hasPropertyValue(RDFResource resource, RDFProperty property, boolean includingSubproperties)`
`static boolean` | `hasPropertyValue(RDFResource resource, RDFProperty property, Object value, boolean includingSubproperties)`
`static boolean` | `hasProtegeType(RDFResource resource, RDFSClass type)`
`static boolean` | `hasProtegeType(RDFResource resource, RDFSClass type, boolean includingSuperclasses)`
`static boolean` | `hasRDFProfile(OWLModel owlModel)`
`static boolean` | `hasRDFType(RDFResource resource, RDFSClass type)`
`static boolean` | `hasRDFType(RDFResource resource, RDFSClass type, boolean includingSuperclasses)`
`protected static boolean` | `isAbsoluteURI(OWLModel owlModel, String uriString)`
`static boolean` | `isInconsistent(edu.stanford.smi.protege.model.Cls cls)`
`static boolean` | `isSystem(edu.stanford.smi.protege.model.Frame resource)`
`static boolean` | `isValidPropertyValue(RDFResource resource, RDFProperty property, Object object)`
`static Iterator` | `listPropertyValues(RDFResource resource, RDFProperty property, boolean includingSubproperties)`
`static Iterator` | `listPropertyValuesAs(RDFResource resource, RDFProperty property, Class javaInterface)`
`static void` | `printStackTrace()`
`static void` | `removeComment(RDFResource resource, String comment)`
`static void` | `removeDifferentFrom(RDFResource resource, RDFResource differentFrom)`
`static List` | `removeInvisibleResources(Iterator it)`
`static void` | `removeIsDefinedBy(edu.stanford.smi.protege.model.Instance source, edu.stanford.smi.protege.model.Instance instance)`
`static void` | `removeLabel(RDFResource source, String label, String language)`
`static void` | `removePropertyValue(RDFResource resource, RDFProperty property, Object value)`
`static void` | `removePropertyValueListener(RDFResource resource, PropertyValueListener listener)`
`static void` | `removeProtegeType(RDFResource resource, RDFSClass type)`
`static void` | `removeRDFType(RDFResource resource, RDFSClass type)`
`static void` | `removeResourceListener(RDFResource resource, ResourceListener listener)`
`static void` | `removeSameAs(edu.stanford.smi.protege.model.Instance source, edu.stanford.smi.protege.model.Instance instance)`
`static void` | `removeSubclassesDisjoint(OWLNamedClass cls)`
`static void` | `removeVersionInfo(edu.stanford.smi.protege.model.Instance source, String versionInfo)`
`static OWLOntology` | `renameOntology(OWLModel owlModel, OWLOntology oldOntology, String newName)` Renames an ontology.
`static void` | `resetComputedSuperclasses(OWLModel owlModel)`
`static void` | `resetComputedSuperclasses(OWLModel owlModel, Collection clses)`
`static boolean` | `runsWithGUI(OWLModel owlModel)`
`static boolean` | `saveAndReloadProject()`
`static void` | `setComment(RDFResource resource, String comment)`
`static void` | `setComments(RDFResource resource, Collection comments)`
`static void` | `setConsistentClassificationStatus(OWLNamedClass namedCls)`
`static void` | `setDocumentation(edu.stanford.smi.protege.model.Instance source, Collection values)`
`static void` | `setInferredTypes(RDFResource resource, Collection types)`
`static void` | `setPropertyValue(RDFResource resource, RDFProperty property, Object value)`
`static void` | `setPropertyValues(RDFResource resource, RDFProperty property, Collection values)`
`static void` | `setProtegeType(RDFResource resource, RDFSClass type)`
`static void` | `setProtegeTypes(RDFResource resource, Collection types)`
`static void` | `setRDFType(RDFResource resource, RDFSClass type)`
`static void` | `setRDFTypes(RDFResource resource, Collection types)`
`static void` | `sortSubclasses(edu.stanford.smi.protege.model.Cls superCls)`
`static void` | `sortSubclasses(OWLModel owlModel)`
`static void` | `synchronizeTripleStoreAfterOntologyRename(OWLModel owlModel, String oldName, OWLOntology newOntology)` Ensures that the triple store and the renamed ontology have the same name.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### OWLUtil

    public OWLUtil()

Method Detail

### addIsDefinedBy

    public static void addIsDefinedBy(edu.stanford.smi.protege.model.Instance source,
                                      edu.stanford.smi.protege.model.Instance instance)

### addLabel

    public static void addLabel(RDFResource source,
                                String label,
                                String language)

### addSameAs

    public static void addSameAs(edu.stanford.smi.protege.model.Instance source,
                                 edu.stanford.smi.protege.model.Instance instance)

### addVersionInfo

    public static void addVersionInfo(edu.stanford.smi.protege.model.Instance source,
                                      String versionInfo)

### assignUniqueURI

    public static RDFUntypedResource assignUniqueURI(RDFUntypedResource eri)

### confirmSaveAndReload

    @Deprecated
    public static boolean confirmSaveAndReload()

  Deprecated. use the version with project parameter instead

### confirmSaveAndReload

    public static boolean confirmSaveAndReload(edu.stanford.smi.protege.model.Project project)

### copyAnnotations

    public static void copyAnnotations(edu.stanford.smi.protege.model.Instance source,
                                       edu.stanford.smi.protege.model.Instance target)

### convertEquivalentClsIntoSuperClses

    public static void convertEquivalentClsIntoSuperClses(RDFSClass ownerClass,
                                                          RDFSClass equivalentClass)

### convertSuperClsIntoEquivalentCls

    public static void convertSuperClsIntoEquivalentCls(OWLNamedClass ownerCls,
                                                        RDFSClass superClass)

### convertSuperClsIntoEquivalentCls

    public static void convertSuperClsIntoEquivalentCls(OWLNamedClass ownerCls,
                                                        RDFSClass superClass,
                                                        RDFSClass definition)

### createClone

    @Deprecated
    public static edu.stanford.smi.protege.model.Cls createClone(edu.stanford.smi.protege.model.Cls cls)

  Deprecated. use CloneFactory and ResourceCopier instead

  Creates a copy of a given class and also copies the annotation property values.

  Parameters:
    `cls` - the class to clone
  Returns:
    a clone of cls or cls itself if it is a named class

### createClone

    @Deprecated
    public static RDFSClass createClone(OWLModel owlModel,
                                                   String expression)

  Deprecated. use CloneFactory and ResourceCopier instead

  Parameters:
    `owlModel` -
    `expression` -
  Returns:

### ensureSubclassesDisjoint

    public static void ensureSubclassesDisjoint(OWLNamedClass cls)

### equalsStructurally

    public static boolean equalsStructurally(Collection collection1,
                                             Collection collection2)

### getDocumentation

    public static Collection getDocumentation(edu.stanford.smi.protege.model.Instance source)

### getInferredDirectTypes

    public static Collection getInferredDirectTypes(RDFResource resource)

### getIsDefinedBy

    public static Collection getIsDefinedBy(edu.stanford.smi.protege.model.Instance source)

### getLabels

    public static Collection getLabels(RDFResource source)

### getPathsToRoot

    public static Collection getPathsToRoot(edu.stanford.smi.protege.model.Cls cls)

  Gets all paths from a given class to the root. This is needed if the user requests to see all occurances of a class in a tree.

  Parameters:
    `cls` - the Cls to find all paths to
  Returns:
    a Collection of List objects, with each List starting at cls

### getPotentiallyDisjointSubclasses

    public static List getPotentiallyDisjointSubclasses(OWLNamedClass cls)

### getReferringAnonymousClses

    public static Set getReferringAnonymousClses(RDFResource instance)

### getReferringLogicalClasses

    public static void getReferringLogicalClasses(RDFList list,
                                                  Set set)

### getSameAs

    public static Collection getSameAs(edu.stanford.smi.protege.model.Instance source)

### getSelectableNamedClses

    public static Collection getSelectableNamedClses(OWLModel owlModel)

### getVersionInfo

    public static Collection getVersionInfo(edu.stanford.smi.protege.model.Instance source)

### hasDirectRestriction

    public static boolean hasDirectRestriction(edu.stanford.smi.protege.model.Cls cls,
                                               edu.stanford.smi.protege.model.Slot slot,
                                               edu.stanford.smi.protege.model.Cls metaCls)

### hasOWLDLProfile

    public static boolean hasOWLDLProfile(OWLModel owlModel)

### hasOWLFullProfile

    public static boolean hasOWLFullProfile(OWLModel owlModel)

### hasRDFProfile

    public static boolean hasRDFProfile(OWLModel owlModel)

### isInconsistent

    public static boolean isInconsistent(edu.stanford.smi.protege.model.Cls cls)

### printStackTrace

    public static void printStackTrace()

### removeIsDefinedBy

    public static void removeIsDefinedBy(edu.stanford.smi.protege.model.Instance source,
                                         edu.stanford.smi.protege.model.Instance instance)

### removeLabel

    public static void removeLabel(RDFResource source,
                                   String label,
                                   String language)

### removeSameAs

    public static void removeSameAs(edu.stanford.smi.protege.model.Instance source,
                                    edu.stanford.smi.protege.model.Instance instance)

### removeSubclassesDisjoint

    public static void removeSubclassesDisjoint(OWLNamedClass cls)

### removeVersionInfo

    public static void removeVersionInfo(edu.stanford.smi.protege.model.Instance source,
                                         String versionInfo)

### resetComputedSuperclasses

    public static void resetComputedSuperclasses(OWLModel owlModel)

### resetComputedSuperclasses

    public static void resetComputedSuperclasses(OWLModel owlModel,
                                                 Collection clses)

### saveAndReloadProject

    public static boolean saveAndReloadProject()

### setDocumentation

    public static void setDocumentation(edu.stanford.smi.protege.model.Instance source,
                                        Collection values)

### setConsistentClassificationStatus

    public static void setConsistentClassificationStatus(OWLNamedClass namedCls)

### sortSubclasses

    public static void sortSubclasses(edu.stanford.smi.protege.model.Cls superCls)

### addProtegeType

    public static void addProtegeType(RDFResource resource,
                                      RDFSClass type)

### getDirectRDFType

    public static RDFSClass getDirectRDFType(RDFResource resource)

### getDirectRDFTypes

    public static Collection getDirectRDFTypes(RDFResource resource)

### hasProtegeType

    public static boolean hasProtegeType(RDFResource resource,
                                         RDFSClass type)

### hasProtegeType

    public static boolean hasProtegeType(RDFResource resource,
                                         RDFSClass type,
                                         boolean includingSuperclasses)

### removeProtegeType

    public static void removeProtegeType(RDFResource resource,
                                         RDFSClass type)

### setProtegeType

    public static void setProtegeType(RDFResource resource,
                                      RDFSClass type)

### setProtegeTypes

    public static void setProtegeTypes(RDFResource resource,
                                       Collection types)

### addDifferentFrom

    public static void addDifferentFrom(RDFResource resource,
                                        RDFResource differentFrom)

### removeDifferentFrom

    public static void removeDifferentFrom(RDFResource resource,
                                           RDFResource differentFrom)

### addComment

    public static void addComment(RDFResource resource,
                                  String comment)

### removeComment

    public static void removeComment(RDFResource resource,
                                     String comment)

### addPropertyValue

    public static void addPropertyValue(RDFResource resource,
                                        RDFProperty property,
                                        Object value)

### getComments

    public static Collection getComments(RDFResource resource)

### setComment

    public static void setComment(RDFResource resource,
                                  String comment)

### setComments

    public static void setComments(RDFResource resource,
                                   Collection comments)

### setInferredTypes

    public static void setInferredTypes(RDFResource resource,
                                        Collection types)

### getDifferentFrom

    public static Collection getDifferentFrom(RDFResource resource)

### getPropertyValue

    public static Object getPropertyValue(RDFResource resource,
                                          RDFProperty property,
                                          boolean includingSubproperties)

### getPropertyValueCount

    public static int getPropertyValueCount(RDFResource resource,
                                            RDFProperty property)

### getPropertyValues

    public static Collection getPropertyValues(RDFResource resource,
                                               RDFProperty property,
                                               boolean includingSubproperties)

### listPropertyValues

    public static Iterator listPropertyValues(RDFResource resource,
                                              RDFProperty property,
                                              boolean includingSubproperties)

### removePropertyValue

    public static void removePropertyValue(RDFResource resource,
                                           RDFProperty property,
                                           Object value)

### setPropertyValue

    public static void setPropertyValue(RDFResource resource,
                                        RDFProperty property,
                                        Object value)

### setPropertyValues

    public static void setPropertyValues(RDFResource resource,
                                         RDFProperty property,
                                         Collection values)

### isSystem

    public static boolean isSystem(edu.stanford.smi.protege.model.Frame resource)

### getPropertyValueLiterals

    public static Collection getPropertyValueLiterals(RDFResource resource,
                                                      RDFProperty property)

### getPropertyValueLiteral

    public static RDFSLiteral getPropertyValueLiteral(RDFResource resource,
                                                      RDFProperty property)

### getRDFProperties

    public static Collection getRDFProperties(RDFResource resource)

### addResourceListener

    public static void addResourceListener(RDFResource resource,
                                           ResourceListener listener)

### removeResourceListener

    public static void removeResourceListener(RDFResource resource,
                                              ResourceListener listener)

### hasPropertyValue

    public static boolean hasPropertyValue(RDFResource resource,
                                           RDFProperty property,
                                           Object value,
                                           boolean includingSubproperties)

### addPropertyValueListener

    public static void addPropertyValueListener(RDFResource resource,
                                                PropertyValueListener listener)

### removePropertyValueListener

    public static void removePropertyValueListener(RDFResource resource,
                                                   PropertyValueListener listener)

### getPossibleRDFProperties

    public static Collection getPossibleRDFProperties(RDFResource resource)

### as

    public static RDFResource as(RDFResource resource,
                                 Class javaInterface)

### canAs

    public static boolean canAs(RDFResource resource,
                                Class javaInterface)

### getPropertyValuesAs

    public static Collection getPropertyValuesAs(RDFResource resource,
                                                 RDFProperty property,
                                                 Class javaInterface)

### getPropertyValueAs

    public static RDFResource getPropertyValueAs(RDFResource resource,
                                                 RDFProperty property,
                                                 Class javaInterface)

### listPropertyValuesAs

    public static Iterator listPropertyValuesAs(RDFResource resource,
                                                RDFProperty property,
                                                Class javaInterface)

### hasPropertyValue

    public static boolean hasPropertyValue(RDFResource resource,
                                           RDFProperty property)

### hasPropertyValue

    public static boolean hasPropertyValue(RDFResource resource,
                                           RDFProperty property,
                                           boolean includingSubproperties)

### getRDFType

    public static RDFSClass getRDFType(RDFResource resource)

### getRDFTypes

    public static Collection getRDFTypes(RDFResource resource)

### addRDFType

    public static void addRDFType(RDFResource resource,
                                  RDFSClass type)

### removeRDFType

    public static void removeRDFType(RDFResource resource,
                                     RDFSClass type)

### hasRDFType

    public static boolean hasRDFType(RDFResource resource,
                                     RDFSClass type)

### hasRDFType

    public static boolean hasRDFType(RDFResource resource,
                                     RDFSClass type,
                                     boolean includingSuperclasses)

### sortSubclasses

    public static void sortSubclasses(OWLModel owlModel)

### setRDFType

    public static void setRDFType(RDFResource resource,
                                  RDFSClass type)

### setRDFTypes

    public static void setRDFTypes(RDFResource resource,
                                   Collection types)

### getHasValuesOnTypes

    public static Collection getHasValuesOnTypes(RDFResource resource,
                                                 RDFProperty property)

### containsAnonymousClass

    public static boolean containsAnonymousClass(Collection clses)

### removeInvisibleResources

    public static List removeInvisibleResources(Iterator it)

### isValidPropertyValue

    public static boolean isValidPropertyValue(RDFResource resource,
                                               RDFProperty property,
                                               Object object)

### getAllValuesFromOnTypes

    public static RDFResource getAllValuesFromOnTypes(RDFResource resource,
                                                      RDFProperty property)

### getActiveOntology

    public static OWLOntology getActiveOntology(OWLModel owlModel)

### getOWLFileURI

    public static URI getOWLFileURI(OWLModel owlModel)

### runsWithGUI

    public static boolean runsWithGUI(OWLModel owlModel)

### renameOntology

    public static OWLOntology renameOntology(OWLModel owlModel,
                                             OWLOntology oldOntology,
                                             String newName)

  Renames an ontology. Returns a new ontology object with the new name.

  Parameters:
    `owlModel` - - the OWL model
    `oldOntology` - - the old OWL Ontology
    `newName` - - the new name of the ontology
  Returns:
    - a new OWL ontology with the name `newName`

### synchronizeTripleStoreAfterOntologyRename

    public static void synchronizeTripleStoreAfterOntologyRename(OWLModel owlModel,
                                                                 String oldName,
                                                                 OWLOntology newOntology)

  Ensures that the triple store and the renamed ontology have the same name.

  Parameters:
    `owlModel` - - the OWL model
    `oldName` - - old name of the ontology
    `newOntology` - - new (renamed) OWL ontology

### getInternalFullName

    public static String getInternalFullName(OWLModel owlModel,
                                             String name)

### getInternalFullName

    public static String getInternalFullName(OWLModel owlModel,
                                             String name,
                                             boolean expandShortNames)

### isAbsoluteURI

    protected static boolean isAbsoluteURI(OWLModel owlModel,
                                           String uriString)

Overview | Package | Class | Tree | Deprecated | Index | Help
| Protégé-OWL 3.4 rc1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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