org.meta2project.model.debug
Class DebugOntology

java.lang.Object
  extended by org.meta2project.model.debug.DebugAnnotatedEntity
      extended by org.meta2project.model.debug.DebugOntology
All Implemented Interfaces:
AnnotatedEntity, Ontology

public class DebugOntology
extends DebugAnnotatedEntity
implements Ontology

Author:
Anton Malykh

Field Summary
 
Fields inherited from interface org.meta2project.model.AnnotatedEntity
CASCADE, CASCADE_DELETE_VALUE, COMMENT, MAX_CARD, MIN_CARD, MODEL_URI, TITLE
 
Constructor Summary
DebugOntology(DebugSession session, Ontology ontology)
           
 
Method Summary
 OntClass createOntClass(java.lang.String name, OntClass... parentClasses)
          Create ontology class with specified short name.
 OntObject createOntObject(java.lang.Object... initParams)
          Create ontology object with an unique surrogate name.
 OntObject createOntObject(java.lang.String name, java.lang.Object... initParams)
          Create ontology object with the specified short name.
 OProperty createOProperty(java.lang.String name, OntClass domain, OntClass range, java.lang.Integer minCard, java.lang.Integer maxCard)
          Create ontology oproperty
 TProperty createTProperty(java.lang.String name, OntClass domain, java.lang.String rangeTypeURI, int minCard, int maxCard)
          Create ontology tproperty
 TProperty createTProperty(java.lang.String name, OntClass domain, java.lang.String rangeTypeURI, int minCard, java.lang.Integer maxCard)
          Create ontology tproperty
 TProperty createTProperty(java.lang.String name, OntClass domain, Type range, java.lang.Integer minCard, java.lang.Integer maxCard)
          Create ontology tproperty
 Type createType(java.lang.String name)
          Create ontology data type with specified short name.
 void delete()
          Delete the ontology.
 boolean equals(java.lang.Object obj)
           
 java.util.Collection<OntObject> find(FindOption option, java.lang.String... text)
          Find all objects, which tproperty values contains the text.
 java.util.Collection<OntObject> getAllOntObjects()
          Get all object of the ontology
 java.util.Collection<OProperty> getAllOProperties()
          Get all oproperties of the ontology
 java.util.Collection<TProperty> getAllTProperties()
          Get all tproperties of the ontology
 java.util.Collection<Type> getAllTypes()
          Get all data types from the ontology.
 java.util.Collection<OntClass> getBasicOntClasses()
          Get a collections of the ontology classes, which has no super classes.
 OntClass getOntClass(java.lang.String name)
          Get the class by the short name for the ontology
 java.util.Collection<OntClass> getOntClasses()
          Get all classes from the ontology.
 OntObject getOntObject(java.lang.String name)
          Get ontology object by the short name.
 OProperty getOProperty(java.lang.String name)
          Get the ontology tproperty by the short name.
 TProperty getTProperty(java.lang.String name)
          Get ontology tproperty by short name
 Type getType(java.lang.String name)
          Get the data type by the short name for the ontology.
 java.lang.String getURI()
          Get ontology URI
 void setURI(java.lang.String uri)
          Set new ontology URI
protected static java.lang.Object[] unwrapParams(java.lang.Object... initParams)
           
 
Methods inherited from class org.meta2project.model.debug.DebugAnnotatedEntity
getAnnotation, getAnnotationNames, putAnnotation
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.meta2project.model.AnnotatedEntity
getAnnotation, getAnnotationNames, putAnnotation
 

Constructor Detail

DebugOntology

public DebugOntology(DebugSession session,
                     Ontology ontology)
Method Detail

getURI

public java.lang.String getURI()
Description copied from interface: Ontology
Get ontology URI

Specified by:
getURI in interface Ontology
Returns:
ontology URI

getType

public Type getType(java.lang.String name)
Description copied from interface: Ontology
Get the data type by the short name for the ontology.

Specified by:
getType in interface Ontology
Parameters:
name - short name
Returns:
type

getAllTypes

public java.util.Collection<Type> getAllTypes()
Description copied from interface: Ontology
Get all data types from the ontology.

Specified by:
getAllTypes in interface Ontology
Returns:
collection of class Type objects

getOntClass

public OntClass getOntClass(java.lang.String name)
Description copied from interface: Ontology
Get the class by the short name for the ontology

Specified by:
getOntClass in interface Ontology
Parameters:
name - short name
Returns:
class

getOntClasses

public java.util.Collection<OntClass> getOntClasses()
Description copied from interface: Ontology
Get all classes from the ontology.

Specified by:
getOntClasses in interface Ontology
Returns:
collection of class OntClass objects;

getBasicOntClasses

public java.util.Collection<OntClass> getBasicOntClasses()
Description copied from interface: Ontology
Get a collections of the ontology classes, which has no super classes.

Specified by:
getBasicOntClasses in interface Ontology
Returns:
collection of class OntClass objects

getOProperty

public OProperty getOProperty(java.lang.String name)
Description copied from interface: Ontology
Get the ontology tproperty by the short name.

Specified by:
getOProperty in interface Ontology
Parameters:
name - short name
Returns:
întology oproperty

getAllOProperties

public java.util.Collection<OProperty> getAllOProperties()
Description copied from interface: Ontology
Get all oproperties of the ontology

Specified by:
getAllOProperties in interface Ontology
Returns:
collection class OProperty objects

getTProperty

public TProperty getTProperty(java.lang.String name)
Description copied from interface: Ontology
Get ontology tproperty by short name

Specified by:
getTProperty in interface Ontology
Parameters:
name - short name
Returns:
tproperty

getAllTProperties

public java.util.Collection<TProperty> getAllTProperties()
Description copied from interface: Ontology
Get all tproperties of the ontology

Specified by:
getAllTProperties in interface Ontology
Returns:
collection class TProperty objects

getOntObject

public OntObject getOntObject(java.lang.String name)
Description copied from interface: Ontology
Get ontology object by the short name.

Specified by:
getOntObject in interface Ontology
Parameters:
name - short name
Returns:
ontology object

getAllOntObjects

public java.util.Collection<OntObject> getAllOntObjects()
Description copied from interface: Ontology
Get all object of the ontology

Specified by:
getAllOntObjects in interface Ontology
Returns:
collection class OntObject objects

createType

public Type createType(java.lang.String name)
Description copied from interface: Ontology
Create ontology data type with specified short name.

Specified by:
createType in interface Ontology
Parameters:
name - short name
Returns:
created data type

createOntClass

public OntClass createOntClass(java.lang.String name,
                               OntClass... parentClasses)
Description copied from interface: Ontology
Create ontology class with specified short name.

Specified by:
createOntClass in interface Ontology
Parameters:
name - short name
parentClasses - super ñlasses of the class
Returns:
created class

unwrapParams

protected static java.lang.Object[] unwrapParams(java.lang.Object... initParams)

createOntObject

public OntObject createOntObject(java.lang.String name,
                                 java.lang.Object... initParams)
Description copied from interface: Ontology
Create ontology object with the specified short name.

Specified by:
createOntObject in interface Ontology
Parameters:
name - short name
initParams - init params (OntClass objects)
Returns:
created object
See Also:
OntClass

createOntObject

public OntObject createOntObject(java.lang.Object... initParams)
Description copied from interface: Ontology
Create ontology object with an unique surrogate name.

Specified by:
createOntObject in interface Ontology
Parameters:
initParams - init params (OntClass objects)
Returns:
created object
See Also:
OntClass

createOProperty

public OProperty createOProperty(java.lang.String name,
                                 OntClass domain,
                                 OntClass range,
                                 java.lang.Integer minCard,
                                 java.lang.Integer maxCard)
Description copied from interface: Ontology
Create ontology oproperty

Specified by:
createOProperty in interface Ontology
Parameters:
name - name
domain - may be null
range - may be null
minCard - may be null
maxCard - may be null
Returns:
created oproperty

createTProperty

public TProperty createTProperty(java.lang.String name,
                                 OntClass domain,
                                 Type range,
                                 java.lang.Integer minCard,
                                 java.lang.Integer maxCard)
Description copied from interface: Ontology
Create ontology tproperty

Specified by:
createTProperty in interface Ontology
Parameters:
name - name
domain - domain, may be null
range - rande, may be null
minCard - may be null
maxCard - may be null
Returns:
created tproperty

createTProperty

public TProperty createTProperty(java.lang.String name,
                                 OntClass domain,
                                 java.lang.String rangeTypeURI,
                                 int minCard,
                                 int maxCard)
Description copied from interface: Ontology
Create ontology tproperty

Specified by:
createTProperty in interface Ontology
Parameters:
name - name
domain - may be null
rangeTypeURI - data type URI, may be null
minCard - min.cardinality
maxCard - max.cardinality
Returns:
created tproperty

createTProperty

public TProperty createTProperty(java.lang.String name,
                                 OntClass domain,
                                 java.lang.String rangeTypeURI,
                                 int minCard,
                                 java.lang.Integer maxCard)
Description copied from interface: Ontology
Create ontology tproperty

Specified by:
createTProperty in interface Ontology
Parameters:
name - name
domain - may be null
rangeTypeURI - data type URI, may be null
minCard - min.cardinality
maxCard - max.cardinality, may be null
Returns:
created tproperty

setURI

public void setURI(java.lang.String uri)
Description copied from interface: Ontology
Set new ontology URI

Specified by:
setURI in interface Ontology
Parameters:
uri - new URI

delete

public void delete()
Description copied from interface: Ontology
Delete the ontology. An ontology can be deleted only if it contains no objects, properties, classes and data types. DeleteException is thrown otherwise.

Specified by:
delete in interface Ontology

find

public java.util.Collection<OntObject> find(FindOption option,
                                            java.lang.String... text)
Description copied from interface: Ontology
Find all objects, which tproperty values contains the text. The text can be a part of a value. The search is case-insensitive.

Specified by:
find in interface Ontology
Parameters:
option - find option
text - text to find
Returns:
object collection

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object