|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object kaos.ontology.util.KAoSClassBuilderImpl
public class KAoSClassBuilderImpl
Class building an Ontology definition of class within (OWL or DAML, depending on the specified ontologyLanguage) com.hp.hpl.jena.ontology.OntModel
Field Summary | |
---|---|
static java.lang.String |
_classLable
|
protected java.lang.String |
_classNameSpace
|
protected OntClass |
_compClass
|
protected int |
_counter
|
protected OntClass |
_currentClass
|
protected SerializableOntModelImpl |
_currentClassModel
|
protected java.lang.String |
_immediateBaseClassName
|
protected OntClass |
_instBaseClass
|
protected OntClass |
_prevCompClass
|
protected java.util.HashSet |
_propertyNames
|
protected java.util.Hashtable |
_restrictions
|
Constructor Summary | |
---|---|
KAoSClassBuilderImpl(SerializableOntModelImpl dcm,
java.lang.String classURI)
|
|
KAoSClassBuilderImpl(java.lang.String classURI)
Starts building the new classdefinition, delete any existing state of the previously built definition. |
|
KAoSClassBuilderImpl(java.lang.String dcm,
java.lang.String classURI)
|
Method Summary | |
---|---|
void |
addBaseClass(java.lang.String baseClassName)
Add this class as a superclass to the class being built. |
void |
addBaseClassComplement(java.lang.String baseClassName)
Add the complement of the base Action class to be controlled by this policy. |
void |
addClassInstance(java.lang.String instanceURI)
Add the given instance to the set of individuals that extensionally define the class |
void |
addImmediateBaseClass(java.lang.String baseClassName)
Add this class as a superclass to the class being built. |
void |
addPropertyRangeInstance(java.lang.String propertyName,
java.lang.String instanceName)
|
void |
addPropertyRangeInstance(java.lang.String propertyName,
java.lang.String instanceName,
java.lang.String type)
Add the provided instance to the class being the range of the specified property. |
void |
addRequiredValueOnProperty(java.lang.String propertyName,
java.lang.String instanceName)
Add the provided instance to the hasValue property of restriction on the specified property. |
void |
copyPropertyRangeFromOtherPolicy(KAoSClassBuilderImpl sourcePolicy,
java.lang.String propertyName)
Copies the property range data for the specified range to the current policy from the provided source policy |
java.util.Vector |
getBaseClasses()
Get the superclasses of the current class. |
java.lang.String |
getBasePropertyRangeClass(java.lang.String propertyName)
Get the name of the class on which the range of the given property is set. |
java.lang.String |
getClassName()
Get the name of the current class. |
java.lang.String |
getCurrentPropertyRangeClass(java.lang.String propertyName)
Get the name of the class on which the range of the given property is set. |
java.lang.String |
getImmediateBaseClass()
Get the immediate base class of this class. |
SerializableOntModelImpl |
getOntClass()
Return the defined class as OntModel. |
java.lang.String |
getOntClassAsText()
Return the defined class as text. |
java.lang.String |
getParentPropertyRangeClass(java.lang.String propertyName)
Get the name of the parent class of the class on which the range of the given property is set. |
java.util.Vector |
getPropertyNames()
|
java.lang.String[] |
getPropertyRangeInstance(java.lang.String propertyName)
Get the instances defining the range of the specified property. |
java.lang.String |
getRangeComplementParentClass(java.lang.String propertyName)
Get the parent class of the complement of the given property range. |
java.lang.String |
getRestrictionTypeName(java.lang.String propertyName)
|
boolean |
isPropertyRangeBasedOnClass(java.lang.String propertyName)
Check if the range of the specified property is class based or instance based. |
boolean |
isRangeComplement(java.lang.String propertyName)
Check if the range of the property is a complement. |
void |
makeRangeComplement(java.lang.String propertyName,
java.lang.String propertyClassName)
Make the range of the property complement of the current range. |
protected static void |
printDebugString(java.lang.String msg,
int loggerDisplayLevel)
Utility method to print debug messages. |
void |
readFromModel(SerializableOntModelImpl dcm,
java.lang.String classURI)
to read from an already constructed DAMLModel |
void |
removeBaseClass(java.lang.String baseClassName)
Remove the class from the list of superclasses of the built class. |
void |
removeClassInstance(java.lang.String instanceURI)
removes the given instance from the list of instances that extensionally define the class. |
void |
removePropertyRangeInstance(java.lang.String propertyName,
java.lang.String instanceName)
Remove the provided instance from the class being the range of the specified property. |
void |
removeRequiredValueOnProperty(java.lang.String propertyName,
java.lang.String instanceName)
Remove the provided instance from the hasValue property of restriction on the specified property. |
void |
resetClassBuilding()
|
void |
setInstanceEnumeration(java.util.Vector instanceURIs,
java.lang.String instBaseClass)
Convert this class to an myEnumerated class where the class is defined extensionally by the given set of instances. |
void |
setPropertyRangeClass(java.lang.String propertyName,
java.lang.String propertyClassName)
|
void |
setPropertyRangeClass(java.lang.String propertyName,
java.lang.String propertyClassName,
java.lang.String type)
Set the range of the given poperty to the specified class. |
void |
setPropertyRangeClassDifference(java.lang.String propertyName,
java.lang.String baseClassName1,
java.lang.String baseClassName2,
java.lang.String type)
Set the range of the property to the Difference of specified classes. |
void |
setPropertyRangeClassIntersection(java.lang.String propertyName,
java.lang.String baseClassName1,
java.lang.String baseClassName2,
java.lang.String type)
Set the range of the property to the intersection of specified classes. |
void |
showClass(Logger log,
int level)
Print the class to the screen in XML format |
java.lang.String |
toString()
Rerurn class string in XML format |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected SerializableOntModelImpl _currentClassModel
protected OntClass _currentClass
protected OntClass _compClass
protected OntClass _prevCompClass
protected OntClass _instBaseClass
protected java.util.Hashtable _restrictions
protected java.lang.String _classNameSpace
protected java.lang.String _immediateBaseClassName
protected java.util.HashSet _propertyNames
protected int _counter
public static final java.lang.String _classLable
Constructor Detail |
---|
public KAoSClassBuilderImpl(java.lang.String classURI)
public KAoSClassBuilderImpl(java.lang.String dcm, java.lang.String classURI)
public KAoSClassBuilderImpl(SerializableOntModelImpl dcm, java.lang.String classURI)
Method Detail |
---|
public void setInstanceEnumeration(java.util.Vector instanceURIs, java.lang.String instBaseClass) throws ClassNameNotSet
instances
- - Vector of Strings, each of which is a URI for an instanceinstBaseClass
-
ClassNameNotSet
public void addClassInstance(java.lang.String instanceURI) throws ClassNameNotSet, RangeIsBasedOnAClass
instanceURI
- - the string containing the URI of the instance to add
ClassNameNotSet
RangeIsBasedOnAClass
- - if this is not an myEnumerated classpublic void removeClassInstance(java.lang.String instanceURI) throws ClassNameNotSet, RangeIsBasedOnAClass, InstanceNotInThisRange
instanceURI
- - the string containing the URI of the instance to remove
ClassNameNotSet
RangeIsBasedOnAClass
- - if this is not an myEnumerated class
InstanceNotInThisRange
- - if the instance is not in the classpublic void readFromModel(SerializableOntModelImpl dcm, java.lang.String classURI)
public void resetClassBuilding()
public SerializableOntModelImpl getOntClass() throws BuildingNotCompleted
BuildingNotCompleted
- if the current class is not fully specifiedpublic java.lang.String getOntClassAsText() throws BuildingNotCompleted
BuildingNotCompleted
- if the current class is not fully specifiedpublic java.lang.String getClassName() throws ValueNotSet
ValueNotSet
- if value of the class name is not knownpublic void addBaseClass(java.lang.String baseClassName) throws ClassNameNotSet, DisjointClassWithAlreadyAdded
baseClassName
- the name of the base class
ClassNameNotSet
- if the class name has not been set before
DisjointClassWithAlreadyAdded
- if the provided class is disjoint with the classes already addedpublic void addImmediateBaseClass(java.lang.String baseClassName) throws ClassNameNotSet, DisjointClassWithAlreadyAdded
baseClassName
- the name of the base class
ClassNameNotSet
- if the class name has not been set before
DisjointClassWithAlreadyAdded
- if the provided class is disjoint with the classes already addedpublic void addBaseClassComplement(java.lang.String baseClassName) throws DisjointClassWithAlreadyAdded
actionBaseClassName
- the name of the action superclass whose complemet
is to be taken
PolicyNameNotSet
- if the policy name has not been set before
DisjointClassWithAlreadyAdded
- if the provided Action class is disjoint with the classes already addedpublic void removeBaseClass(java.lang.String baseClassName) throws ClassNotSuperClass
baseClassName
- the name of the base class
ClassNotSuperClass
- if the class was not previously added to the list of superclassespublic java.util.Vector getBaseClasses() throws ValueNotSet
ValueNotSet
- if superclasses are not knownpublic java.lang.String getImmediateBaseClass() throws ValueNotSet
ValueNotSet
- if superclasses are not knownpublic boolean isPropertyRangeBasedOnClass(java.lang.String propertyName) throws ValueNotSet
ValueNotSet
- if the range is not setpublic void setPropertyRangeClass(java.lang.String propertyName, java.lang.String propertyClassName) throws ClassNameNotSet
ClassNameNotSet
public void setPropertyRangeClass(java.lang.String propertyName, java.lang.String propertyClassName, java.lang.String type) throws ClassNameNotSet
propertyName
- the name of the propertypropertyClassName
- the name of the class
ClassNameNotSet
- if the class name has not been set beforepublic void setPropertyRangeClassIntersection(java.lang.String propertyName, java.lang.String baseClassName1, java.lang.String baseClassName2, java.lang.String type) throws ClassNameNotSet
baseClassName1
- the name of the Actor subclassbaseClassName2
- the name of the Actor subclass
ValueNotSet
- if the class has
not been set before
ClassNameNotSet
public void setPropertyRangeClassDifference(java.lang.String propertyName, java.lang.String baseClassName1, java.lang.String baseClassName2, java.lang.String type) throws ClassNameNotSet
baseClassName1
- the name of the Actor subclassbaseClassName2
- the name of the Actor subclass
ValueNotSet
- if the class has
not been set before
ClassNameNotSet
public java.lang.String getParentPropertyRangeClass(java.lang.String propertyName)
propertyName
- the name of the property
public java.lang.String getBasePropertyRangeClass(java.lang.String propertyName) throws ValueNotSet, RangeIsBasedOnInstances
propertyName
- the name of the property
ValueNotSet
- if the class is not known
RangeIsBasedOnInstances
- if the range is based on
instancespublic java.lang.String getCurrentPropertyRangeClass(java.lang.String propertyName) throws ValueNotSet
propertyName
- the name of the property
ValueNotSet
- if the class is not knownpublic void addPropertyRangeInstance(java.lang.String propertyName, java.lang.String instanceName) throws ClassNameNotSet, RangeIsBasedOnAClass
ClassNameNotSet
RangeIsBasedOnAClass
public void addPropertyRangeInstance(java.lang.String propertyName, java.lang.String instanceName, java.lang.String type) throws ClassNameNotSet, RangeIsBasedOnAClass
propertyName
- the name of the propertyinstanceName
- the name of the instance to define a range of possible values for this property
ClassNameNotSet
- if the class name has not been set before
RangeIsBasedOnAClass
- if the target range was already set to classpublic void removePropertyRangeInstance(java.lang.String propertyName, java.lang.String instanceName) throws RangeIsBasedOnAClass, InstanceNotInThisRange
propertyName
- the name of the propertyinstanceName
- the name of the instance to define a range of possible values for this property
RangeIsBasedOnAClass
- if the property range was already set to class
InstanceNotInThisRange
- if the instance was not previously addedpublic java.lang.String[] getPropertyRangeInstance(java.lang.String propertyName) throws ValueNotSet, RangeIsBasedOnAClass
propertyName
- the name of the property
ValueNotSet
- if property range instances are not known
RangeIsBasedOnAClass
- if the range is based on classpublic void addRequiredValueOnProperty(java.lang.String propertyName, java.lang.String instanceName) throws ClassNameNotSet
propertyName
- the name of the propertyinstanceName
- the name of the instance to define a range of possible values for this property
ClassNameNotSet
- if the class name has not been set beforepublic void removeRequiredValueOnProperty(java.lang.String propertyName, java.lang.String instanceName) throws ClassNameNotSet, ValueNotSet
propertyName
- the name of the propertyinstanceName
- the name of the instance to define a range of possible values for this property
ClassNameNotSet
- if the class name has not been set before
ValueNotSet
- if the specified value is not foundpublic void makeRangeComplement(java.lang.String propertyName, java.lang.String propertyClassName) throws AlreadyComplement
propertyName
- the name of the property
AlreadyComplement
- if property range was already made complementpublic void copyPropertyRangeFromOtherPolicy(KAoSClassBuilderImpl sourcePolicy, java.lang.String propertyName)
sourcePolicy
- KAoSPolicyBuilder containing the source policypropertyName
- the name of the propertypublic java.lang.String getRangeComplementParentClass(java.lang.String propertyName) throws ValueNotSet
propertyName
- the name of the property
ValueNotSet
- if the complement or the parent
class is not setpublic boolean isRangeComplement(java.lang.String propertyName)
propertyName
- the name of the property
public java.util.Vector getPropertyNames()
public java.lang.String getRestrictionTypeName(java.lang.String propertyName) throws ValueNotSet
ValueNotSet
public void showClass(Logger log, int level)
public java.lang.String toString()
toString
in class java.lang.Object
protected static void printDebugString(java.lang.String msg, int loggerDisplayLevel)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |