public class OntologyServiceImplSesame extends Object implements OntologyService
| Modifier and Type | Field and Description |
|---|---|
AbstractOntologyImplSesame |
ontology |
protected SesameManager |
sesameManager |
| Modifier and Type | Method and Description |
|---|---|
void |
addAnnotationProperty(gate.creole.ontology.OURI aPropertyURI)
Creates a new AnnotationProperty.
|
void |
addAnnotationPropertyValue(gate.creole.ontology.ONodeID theResourceURI,
gate.creole.ontology.OURI theAnnotationPropertyURI,
String value,
String language)
Adds a new annotation property value and specifies the language.
|
void |
addClass(gate.creole.ontology.OURI classURI)
The method allows adding a class to repository.
|
void |
addDataTypeProperty(gate.creole.ontology.OURI aPropertyURI,
Set<gate.creole.ontology.OClass> domain,
String dataTypeURI)
The method adds a data type property specifiying domain and range for the
same.
|
void |
addDatatypePropertyValue(gate.creole.ontology.OURI anInstanceURI,
gate.creole.ontology.OURI aDatatypePropertyURI,
gate.creole.ontology.Literal value)
Adds the value for the given Property.
|
void |
addIndividual(String superClassURI,
String individualURI)
The method adds a new instance (literal) into the repository.
|
void |
addObjectProperty(String aPropertyURI,
String[] domainClassesURIs,
String[] rangeClassesTypes)
The method adds an object property specifiying domain and range for the
same.
|
void |
addObjectPropertyValue(gate.creole.ontology.ONodeID sourceInstanceURI,
gate.creole.ontology.OURI anObjectPropertyURI,
gate.creole.ontology.OURI theValueInstanceURI)
Adds the value for the given property (Object, Symmetric and Transitive).
|
void |
addRDFProperty(gate.creole.ontology.OURI aPropertyURI,
Set<gate.creole.ontology.OResource> domain,
Set<gate.creole.ontology.OResource> range)
The method adds a generic property specifiying domain and range for the
same.
|
void |
addRDFPropertyValue(gate.creole.ontology.ONodeID anInstanceURI,
gate.creole.ontology.OURI anRDFPropertyURI,
gate.creole.ontology.ONodeID aResourceURI)
adds the RDF Property value on the specified instance
|
void |
addRestriction(gate.creole.ontology.OBNodeID classURI) |
protected void |
addSerqlQueryResultToCollection(String query,
Collection<String> coll) |
protected void |
addSerqlQueryResultToCollection(String query,
Collection<String> coll,
boolean internIt) |
protected void |
addSerqlQueryResultValuesToCollection(String query,
Collection<org.openrdf.model.Value> coll) |
void |
addSubClass(String superClassURI,
String subClassURI)
The method creates a new class with the URI as specified in className and
adds it as a subClassOf the parentClass.
|
void |
addSubProperty(String superPropertyURI,
String subPropertyURI)
For the given properties, this method registers the super, sub relation
|
void |
addSuperClass(String superClassURI,
String subClassURI)
The method creates a new class with the URI as specified in className and
adds it as a superClassOf the parentClass.
|
void |
addSuperProperty(String superPropertyURI,
String subPropertyURI)
For the given properties, this method registers the super, sub relation
|
void |
addSymmetricProperty(gate.creole.ontology.OURI aPropertyURI,
Set<gate.creole.ontology.OClass> domainAndRangeClasses)
The method adds a symmetric property specifying domain and range for the
same.
|
void |
addTransitiveProperty(String aPropertyURI,
String[] domainClassesURIs,
String[] rangeClassesTypes)
The method adds a transitive property specifiying domain and range for the
same.
|
void |
cleanOntology()
The method removes all data from the ontology, including imports and
the system imports.
|
boolean |
containsURI(gate.creole.ontology.OURI theURI) |
static OntologyServiceImplSesame |
createForRepository(AbstractOntologyImplSesame ontology,
File dataDir,
String configData)
Create an unmanaged repository in the given data directory from the
given configuration data string.
|
static OntologyServiceImplSesame |
createForRepositoryConnection(AbstractOntologyImplSesame ontology,
URL repositoryURL,
String repositoryID)
Connect to the repository with the given repository ID
at the given repository URL location, which could
be either a directory or a sesame server.
|
void |
endTransaction(String repositoryID) |
Property[] |
getAnnotationProperties()
The method returns an array of properties.
|
Property[] |
getAnnotationProperties(String theResourceURI)
Gets the annotation properties set on the specified resource
|
List<gate.creole.ontology.Literal> |
getAnnotationPropertyValues(gate.creole.ontology.ONodeID theResourceURI,
gate.creole.ontology.OURI theAnnotationPropertyURI)
Gets the list of annotation property values
|
Set<gate.creole.ontology.OClass> |
getClasses(boolean topOnly)
if top set to true, the method returns only the top classes (i.e.
|
Set<gate.creole.ontology.OClass> |
getClassesByName(String name) |
gate.util.ClosableIterator<gate.creole.ontology.OClass> |
getClassesIterator(boolean top) |
ResourceInfo[] |
getClassesOfIndividual(String individualURI,
gate.creole.ontology.OConstants.Closure direct)
For the given individual, the method returns a set of classes for which the
individual is registered as instance of
|
byte |
getClassType(String restrictionURI)
This method tells what type of restriction the given uri refers to.
|
org.openrdf.model.URI |
getContextURI() |
String |
getContextURIString() |
String |
getDatatype(gate.creole.ontology.OURI theDatatypePropertyURI)
Returns the datatype uri specified for the given datatype property.
|
Property[] |
getDatatypeProperties()
The method returns an array of properties.
|
Property[] |
getDatatypeProperties(String theResourceURI)
Gets the datatype properties set on the specified resource
|
List<gate.creole.ontology.Literal> |
getDatatypePropertyValues(gate.creole.ontology.OURI anInstanceURI,
gate.creole.ontology.OURI aDatatypePropertyURI)
Gets a list of values for the given Property.
|
boolean |
getDebug() |
String[] |
getDifferentIndividualFrom(String individualURI)
for the given individual, the method returns all individuals registered as
different from the given individual
|
Set<gate.creole.ontology.OResource> |
getDomain(gate.creole.ontology.OURI aPropertyURI)
Given a property, this method returns its domain
|
ResourceInfo[] |
getEquivalentClasses(String aClassURI)
returns an array of classes which are equivalent as the given class
|
Property[] |
getEquivalentPropertyAs(String aPropertyURI)
For the given property, this method returns all properties marked as
Equivalent as it
|
Set<String> |
getImportURIStrings()
From all the data and imports so far loaded, gather the set of
all ontology import URIs.
|
String[] |
getIndividuals(String superClassURI,
gate.creole.ontology.OConstants.Closure direct)
The method returns all member instances of the provided class.
|
Set<gate.creole.ontology.OInstance> |
getInstances(gate.creole.ontology.ONodeID aClass,
gate.creole.ontology.OConstants.Closure closure) |
Set<gate.creole.ontology.OInstance> |
getInstancesByName(String name) |
gate.util.ClosableIterator<gate.creole.ontology.OInstance> |
getInstancesIterator(gate.creole.ontology.ONodeID aClass,
gate.creole.ontology.OConstants.Closure closure) |
Property[] |
getInverseProperties(String aPropertyURI)
for the given property, the method returns all its inverse properties
|
Property[] |
getObjectProperties()
The method returns an array of properties.
|
Property[] |
getObjectProperties(String theResourceURI)
Gets the object properties set on the specified resource
|
List<gate.creole.ontology.OInstance> |
getObjectPropertyValues(gate.creole.ontology.OURI sourceInstanceURI,
gate.creole.ontology.OURI anObjectPropertyURI)
Gets a list of values for the given Property (Object, Symmetric and
Transitive).
|
Property |
getOnPropertyValue(String restrictionURI)
This method given a restriction uri returns the value for the onProperty
element.
|
gate.creole.ontology.OntologyTripleStore |
getOntologyTripleStore() |
Set<gate.creole.ontology.OURI> |
getOntologyURIs() |
Set<gate.creole.ontology.RDFProperty> |
getPropertiesByName(String name) |
Property[] |
getPropertiesWithResourceAsDomain(String theResourceURI)
This method returns a set of all properties where the current resource has
been specified as one of the domain resources.
|
Property[] |
getPropertiesWithResourceAsRange(String theResourceURI)
This method returns a set of all properties where the current resource has
been specified as one of the range resources.
|
Property |
getPropertyFromOntology(String thePropertyURI)
Given a property URI, this method returns an object of Property
|
PropertyValue |
getPropertyValue(String restrictionURI,
byte restrictionType)
Gets the datatype uri specified on the given restriction uri.
|
ResourceInfo[] |
getRange(String aPropertyURI)
Given a property, this method returns its range
|
Set<gate.creole.ontology.RDFProperty> |
getRDFProperties()
The method returns an array of properties.
|
Property[] |
getRDFProperties(String theResourceURI)
Gets the RDF properties set on the specified resource
|
List<gate.creole.ontology.LiteralOrONodeID> |
getRDFPropertyLiteralOrONodeIDs(gate.creole.ontology.ONodeID anInstanceURI,
gate.creole.ontology.OURI anRDFPropertyURI) |
ResourceInfo[] |
getRDFPropertyValues(String anInstanceURI,
String anRDFPropertyURI)
gets the rdf property values for the specified instance.
|
org.openrdf.repository.RepositoryConnection |
getRepositoryConnection() |
gate.creole.ontology.OClass |
getRestrictionForONodeID(gate.creole.ontology.ONodeID node) |
ResourceInfo |
getRestrictionValue(String restrictionURI,
byte restrictionType)
Gets the cardinality value specified on the given restriction uri.
|
String[] |
getSameIndividualAs(String individualURI)
for the given individual, the method returns all individuals which are
registered as same as the provided individual
|
SesameManager |
getSesameManager() |
Set<gate.creole.ontology.OClass> |
getSubClasses(gate.creole.ontology.ONodeID superClassURI,
gate.creole.ontology.OConstants.Closure direct)
This method returns all sub classes of the given class
|
gate.util.ClosableIterator<gate.creole.ontology.OClass> |
getSubClassesIterator(gate.creole.ontology.ONodeID forClass,
gate.creole.ontology.OConstants.Closure closure) |
Property[] |
getSubProperties(String aPropertyURI,
boolean direct)
for the given property, the method returns all its sub properties
|
Property[] |
getSubProperties(String aPropertyURI,
gate.creole.ontology.OConstants.Closure direct)
for the given property, the method returns all its sub properties
|
ResourceInfo[] |
getSuperClasses(String subClassURI,
gate.creole.ontology.OConstants.Closure direct)
This method returns all super classes of the given class
|
Property[] |
getSuperProperties(String aPropertyURI,
boolean direct)
for the given property, the method returns all its super properties
|
Property[] |
getSuperProperties(String aPropertyURI,
gate.creole.ontology.OConstants.Closure direct)
for the given property, the method returns all its super properties
|
Property[] |
getSymmetricProperties()
The method returns an array of properties.
|
Property[] |
getSymmetricProperties(String theResourceURI)
Gets the symmetric properties set on the specified resource
|
Property[] |
getTransitiveProperties()
The method returns an array of properties.
|
Property[] |
getTransitiveProperties(String theResourceURI)
Gets the transitive properties set on the specified resource
|
String |
getVersion()
The method returns the version information of the repository.
|
boolean |
hasClass(gate.creole.ontology.ONodeID classURI)
The method returns if the current repository has a class with URI that
matches with the class parameter.
|
boolean |
hasInstance(gate.creole.ontology.OURI theURI,
gate.creole.ontology.ONodeID theClass,
gate.creole.ontology.OConstants.Closure closure) |
protected boolean |
hasSerqlQueryResultRows(String query) |
boolean |
isAnnotationProperty(gate.creole.ontology.OURI aPropertyURI)
returns if the given property is an Annotation property
|
boolean |
isDatatypeProperty(gate.creole.ontology.OURI aPropertyURI)
returns if the given property is a datatype property
|
boolean |
isDifferentIndividualFrom(gate.creole.ontology.OURI theInstanceURI1,
gate.creole.ontology.OURI theInstanceURI2)
Returns whether the individual1 is different from the individual2.
|
boolean |
isEquivalentClassAs(gate.creole.ontology.ONodeID theClassURI1,
gate.creole.ontology.ONodeID theClassURI2)
Checks whether the two classes defined as same in the ontology.
|
boolean |
isEquivalentPropertyAs(gate.creole.ontology.OURI aPropertyURI1,
gate.creole.ontology.OURI aPropertyURI2)
Checkes whether the two properties are Equivalent.
|
boolean |
isFunctional(gate.creole.ontology.OURI aPropertyURI)
Returns if the provided property is functional
|
boolean |
isIndividual(String individualURI)
tells if the given URI is registered as an individual
|
boolean |
isInverseFunctional(gate.creole.ontology.OURI aPropertyURI)
returns if the given property is inverse functional property
|
boolean |
isObjectProperty(gate.creole.ontology.OURI aPropertyURI)
returns if the given property is an object property
|
boolean |
isRDFProperty(gate.creole.ontology.OURI aPropertyURI)
returns if the given property is an RDF property
|
boolean |
isSameIndividualAs(gate.creole.ontology.OURI theInstanceURI1,
gate.creole.ontology.OURI theInstanceURI2)
Checkes whether the two individuals are same.
|
boolean |
isSubClassOf(String theSuperClassURI,
String theSubClassURI,
gate.creole.ontology.OConstants.Closure direct)
Returns whether the theSubClass is indeed a sub class of the
theSuperClassURI.
|
boolean |
isSubPropertyOf(String aSuperPropertyURI,
String aSubPropertyURI,
gate.creole.ontology.OConstants.Closure direct)
Checkes whether the two properties have a super-sub relation.
|
boolean |
isSuperClassOf(String theSuperClassURI,
String theSubClassURI,
gate.creole.ontology.OConstants.Closure direct)
Returns whether the theSuperClass is indeed a super class of the
theSubClassURI.
|
boolean |
isSuperPropertyOf(String aSuperPropertyURI,
String aSubPropertyURI,
gate.creole.ontology.OConstants.Closure direct)
Checkes whether the two properties have a super-sub relation.
|
boolean |
isSymmetricProperty(gate.creole.ontology.OURI aPropertyURI)
returns if the given property is a symmetric property
|
boolean |
isTopClass(String classURI)
Returns if the given class is a topOnly class.
|
boolean |
isTopProperty(String aPropertyURI)
Returns if the given property is a topOnly property.
|
boolean |
isTransitiveProperty(gate.creole.ontology.OURI aPropertyURI)
returns if the given property is a transitive property
|
void |
loadSystemImport(File selectedFile,
String baseURI,
gate.creole.ontology.OConstants.OntologyFormat ontologyFormat) |
protected UtilTupleQueryIterator |
performSerqlQuery(String serqlQuery) |
void |
readOntologyData(File selectedFile,
String baseURI,
gate.creole.ontology.OConstants.OntologyFormat ontologyFormat,
boolean asImport) |
void |
readOntologyData(InputStream is,
String baseURI,
gate.creole.ontology.OConstants.OntologyFormat ontologyFormat,
boolean asImport) |
void |
readOntologyData(Reader ir,
String baseURI,
gate.creole.ontology.OConstants.OntologyFormat ontologyFormat,
boolean asImport) |
void |
removeAnnotationPropertyValue(gate.creole.ontology.ONodeID theResourceURI,
gate.creole.ontology.OURI theAnnotationPropertyURI,
gate.creole.ontology.Literal value)
For the current resource, the method removes the given literal for the
given property.
|
void |
removeAnnotationPropertyValues(gate.creole.ontology.ONodeID theResourceURI,
gate.creole.ontology.OURI theAnnotationPropertyURI)
Removes all values for a named property.
|
String[] |
removeClass(String classURI,
boolean removeSubTree)
Given a class to delete, it removes it from the repository.
|
void |
removeDatatypePropertyValue(gate.creole.ontology.OURI anInstanceURI,
gate.creole.ontology.OURI aDatatypePropertyURI,
gate.creole.ontology.Literal value)
Removes the provided value for the given instance.
|
void |
removeDatatypePropertyValues(gate.creole.ontology.ONodeID anInstanceURI,
gate.creole.ontology.OURI aDatatypePropertyURI)
Removes all property values set on the provided instance for the current
property.
|
String[] |
removeIndividual(String individualURI)
The method removes the provided instance from the repository.
|
void |
removeObjectPropertyValue(gate.creole.ontology.OURI sourceInstanceURI,
gate.creole.ontology.OURI anObjectPropertyURI,
gate.creole.ontology.OURI theValueInstanceURI)
Remove the provided value for the given property (Object, Symmetric and
Transitive).
|
void |
removeObjectPropertyValues(gate.creole.ontology.OURI sourceInstanceURI,
gate.creole.ontology.OURI anObjectPropertyURI)
Removes all property values set for the current property (Object, Symmetric
and Transitive).
|
String[] |
removePropertyFromOntology(String aPropertyURI,
boolean removeSubTree)
Removes the given property
|
void |
removeRDFPropertyValue(gate.creole.ontology.ONodeID anInstanceURI,
gate.creole.ontology.OURI anRDFPropertyURI,
gate.creole.ontology.ONodeID aResourceURI)
Removes the specified RDF Property Value
|
void |
removeRDFPropertyValues(String anInstanceURI,
String anRDFPropertyURI)
Removes all the RDF Property values from the given instance.
|
void |
removeSubClass(String superClassURI,
String subClassURI)
Removes the subclass relationship
|
void |
removeSubProperty(String superPropertyURI,
String subPropertyURI)
For the given properties, this method removes the super, sub relation
|
void |
removeSuperClass(String superClassURI,
String subClassURI)
Removes the superclass relationship
|
void |
removeSuperProperty(String superPropertyURI,
String subPropertyURI)
For the given properties, this method removes the super, sub relation
|
void |
setContextURIString(String uriString) |
void |
setDebug(boolean debug) |
void |
setDifferentIndividualFrom(gate.creole.ontology.ONodeID individual1URI,
gate.creole.ontology.ONodeID individual2URI)
individual1 is sets as different individual from individual2
|
void |
setEquivalentClassAs(gate.creole.ontology.ONodeID class1URI,
gate.creole.ontology.ONodeID class2URI)
Sets the classes as same classes
|
void |
setEquivalentPropertyAs(String property1URI,
String property2URI)
Sets two properties as same
|
void |
setFunctional(String aPropertyURI,
boolean isFunctional)
sets the current property as functional
|
void |
setInverseFunctional(String aPropertyURI,
boolean isInverseFunctional)
Sets the current property as inverse functional property
|
void |
setInverseOf(String propertyURI1,
String propertyURI2)
property1 is set as inverse of property 2
|
void |
setOnPropertyValue(gate.creole.ontology.ONodeID restrictionURI,
gate.creole.ontology.OURI propertyURI)
This method sets the value for onProperty element on the given restriction.
|
void |
setOntologyURI(gate.creole.ontology.OURI theURI) |
void |
setPropertyValue(String restrictionURI,
byte restrictionType,
String value,
String datatypeURI)
Sets the datatype uri for the given restriction uri.
|
void |
setRestrictionValue(gate.creole.ontology.ONodeID restrictionURI,
gate.creole.ontology.OURI restrictionTypeURI,
gate.creole.ontology.Literal value) |
void |
setRestrictionValue(gate.creole.ontology.ONodeID restrictionURI,
gate.creole.ontology.OURI restrictionTypeURI,
gate.creole.ontology.ONodeID value)
Sets the cardinality value for the given restriction uri.
|
void |
setSameIndividualAs(String individual1URI,
String individual2URI)
individual1 is set as same as the individual2
|
void |
shutdown()
Shutdown the repository.
|
void |
startTransaction(String repositoryID) |
void |
writeOntologyData(OutputStream out,
gate.creole.ontology.OConstants.OntologyFormat ontologyFormat,
boolean includeImports) |
void |
writeOntologyData(Writer out,
gate.creole.ontology.OConstants.OntologyFormat ontologyFormat,
boolean includeImports) |
protected SesameManager sesameManager
public final AbstractOntologyImplSesame ontology
public void setContextURIString(String uriString)
public String getContextURIString()
public org.openrdf.model.URI getContextURI()
public static OntologyServiceImplSesame createForRepository(AbstractOntologyImplSesame ontology, File dataDir, String configData)
dataDir - configData - public static OntologyServiceImplSesame createForRepositoryConnection(AbstractOntologyImplSesame ontology, URL repositoryURL, String repositoryID)
ontology - repositoryURL - repositoryID - public void shutdown()
shutdown in interface OntologyServicepublic gate.creole.ontology.OntologyTripleStore getOntologyTripleStore()
getOntologyTripleStore in interface OntologyServicepublic SesameManager getSesameManager()
public void readOntologyData(File selectedFile, String baseURI, gate.creole.ontology.OConstants.OntologyFormat ontologyFormat, boolean asImport)
public void readOntologyData(InputStream is, String baseURI, gate.creole.ontology.OConstants.OntologyFormat ontologyFormat, boolean asImport)
public void readOntologyData(Reader ir, String baseURI, gate.creole.ontology.OConstants.OntologyFormat ontologyFormat, boolean asImport)
public void writeOntologyData(Writer out, gate.creole.ontology.OConstants.OntologyFormat ontologyFormat, boolean includeImports)
public void writeOntologyData(OutputStream out, gate.creole.ontology.OConstants.OntologyFormat ontologyFormat, boolean includeImports)
public void loadSystemImport(File selectedFile, String baseURI, gate.creole.ontology.OConstants.OntologyFormat ontologyFormat)
public void cleanOntology()
throws gate.creole.ontology.GateOntologyException
cleanOntology in interface OntologyServicegate.creole.ontology.GateOntologyExceptionpublic Set<String> getImportURIStrings()
getImportURIStrings in interface OntologyServicepublic Set<gate.creole.ontology.OURI> getOntologyURIs()
getOntologyURIs in interface OntologyServicepublic String getVersion() throws gate.creole.ontology.GateOntologyException
getVersion in interface OntologyServicegate.creole.ontology.GateOntologyExceptionpublic void setOntologyURI(gate.creole.ontology.OURI theURI)
setOntologyURI in interface OntologyServicepublic void addClass(gate.creole.ontology.OURI classURI)
addClass in interface OntologyServiceclassURI - public void addRestriction(gate.creole.ontology.OBNodeID classURI)
addRestriction in interface OntologyServicepublic String[] removeClass(String classURI, boolean removeSubTree) throws gate.creole.ontology.GateOntologyException
removeClass in interface OntologyServiceclassURI - removeSubTree - - if set to true, removes all its subclasses and instances as
well, otherwise shifts all subclasses and instances to its parent
nodegate.creole.ontology.GateOntologyExceptionpublic boolean hasClass(gate.creole.ontology.ONodeID classURI)
hasClass in interface OntologyServiceclassURI - public boolean containsURI(gate.creole.ontology.OURI theURI)
containsURI in interface OntologyServicepublic Set<gate.creole.ontology.OClass> getClasses(boolean topOnly)
OntologyServicegetClasses in interface OntologyServicepublic gate.util.ClosableIterator<gate.creole.ontology.OClass> getClassesIterator(boolean top)
getClassesIterator in interface OntologyServicepublic Set<gate.creole.ontology.OClass> getClassesByName(String name)
getClassesByName in interface OntologyServicepublic boolean isTopClass(String classURI)
isTopClass in interface OntologyServiceclassURI - public boolean isSuperClassOf(String theSuperClassURI, String theSubClassURI, gate.creole.ontology.OConstants.Closure direct)
isSuperClassOf in interface OntologyServicetheSuperClassURI - theSubClassURI - direct - protected void addSerqlQueryResultToCollection(String query, Collection<String> coll)
protected void addSerqlQueryResultToCollection(String query, Collection<String> coll, boolean internIt)
protected void addSerqlQueryResultValuesToCollection(String query, Collection<org.openrdf.model.Value> coll)
protected boolean hasSerqlQueryResultRows(String query)
protected UtilTupleQueryIterator performSerqlQuery(String serqlQuery)
public boolean isSubClassOf(String theSuperClassURI, String theSubClassURI, gate.creole.ontology.OConstants.Closure direct)
isSubClassOf in interface OntologyServicetheSuperClassURI - theSubClassURI - direct - public Property getPropertyFromOntology(String thePropertyURI)
getPropertyFromOntology in interface OntologyServicerepositoryID - thePropertyURI - gate.creole.ontology.GateOntologyExceptionpublic boolean isEquivalentClassAs(gate.creole.ontology.ONodeID theClassURI1,
gate.creole.ontology.ONodeID theClassURI2)
isEquivalentClassAs in interface OntologyServicetheClassURI1 - theClassURI2 - Exceptionpublic void addAnnotationProperty(gate.creole.ontology.OURI aPropertyURI)
throws gate.creole.ontology.GateOntologyException
addAnnotationProperty in interface OntologyServiceaPropertyURI - URI of the property to be added into the ontology. Donegate.creole.ontology.GateOntologyExceptionpublic Property[] getPropertiesWithResourceAsDomain(String theResourceURI)
getPropertiesWithResourceAsDomain in interface OntologyServicetheResourceURI - public Property[] getPropertiesWithResourceAsRange(String theResourceURI)
getPropertiesWithResourceAsRange in interface OntologyServicepublic Property[] getAnnotationProperties(String theResourceURI)
getAnnotationProperties in interface OntologyServicetheResourceURI - public Property[] getRDFProperties(String theResourceURI)
getRDFProperties in interface OntologyServicetheResourceURI - public Property[] getDatatypeProperties(String theResourceURI)
getDatatypeProperties in interface OntologyServicetheResourceURI - public Property[] getObjectProperties(String theResourceURI)
getObjectProperties in interface OntologyServicetheResourceURI - public Property[] getTransitiveProperties(String theResourceURI)
getTransitiveProperties in interface OntologyServicetheResourceURI - public Property[] getSymmetricProperties(String theResourceURI)
getSymmetricProperties in interface OntologyServicetheResourceURI - public boolean isAnnotationProperty(gate.creole.ontology.OURI aPropertyURI)
isAnnotationProperty in interface OntologyServiceaPropertyURI - public void addAnnotationPropertyValue(gate.creole.ontology.ONodeID theResourceURI,
gate.creole.ontology.OURI theAnnotationPropertyURI,
String value,
String language)
addAnnotationPropertyValue in interface OntologyServicevalue - the value containing some valuepublic List<gate.creole.ontology.Literal> getAnnotationPropertyValues(gate.creole.ontology.ONodeID theResourceURI, gate.creole.ontology.OURI theAnnotationPropertyURI)
getAnnotationPropertyValues in interface OntologyServicetheResourceURI - theAnnotationPropertyURI - public void removeAnnotationPropertyValue(gate.creole.ontology.ONodeID theResourceURI,
gate.creole.ontology.OURI theAnnotationPropertyURI,
gate.creole.ontology.Literal value)
removeAnnotationPropertyValue in interface OntologyServicetheResourceURI - theAnnotationPropertyURI - value - language - public void removeAnnotationPropertyValues(gate.creole.ontology.ONodeID theResourceURI,
gate.creole.ontology.OURI theAnnotationPropertyURI)
removeAnnotationPropertyValues in interface OntologyServicetheResourceURI - theAnnotationPropertyURI - public void addRDFProperty(gate.creole.ontology.OURI aPropertyURI,
Set<gate.creole.ontology.OResource> domain,
Set<gate.creole.ontology.OResource> range)
throws gate.creole.ontology.GateOntologyException
addRDFProperty in interface OntologyServiceaPropertyURI - domainClassesURIs - rangeClassesTypes - Donegate.creole.ontology.GateOntologyExceptionpublic boolean isRDFProperty(gate.creole.ontology.OURI aPropertyURI)
isRDFProperty in interface OntologyServiceaPropertyURI - public void addDataTypeProperty(gate.creole.ontology.OURI aPropertyURI,
Set<gate.creole.ontology.OClass> domain,
String dataTypeURI)
addDataTypeProperty in interface OntologyServiceaPropertyURI - domainClassesURIs - dataTypeURI - Donepublic String getDatatype(gate.creole.ontology.OURI theDatatypePropertyURI)
Note: this will return the first datatype URI found and ignore all others if there are more than one.
getDatatype in interface OntologyServicetheDatatypePropertyURI - gate.creole.ontology.GateOntologyExceptionpublic void addSymmetricProperty(gate.creole.ontology.OURI aPropertyURI,
Set<gate.creole.ontology.OClass> domainAndRangeClasses)
addSymmetricProperty in interface OntologyServiceaPropertyURI - domainAndRangeClasses - public boolean isEquivalentPropertyAs(gate.creole.ontology.OURI aPropertyURI1,
gate.creole.ontology.OURI aPropertyURI2)
isEquivalentPropertyAs in interface OntologyServiceaPropertyURI - gate.creole.ontology.GateOntologyExceptionpublic Property[] getSuperProperties(String aPropertyURI, gate.creole.ontology.OConstants.Closure direct)
getSuperProperties in interface OntologyServiceaPropertyURI - direct - public Property[] getSubProperties(String aPropertyURI, gate.creole.ontology.OConstants.Closure direct)
getSubProperties in interface OntologyServiceaPropertyURI - direct - public boolean isSuperPropertyOf(String aSuperPropertyURI, String aSubPropertyURI, gate.creole.ontology.OConstants.Closure direct)
isSuperPropertyOf in interface OntologyServiceaSuperPropertyURI - aSubPropertyURI - direct - public boolean isSubPropertyOf(String aSuperPropertyURI, String aSubPropertyURI, gate.creole.ontology.OConstants.Closure direct)
isSubPropertyOf in interface OntologyServiceaSuperPropertyURI - aSubPropertyURI - direct - public boolean isDifferentIndividualFrom(gate.creole.ontology.OURI theInstanceURI1,
gate.creole.ontology.OURI theInstanceURI2)
isDifferentIndividualFrom in interface OntologyServicetheInstanceURI1 - theInstanceURI2 - public boolean isSameIndividualAs(gate.creole.ontology.OURI theInstanceURI1,
gate.creole.ontology.OURI theInstanceURI2)
isSameIndividualAs in interface OntologyServiceindividualURI1 - invidualURI2 - public void addRDFPropertyValue(gate.creole.ontology.ONodeID anInstanceURI,
gate.creole.ontology.OURI anRDFPropertyURI,
gate.creole.ontology.ONodeID aResourceURI)
addRDFPropertyValue in interface OntologyServiceanInstanceURI - anRDFPropertyURI - aResourceURI - public void removeRDFPropertyValue(gate.creole.ontology.ONodeID anInstanceURI,
gate.creole.ontology.OURI anRDFPropertyURI,
gate.creole.ontology.ONodeID aResourceURI)
removeRDFPropertyValue in interface OntologyServiceanInstanceURI - anRDFPropertyURI - aResourceURI - public ResourceInfo[] getRDFPropertyValues(String anInstanceURI, String anRDFPropertyURI)
getRDFPropertyValues in interface OntologyServiceanInstanceURI - anRDFPropertyURI - public List<gate.creole.ontology.LiteralOrONodeID> getRDFPropertyLiteralOrONodeIDs(gate.creole.ontology.ONodeID anInstanceURI, gate.creole.ontology.OURI anRDFPropertyURI)
getRDFPropertyLiteralOrONodeIDs in interface OntologyServicepublic void removeRDFPropertyValues(String anInstanceURI, String anRDFPropertyURI)
removeRDFPropertyValues in interface OntologyServiceanInstanceURI - anRDFPropertyURI - public void addDatatypePropertyValue(gate.creole.ontology.OURI anInstanceURI,
gate.creole.ontology.OURI aDatatypePropertyURI,
gate.creole.ontology.Literal value)
addDatatypePropertyValue in interface OntologyServiceanInstanceURI - aDatatypePropertyURI - datatypeURI - value - public void removeDatatypePropertyValue(gate.creole.ontology.OURI anInstanceURI,
gate.creole.ontology.OURI aDatatypePropertyURI,
gate.creole.ontology.Literal value)
removeDatatypePropertyValue in interface OntologyServiceanInstanceURI - aDatatypePropertyURI - datatypeURI - value - public List<gate.creole.ontology.Literal> getDatatypePropertyValues(gate.creole.ontology.OURI anInstanceURI, gate.creole.ontology.OURI aDatatypePropertyURI)
getDatatypePropertyValues in interface OntologyServiceanInstanceURI - aDatatypePropertyURI - public void removeDatatypePropertyValues(gate.creole.ontology.ONodeID anInstanceURI,
gate.creole.ontology.OURI aDatatypePropertyURI)
removeDatatypePropertyValues in interface OntologyServiceanInstanceURI - aDatatypePropertyURI - public void addObjectPropertyValue(gate.creole.ontology.ONodeID sourceInstanceURI,
gate.creole.ontology.OURI anObjectPropertyURI,
gate.creole.ontology.OURI theValueInstanceURI)
addObjectPropertyValue in interface OntologyServicesourceInstanceURI - anObjectPropertyURI - theValueInstanceURI - public void removeObjectPropertyValue(gate.creole.ontology.OURI sourceInstanceURI,
gate.creole.ontology.OURI anObjectPropertyURI,
gate.creole.ontology.OURI theValueInstanceURI)
removeObjectPropertyValue in interface OntologyServicesourceInstanceURI - anObjectPropertyURI - theValueInstanceURI - public List<gate.creole.ontology.OInstance> getObjectPropertyValues(gate.creole.ontology.OURI sourceInstanceURI, gate.creole.ontology.OURI anObjectPropertyURI)
getObjectPropertyValues in interface OntologyServicesourceInstanceURI - anObjectPropertyURI - public void removeObjectPropertyValues(gate.creole.ontology.OURI sourceInstanceURI,
gate.creole.ontology.OURI anObjectPropertyURI)
removeObjectPropertyValues in interface OntologyServicesourceInstanceURI - anObjectPropertyURI - public boolean isTopProperty(String aPropertyURI)
classURI - public void addSubClass(String superClassURI, String subClassURI)
addSubClass in interface OntologyServicesuperClassURI - subClassURI - public void addSuperClass(String superClassURI, String subClassURI)
addSuperClass in interface OntologyServicesuperClassURI - subClassURI - public void removeSubClass(String superClassURI, String subClassURI)
removeSubClass in interface OntologyServicesuperClassURI - subClassURI - public void removeSuperClass(String superClassURI, String subClassURI)
removeSuperClass in interface OntologyServicesuperClassURI - subClassURI - public gate.util.ClosableIterator<gate.creole.ontology.OClass> getSubClassesIterator(gate.creole.ontology.ONodeID forClass,
gate.creole.ontology.OConstants.Closure closure)
getSubClassesIterator in interface OntologyServicepublic Set<gate.creole.ontology.OClass> getSubClasses(gate.creole.ontology.ONodeID superClassURI, gate.creole.ontology.OConstants.Closure direct)
OntologyServicegetSubClasses in interface OntologyServicepublic gate.creole.ontology.OClass getRestrictionForONodeID(gate.creole.ontology.ONodeID node)
public ResourceInfo[] getSuperClasses(String subClassURI, gate.creole.ontology.OConstants.Closure direct) throws gate.creole.ontology.GateOntologyException
getSuperClasses in interface OntologyServicesubClassURI - direct - gate.creole.ontology.GateOntologyExceptionpublic void setEquivalentClassAs(gate.creole.ontology.ONodeID class1URI,
gate.creole.ontology.ONodeID class2URI)
setEquivalentClassAs in interface OntologyServiceclass1URI - class2URI - public ResourceInfo[] getEquivalentClasses(String aClassURI)
getEquivalentClasses in interface OntologyServiceaClassURI - public String[] removePropertyFromOntology(String aPropertyURI, boolean removeSubTree)
removePropertyFromOntology in interface OntologyServiceaPropertyURI - removeSubTree - - if set to true, removes all its subproperties, otherwise shifts
subproperties to its parent propertypublic void addObjectProperty(String aPropertyURI, String[] domainClassesURIs, String[] rangeClassesTypes)
addObjectProperty in interface OntologyServiceaPropertyURI - domainClassesURIs - rangeClassesTypes - public void addTransitiveProperty(String aPropertyURI, String[] domainClassesURIs, String[] rangeClassesTypes)
addTransitiveProperty in interface OntologyServiceaPropertyURI - domainClassesURIs - rangeClassesTypes - public Set<gate.creole.ontology.RDFProperty> getRDFProperties()
getRDFProperties in interface OntologyServicepublic Property[] getObjectProperties()
getObjectProperties in interface OntologyServicepublic Property[] getSymmetricProperties()
getSymmetricProperties in interface OntologyServicepublic Property[] getTransitiveProperties()
getTransitiveProperties in interface OntologyServicepublic Property[] getDatatypeProperties()
getDatatypeProperties in interface OntologyServicepublic Property[] getAnnotationProperties()
getAnnotationProperties in interface OntologyServicepublic Set<gate.creole.ontology.RDFProperty> getPropertiesByName(String name)
getPropertiesByName in interface OntologyServicepublic Set<gate.creole.ontology.OResource> getDomain(gate.creole.ontology.OURI aPropertyURI)
getDomain in interface OntologyServiceaPropertyURI - public ResourceInfo[] getRange(String aPropertyURI)
getRange in interface OntologyServiceaPropertyURI - public boolean isFunctional(gate.creole.ontology.OURI aPropertyURI)
isFunctional in interface OntologyServiceaPropertyURI - public void setFunctional(String aPropertyURI, boolean isFunctional)
setFunctional in interface OntologyServiceaPropertyURI - isFunctional - public boolean isInverseFunctional(gate.creole.ontology.OURI aPropertyURI)
isInverseFunctional in interface OntologyServiceaPropertyURI - public void setInverseFunctional(String aPropertyURI, boolean isInverseFunctional)
setInverseFunctional in interface OntologyServiceaPropertyURI - isInverseFunctional - public boolean isSymmetricProperty(gate.creole.ontology.OURI aPropertyURI)
isSymmetricProperty in interface OntologyServiceaPropertyURI - public boolean isTransitiveProperty(gate.creole.ontology.OURI aPropertyURI)
isTransitiveProperty in interface OntologyServiceaPropertyURI - public boolean isDatatypeProperty(gate.creole.ontology.OURI aPropertyURI)
isDatatypeProperty in interface OntologyServiceaPropertyURI - public boolean isObjectProperty(gate.creole.ontology.OURI aPropertyURI)
isObjectProperty in interface OntologyServiceaPropertyURI - public void setEquivalentPropertyAs(String property1URI, String property2URI)
setEquivalentPropertyAs in interface OntologyServiceproperty1URI - property2URI - public Property[] getEquivalentPropertyAs(String aPropertyURI)
getEquivalentPropertyAs in interface OntologyServiceaPropertyURI - public void addSuperProperty(String superPropertyURI, String subPropertyURI)
addSuperProperty in interface OntologyServicesuperPropertyURI - subPropertyURI - public void removeSuperProperty(String superPropertyURI, String subPropertyURI)
removeSuperProperty in interface OntologyServicesuperPropertyURI - subPropertyURI - public void addSubProperty(String superPropertyURI, String subPropertyURI)
addSubProperty in interface OntologyServicesuperPropertyURI - subPropertyURI - public void removeSubProperty(String superPropertyURI, String subPropertyURI)
removeSubProperty in interface OntologyServicesuperPropertyURI - subPropertyURI - public Property[] getSuperProperties(String aPropertyURI, boolean direct)
getSuperProperties in interface OntologyServiceaPropertyURI - direct - public Property[] getSubProperties(String aPropertyURI, boolean direct)
getSubProperties in interface OntologyServiceaPropertyURI - direct - public Property[] getInverseProperties(String aPropertyURI)
getInverseProperties in interface OntologyServiceaPropertyURI - public void setInverseOf(String propertyURI1, String propertyURI2)
setInverseOf in interface OntologyServicepropertyURI1 - propertyURI2 - public void addIndividual(String superClassURI, String individualURI)
addIndividual in interface OntologyServicesuperClassURI - individualURI - public String[] removeIndividual(String individualURI)
removeIndividual in interface OntologyServiceindividual - public String[] getIndividuals(String superClassURI, gate.creole.ontology.OConstants.Closure direct)
superClassURI - direct - public gate.util.ClosableIterator<gate.creole.ontology.OInstance> getInstancesIterator(gate.creole.ontology.ONodeID aClass,
gate.creole.ontology.OConstants.Closure closure)
getInstancesIterator in interface OntologyServicepublic Set<gate.creole.ontology.OInstance> getInstances(gate.creole.ontology.ONodeID aClass, gate.creole.ontology.OConstants.Closure closure)
public Set<gate.creole.ontology.OInstance> getInstancesByName(String name)
getInstancesByName in interface OntologyServicepublic boolean hasInstance(gate.creole.ontology.OURI theURI,
gate.creole.ontology.ONodeID theClass,
gate.creole.ontology.OConstants.Closure closure)
hasInstance in interface OntologyServicepublic ResourceInfo[] getClassesOfIndividual(String individualURI, gate.creole.ontology.OConstants.Closure direct) throws gate.creole.ontology.GateOntologyException
getClassesOfIndividual in interface OntologyServiceindividualURI - gate.creole.ontology.GateOntologyExceptionpublic void setDifferentIndividualFrom(gate.creole.ontology.ONodeID individual1URI,
gate.creole.ontology.ONodeID individual2URI)
throws gate.creole.ontology.GateOntologyException
setDifferentIndividualFrom in interface OntologyServiceindividual1URI - individual2URI - gate.creole.ontology.GateOntologyExceptionpublic String[] getDifferentIndividualFrom(String individualURI) throws gate.creole.ontology.GateOntologyException
getDifferentIndividualFrom in interface OntologyServiceindividualURI - gate.creole.ontology.GateOntologyExceptionpublic void setSameIndividualAs(String individual1URI, String individual2URI) throws gate.creole.ontology.GateOntologyException
setSameIndividualAs in interface OntologyServiceindividual1URI - individual2URI - gate.creole.ontology.GateOntologyExceptionpublic String[] getSameIndividualAs(String individualURI)
getSameIndividualAs in interface OntologyServiceinidividualURI - public Property getOnPropertyValue(String restrictionURI)
getOnPropertyValue in interface OntologyServicerestrictionURI - gate.creole.ontology.GateOntologyExceptionpublic void setOnPropertyValue(gate.creole.ontology.ONodeID restrictionURI,
gate.creole.ontology.OURI propertyURI)
setOnPropertyValue in interface OntologyServicerepositoryId - restrictionURI - propertyURI - gate.creole.ontology.GateOntologyExceptionpublic PropertyValue getPropertyValue(String restrictionURI, byte restrictionType)
getPropertyValue in interface OntologyServicerepositoryID - restrictionURI - gate.creole.ontology.GateOntologyExceptionpublic void setPropertyValue(String restrictionURI, byte restrictionType, String value, String datatypeURI)
setPropertyValue in interface OntologyServicerestrictionURI - datatypeURI - public ResourceInfo getRestrictionValue(String restrictionURI, byte restrictionType)
getRestrictionValue in interface OntologyServicerestrictionURI - restrictionType - - either of the following constants from the OConstants -
ALL_VALUES_FROM_RESTRICTION, SOME_VALUES_FROM_RESTRICTION, and
HAS_VALUE_RESTRICTIONpublic boolean isIndividual(String individualURI)
individualURI - public void setRestrictionValue(gate.creole.ontology.ONodeID restrictionURI,
gate.creole.ontology.OURI restrictionTypeURI,
gate.creole.ontology.ONodeID value)
setRestrictionValue in interface OntologyServicerestrictionURI - restrictionType - - either of the following constants from the OConstants -
ALL_VALUES_FROM_RESTRICTION, SOME_VALUES_FROM_RESTRICTION, and
HAS_VALUE_RESTRICTIONvalue - public void setRestrictionValue(gate.creole.ontology.ONodeID restrictionURI,
gate.creole.ontology.OURI restrictionTypeURI,
gate.creole.ontology.Literal value)
setRestrictionValue in interface OntologyServicepublic byte getClassType(String restrictionURI)
getClassType in interface OntologyServicerestrictionURI - public void startTransaction(String repositoryID)
public void endTransaction(String repositoryID) throws gate.creole.ontology.GateOntologyException
gate.creole.ontology.GateOntologyExceptionpublic org.openrdf.repository.RepositoryConnection getRepositoryConnection()
public void setDebug(boolean debug)
public boolean getDebug()