org.meta2project.model
Interface Ontology

All Superinterfaces:
AnnotatedEntity
All Known Implementing Classes:
BoxOntology, DBOntology, DebugOntology

public interface Ontology
extends AnnotatedEntity

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
 
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.
 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
 
Methods inherited from interface org.meta2project.model.AnnotatedEntity
getAnnotation, getAnnotationNames, putAnnotation
 

Method Detail

getURI

java.lang.String getURI()
Get ontology URI

Returns:
ontology URI

getType

Type getType(java.lang.String name)
Get the data type by the short name for the ontology.

Parameters:
name - short name
Returns:
type
Throws:
NotFoundException - if the data type was not found

getAllTypes

java.util.Collection<Type> getAllTypes()
Get all data types from the ontology.

Returns:
collection of class Type objects

getOntClass

OntClass getOntClass(java.lang.String name)
Get the class by the short name for the ontology

Parameters:
name - short name
Returns:
class
Throws:
NotFoundException - if the data type was not found

getOntClasses

java.util.Collection<OntClass> getOntClasses()
Get all classes from the ontology.

Returns:
collection of class OntClass objects;

getBasicOntClasses

java.util.Collection<OntClass> getBasicOntClasses()
Get a collections of the ontology classes, which has no super classes.

Returns:
collection of class OntClass objects

getOProperty

OProperty getOProperty(java.lang.String name)
Get the ontology tproperty by the short name.

Parameters:
name - short name
Returns:
оntology oproperty
Throws:
NotFoundException - oproperty was not found

getAllOProperties

java.util.Collection<OProperty> getAllOProperties()
Get all oproperties of the ontology

Returns:
collection class OProperty objects

getTProperty

TProperty getTProperty(java.lang.String name)
Get ontology tproperty by short name

Parameters:
name - short name
Returns:
tproperty
Throws:
NotFoundException - tproperty was not found

getAllTProperties

java.util.Collection<TProperty> getAllTProperties()
Get all tproperties of the ontology

Returns:
collection class TProperty objects

getOntObject

OntObject getOntObject(java.lang.String name)
Get ontology object by the short name.

Parameters:
name - short name
Returns:
ontology object
Throws:
NotFoundException - an object was not found

getAllOntObjects

java.util.Collection<OntObject> getAllOntObjects()
Get all object of the ontology

Returns:
collection class OntObject objects

createType

Type createType(java.lang.String name)
Create ontology data type with specified short name.

Parameters:
name - short name
Returns:
created data type
Throws:
AlreadyExistsException - name already exists

createOntClass

OntClass createOntClass(java.lang.String name,
                        OntClass... parentClasses)
Create ontology class with specified short name.

Parameters:
name - short name
parentClasses - super сlasses of the class
Returns:
created class
Throws:
AlreadyExistsException - name already exists

createOntObject

OntObject createOntObject(java.lang.String name,
                          java.lang.Object... initParams)
Create ontology object with the specified short name.

Parameters:
name - short name
initParams - init params (OntClass objects)
Returns:
created object
Throws:
AlreadyExistsException - name already exists
See Also:
OntClass

createOntObject

OntObject createOntObject(java.lang.Object... initParams)
Create ontology object with an unique surrogate name.

Parameters:
initParams - init params (OntClass objects)
Returns:
created object
See Also:
OntClass

createOProperty

OProperty createOProperty(java.lang.String name,
                          OntClass domain,
                          OntClass range,
                          java.lang.Integer minCard,
                          java.lang.Integer maxCard)
Create ontology oproperty

Parameters:
name - name
domain - may be null
range - may be null
minCard - may be null
maxCard - may be null
Returns:
created oproperty
Throws:
AlreadyExistsException - name already exists

createTProperty

TProperty createTProperty(java.lang.String name,
                          OntClass domain,
                          Type range,
                          java.lang.Integer minCard,
                          java.lang.Integer maxCard)
Create ontology tproperty

Parameters:
name - name
domain - domain, may be null
range - rande, may be null
minCard - may be null
maxCard - may be null
Returns:
created tproperty
Throws:
AlreadyExistsException - name already exists

createTProperty

TProperty createTProperty(java.lang.String name,
                          OntClass domain,
                          java.lang.String rangeTypeURI,
                          int minCard,
                          int maxCard)
Create ontology tproperty

Parameters:
name - name
domain - may be null
rangeTypeURI - data type URI, may be null
minCard - min.cardinality
maxCard - max.cardinality
Returns:
created tproperty
Throws:
AlreadyExistsException - name already exists
NotFoundException - data type was not found by URI

createTProperty

TProperty createTProperty(java.lang.String name,
                          OntClass domain,
                          java.lang.String rangeTypeURI,
                          int minCard,
                          java.lang.Integer maxCard)
Create ontology tproperty

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
Throws:
AlreadyExistsException - name already exists
NotFoundException - data type was not found by URI

setURI

void setURI(java.lang.String uri)
Set new ontology URI

Parameters:
uri - new URI
Throws:
java.lang.Exception - error

delete

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

Throws:
DeleteException - онтология не может быть удалена, поскольку в ней определены какие-то сущности

find

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

Parameters:
text - text to find
option - find option
Returns:
object collection