org.ontobox.box.box2model
Class BoxOntology

java.lang.Object
  extended by org.ontobox.box.box2model.BoxOntology
All Implemented Interfaces:
AnnotatedEntity, Ontology

public class BoxOntology
extends java.lang.Object
implements Ontology

Author:
Anton Malykh

Field Summary
protected  BoxConnection con
           
protected  int id
           
 
Fields inherited from interface org.meta2project.model.AnnotatedEntity
CASCADE, CASCADE_DELETE_VALUE, COMMENT, MAX_CARD, MIN_CARD, MODEL_URI, TITLE
 
Constructor Summary
BoxOntology(BoxConnection con, int id)
           
 
Method Summary
protected  OntObject createObjectByFullName(java.lang.String fullName, java.lang.Object... initParams)
           
 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.lang.String getAnnotation(java.lang.String name)
          Get annotation value by this name.
 java.util.List<java.lang.String> getAnnotationNames()
          Get annotation names for this entity.
 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
 int hashCode()
           
 void putAnnotation(java.lang.String name, java.lang.String value)
          Put annotation value.
 void setURI(java.lang.String newuri)
          Set new ontology URI
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

con

protected final BoxConnection con

id

protected final int id
Constructor Detail

BoxOntology

public BoxOntology(BoxConnection con,
                   int id)
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

createObjectByFullName

protected OntObject createObjectByFullName(java.lang.String fullName,
                                           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 newuri)
Description copied from interface: Ontology
Set new ontology URI

Specified by:
setURI in interface Ontology
Parameters:
newuri - 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

getAnnotationNames

public java.util.List<java.lang.String> getAnnotationNames()
Description copied from interface: AnnotatedEntity
Get annotation names for this entity.

Specified by:
getAnnotationNames in interface AnnotatedEntity
Returns:
name list (in ascending order)

getAnnotation

public java.lang.String getAnnotation(java.lang.String name)
Description copied from interface: AnnotatedEntity
Get annotation value by this name.

Specified by:
getAnnotation in interface AnnotatedEntity
Parameters:
name - annotation name
Returns:
annotation value; null if there is no value for this name

putAnnotation

public void putAnnotation(java.lang.String name,
                          java.lang.String value)
Description copied from interface: AnnotatedEntity
Put annotation value.

Specified by:
putAnnotation in interface AnnotatedEntity
Parameters:
name - annotation name
value - annotation value; value will be removed if null

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

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