public interface Ontology extends LanguageResource
Factory.createResource
method.
See the documentation for the implementing plugins for details on
how to create ontology language resources programmatically.
Unless stated otherwise, this documentation describes
the behavior of the methods as implemented in the
ontology API implementation plugin,
Ontology
The backwards-compatibility plugin
Ontology_OWLIM2
implements all of the deprecated methods and classes but none of the
new methods that were added to the API in version 5.1. Some but not all depracated
methods are also implemented in the new plugin Ontology
The use of deprecated methods should be avoided and replaced by
other methods as soon as possible as the backwards-compatibility
plugin may get removed in the future and deprecated methods may
get removed from the API.Modifier and Type | Method and Description |
---|---|
AllValuesFromRestriction |
addAllValuesFromRestriction(ObjectProperty onProperty,
OClass theClass) |
AllValuesFromRestriction |
addAllValuesFromRestriction(RDFProperty onProperty,
OResource hasValue)
Deprecated.
- this method is deprecated and kept for backwards compatibility
as long as the OntologyOWLIM2 plugin is kept. Use the method
addAllValuesFromRestriction(ObjectProperty, OClass) instead. |
AnnotationProperty |
addAnnotationProperty(OURI aPropertyURI)
Creates a new AnnotationProperty.
|
AnonymousClass |
addAnonymousClass() |
CardinalityRestriction |
addCardinalityRestriction(RDFProperty onProperty,
String cardinalityValue)
Adds a new Cardinality Restriction to the ontology.
|
DatatypeProperty |
addDatatypeProperty(OURI aPropertyURI,
Set<OClass> domain,
DataType aDatatype)
Create a DatatypeProperty with the given domain and range.
|
HasValueRestriction |
addHasValueRestriction(RDFProperty onProperty,
OResource hasValue)
Adds a new HasValue Restriction to the ontology.
|
MaxCardinalityRestriction |
addMaxCardinalityRestriction(RDFProperty onProperty,
String maxCardinalityValue)
Adds a new MaxCardinality Restriction to the ontology.
|
MinCardinalityRestriction |
addMinCardinalityRestriction(RDFProperty onProperty,
String minCardinalityValue)
Adds a new MinCardinality Restriction to the ontology.
|
ObjectProperty |
addObjectProperty(OURI aPropertyURI,
Set<OClass> domain,
Set<OClass> range)
Creates a new object property (a property that takes instances as
values).
|
OClass |
addOClass(OURI aURI)
Creates a new OWL Class and adds it the ontology.
|
OClass |
addOClass(OURI aURI,
byte classType)
Deprecated.
- use one of the dedicated methods to add a named class
or a restriction instead
|
OInstance |
addOInstance(OURI theInstanceURI,
OClass theClass)
Creates a new OInstance and returns it.
|
void |
addOntologyModificationListener(OntologyModificationListener oml)
Register the Ontology Modification Listeners
|
void |
addOResourceToMap(String uri,
OResource resource)
Deprecated.
|
RDFProperty |
addRDFProperty(OURI aPropertyURI,
Set<OResource> domain,
Set<OResource> range)
Deprecated.
|
SomeValuesFromRestriction |
addSomeValuesFromRestriction(RDFProperty onProperty,
OResource hasValue)
Adds a new AllValuesFrom Restriction to the ontology.
|
SymmetricProperty |
addSymmetricProperty(OURI aPropertyURI,
Set<OClass> domainAndRange)
Creates a new symmetric property (an object property that is
symmetric).
|
TransitiveProperty |
addTransitiveProperty(OURI aPropertyURI,
Set<OClass> domain,
Set<OClass> range)
Creates a new transitive property (an object property that is
transitive).
|
void |
cleanOntology()
This method removes the entire data from the ontology and emptys
it.
|
void |
commitTransaction()
Deprecated.
|
boolean |
containsOClass(OClass theClass)
Checks whether the ontology contains this class.
|
boolean |
containsOClass(ONodeID theURI)
Checks whether a class with the specified URI or blank node ID
exists in the ontology.
|
boolean |
containsOInstance(OInstance theInstance)
Checks whether the provided Instance exists in the ontology.
|
boolean |
containsOInstance(OURI theInstanceURI)
Checks whether the provided URI refers to an Instance that exists
in the ontology.
|
OntologyBooleanQuery |
createBooleanQuery(String theQuery,
OConstants.QueryLanguage queryLanguage)
This method creates a OntologyBooleanQuery object and passes on the
specified query string and the specified query language.
|
OURI |
createOURI(String theURI)
Create an ORUI object from the given URI string.
|
OURI |
createOURIForName(String resourceName)
Create an OURI from the given resource name, using the ontology base URI
(default name space).
|
OntologyTupleQuery |
createTupleQuery(String theQuery,
OConstants.QueryLanguage queryLanguage)
This method creates a OntologyTupleQuery object and passes on
the specified query string in the specified query language.
|
String |
executeQuery(String serqlQuery)
Deprecated.
|
void |
fireOntologyReset()
A method to invoke when the ontology is reset.
|
void |
fireOntologyResourceAdded(OResource resource)
A Method to invoke an event for newly added ontology resource
|
void |
fireOntologyResourcesRemoved(String[] resources)
A Method to invoke an event for a removed ontology resource
|
void |
fireResourcePropertyValueChanged(OResource resource,
RDFProperty property,
Object value,
int eventType)
A method to invoke when a resource's property value is changed
|
void |
fireResourceRelationChanged(OResource resource1,
OResource resource2,
int eventType)
A method to invoke when a resource's property value is changed
|
OURI |
generateOURI(String resourceNamePrefix)
Generate a new unique OURI for this ontology.
|
OURI |
generateOURI(String resourceNamePrefix,
String baseURI)
Generate a new unique OURI for this ontology.
|
List<OResource> |
getAllResources()
Deprecated.
|
Set<AnnotationProperty> |
getAnnotationProperties()
Gets the set of Annotation Properties in the ontology where for a
property there exists a statement <theProperty, RDF:Type,
OWL:AnnotationProperty>.
|
AnnotationProperty |
getAnnotationProperty(OURI theURI)
Returns the annotation property for the given URI or null if there is
no annotation property with that URI.
|
Set<DatatypeProperty> |
getDatatypeProperties()
Gets the set of Datatype Properties in the ontology.
|
DatatypeProperty |
getDatatypeProperty(OURI theURI)
Returns the datatype property for the given URI or null if there is
no datatype property with that URI.
|
String |
getDefaultNameSpace()
Gets the default name space for this ontology.
|
int |
getDistance(OClass class1,
OClass class2)
Gets the taxonomic distance between 2 classes.
|
Set<ObjectProperty> |
getObjectProperties()
Gets the set of Object Properties in the ontology.
|
ObjectProperty |
getObjectProperty(OURI theURI)
Returns the object property for the given URI or null if there is
no object property with that URI.
|
OClass |
getOClass(ONodeID theClassID)
Retrieves a both named classes and anonymous classes and retrictions that
match either the URI or the blank node identifier represented by ONodeID
|
Set<OClass> |
getOClasses(boolean top)
Retrieves all ontology classes in a set.
|
ClosableIterator<OClass> |
getOClassesIterator(boolean top)
Return an iterator to retrieve all ontology classes in the ontology.
|
OInstance |
getOInstance(OURI theInstanceURI)
Gets the instance with the given URI.
|
Set<OInstance> |
getOInstances()
Gets all instances in the ontology.
|
Set<OInstance> |
getOInstances(OClass theClass,
byte closure)
Deprecated.
|
Set<OInstance> |
getOInstances(OClass theClass,
OConstants.Closure closure)
Gets instances in the ontology, which belong to this class.
|
ClosableIterator<OInstance> |
getOInstancesIterator() |
ClosableIterator<OInstance> |
getOInstancesIterator(OClass theClass,
OConstants.Closure closure) |
List<Literal> |
getOntologyAnnotationValues(AnnotationProperty ann)
Get the values of an ontology annotation property.
|
String |
getOntologyData(byte format)
Deprecated.
not supported any more - throws UnsupportedOperationException
|
OntologyTripleStore |
getOntologyTripleStore()
Return an object representing the triple store which backs the ontology.
|
OURI |
getOntologyURI()
Get the URI of this ontology.
|
OResource |
getOResourceByName(String resourceName)
Deprecated.
|
OResource |
getOResourceFromMap(String uri)
Deprecated.
|
List<OResource> |
getOResourcesByName(String resourceName)
This method checks in its cache to find out the OResources for the
given resource name.
|
List<OResource> |
getOResourcesWith(RDFProperty aProperty,
Literal aValue)
This method given a property (either an annotation or datatype),
retrieves a list of resources which have the provided literal set
as a value.
|
List<OResource> |
getOResourcesWith(RDFProperty aProperty,
OResource aValue)
This method given a property (either object, transitive, symmetric
or rdf), retrieves a list of resources which have the provided
resource set as a value.
|
RDFProperty |
getProperty(OURI thePropertyURI)
Returns the property for a given URI or null if there is no property
with that URI.
|
Set<RDFProperty> |
getPropertyDefinitions()
Gets the set of RDF, Object, Datatype, Symmetric and Transitive
property definitions in this ontology.
|
Set<RDFProperty> |
getRDFProperties()
Gets the set of RDF Properties in the ontology where for a property
there exists a statement @lt;theProperty, RDF:Type, RDF:Property>.
|
Object |
getSesameRepository()
Deprecated.
|
String |
getSesameRepositoryID()
Deprecated.
|
Set<SymmetricProperty> |
getSymmetricProperties()
Gets the set of Symmetric Properties in the ontology.
|
Set<TransitiveProperty> |
getTransitiveProperties()
Gets the set of Transitive Properties in the ontology.
|
URL |
getURL()
Gets the URL of this ontology.
|
String |
getVersion()
Deprecated.
use method getOntologyAnnotationValues instead
|
boolean |
isAnnotationProperty(OURI thePropertyURI)
Checkes whether there exists a statement <thePropertyURI, RDF:Type,
OWL:AnnotationProperty> in the ontology or not.
|
boolean |
isDatatypeProperty(OURI thePropertyURI)
Checkes whether the ontology contains a datatype property with the
given URI.
|
boolean |
isModified()
Checks the modified flag.
|
boolean |
isObjectProperty(OURI thePropertyURI)
Checks if there exists an object property with the given URI
|
boolean |
isRDFProperty(OURI thePropertyURI)
Checkes whether there exists a statement <thePropertyURI, RDF:Type,
RDF:Property> in the ontology or not.
|
boolean |
isSymmetricProperty(OURI thePropertyURI)
Checkes whether there exists a statement <thePropertyURI, RDF:Type,
OWL:SymmetricProperty> in the ontology or not.
|
boolean |
isTransitiveProperty(OURI thePropertyURI)
Checkes whether there exists a statement <thePropertyURI, RDF:Type,
OWL:TransitiveProperty> in the ontology or not.
|
void |
readOntologyData(InputStream in,
String baseURI,
OConstants.OntologyFormat format,
boolean asImport)
Read ontology data from the specified stream in the specified format
and load it into the ontology.
|
void |
readOntologyData(Reader in,
String baseURI,
OConstants.OntologyFormat format,
boolean asImport)
Read ontology data from the specified reader in the specified format
and load it into the ontology.
|
void |
removeOClass(OClass theClass)
Removes a class from this ontology.
|
void |
removeOInstance(OInstance theInstance)
Removes the instance from the ontology.
|
void |
removeOntologyModificationListener(OntologyModificationListener oml)
Removed the registered ontology modification listeners
|
void |
removeOResourceFromMap(String uri)
Deprecated.
|
void |
removeProperty(RDFProperty theProperty)
A method to remove the existing propertyDefinition (exclusive of
Annotation Property).
|
void |
resolveImports(Map<String,String> importMappings)
Loads all imported ontologies.
|
void |
setDefaultNameSpace(String aNameSpace)
Sets the default name space/base URI for the ontology.
|
void |
setModified(boolean isModified)
Sets the modified flag.
|
void |
setOntologyAnnotation(AnnotationProperty ann,
Literal value)
Set an annotation property for the ontology to the specified literal
value.
|
void |
setOntologyURI(OURI theURI)
Set the ontology URI of the current ontology.
|
void |
setURL(URL aUrl)
Set the URL of this ontology.
|
void |
setVersion(String theVersion)
Deprecated.
use method setOntologyAnnotation instead
|
void |
store(File newOntology)
Deprecated.
not implemented any more, throws UnsupportedOperationException
|
boolean |
transationStarted()
Deprecated.
|
void |
writeOntologyData(OutputStream out,
byte format)
Deprecated.
not supported any more - throws UnsupportedOperationException
|
void |
writeOntologyData(OutputStream out,
OConstants.OntologyFormat format,
boolean includeExports)
Write the ontology data to the provided output stream in the specified
serialization format.
|
void |
writeOntologyData(Writer out,
byte format)
Deprecated.
not supported any more and will throw and exception
in the new implementation plugin
|
void |
writeOntologyData(Writer out,
OConstants.OntologyFormat format,
boolean includeExports)
Write the ontology data to the provided writer in the specified
serialization format.
|
getDataStore, getLRPersistenceId, getParent, setDataStore, setLRPersistenceId, setParent, sync
cleanup, getParameterValue, init, setParameterValue, setParameterValues
getFeatures, setFeatures
getName, setName
void cleanOntology()
@Deprecated String getOntologyData(byte format)
format
- the format to be used for serialization@Deprecated void writeOntologyData(OutputStream out, byte format)
out
- OutputStream the serialized ontology data is written toformat
- the serialization format, see OConstants
void writeOntologyData(OutputStream out, OConstants.OntologyFormat format, boolean includeExports)
out
- an open OutpuStream for writing the data.format
- the serialization formatincludeExports
- if false, do not write any data that was loaded
as an ontology import.@Deprecated void writeOntologyData(Writer out, byte format)
out
- an open Writer for writing the dataformat
- the ontology serialization format , see OConstants
void writeOntologyData(Writer out, OConstants.OntologyFormat format, boolean includeExports)
out
- an open Writer for writing the dataformat
- the ontology serialization format , see
OConstants.OntologyFormat
includeExports
- if false, do not write any data that was loaded as
and ontology import.void readOntologyData(InputStream in, String baseURI, OConstants.OntologyFormat format, boolean asImport)
in
- an InputStream object for reading the ontology databaseURI
- the URI to use for resolving URI referencesformat
- the serialization format of the ontology, see
OConstants.OntologyFormat
asImport
- if true, load the data as an ontology import which means
that it will not be written as part of the user data, unless explicitly
requested.void readOntologyData(Reader in, String baseURI, OConstants.OntologyFormat format, boolean asImport)
in
- baseURI
- format
- asImport
- asImport if true, load the data as an ontology import which means
that it will not be written as part of the user data, unless explicitly
requested.OURI getOntologyURI()
void setOntologyURI(OURI theURI)
NOTE: this method does not set the default namespace!
NOTE: at the moment, this method allows to set the ontology URI as long as no URI is set yet. Once an ontology URI is set, it cannot be changed since it would not be clear what to do with assertions that alreadt reference that ontology URI (e.g. ontology annotations or import specifications).
theURI
- void resolveImports(Map<String,String> importMappings)
importMappings
,
and maps to an empty String, the import will be ignored. If an URI
is found and maps to a non-empty string, the string will be interpreted
as an URL from which to load the imported ontology. If no entry is found
for the URI, the URI will be interpreted as an URL from which to load
the ontology. All import URIs of ontologies loaded during this process
will be recursively processed in the same way.
A GateOntologyException is thrown if any import that should be loaded
cannot be loaded and the import loading process is aborted before
potential additional imports are processed.importMappings
- URL getURL()
void setURL(URL aUrl)
getURL()
method. The ontology store is not modified by this.aUrl
- the url to be set@Deprecated void store(File newOntology) throws IOException
newOntology
- a File object describing the file where to save toIOException
void setDefaultNameSpace(String aNameSpace)
createOURIForName(String)
method.
Setting the default name space with this method does not change the
ontology store and does not add a default namespace declaration to the
store or when the ontology is saved.aNameSpace
- a String that can be used as a base URIString getDefaultNameSpace()
@Deprecated void setVersion(String theVersion)
theVersion
- the version to be set@Deprecated String getVersion()
void setOntologyAnnotation(AnnotationProperty ann, Literal value)
ann
- the annotation property objectvalue
- a Literal object describing the value. This usually should be
a String literal.List<Literal> getOntologyAnnotationValues(AnnotationProperty ann)
ann
- the annotation property object@Deprecated OClass addOClass(OURI aURI, byte classType)
aURI
- URI of this classclassType
- one of the values from
OConstants.OCLASS_TYPE_OWL_CLASS and
OConstants.OCLASS_TYPE_OWL_RESTRICTION;OClass addOClass(OURI aURI)
aURI
- URI of this classOClass getOClass(ONodeID theClassID)
theClassID
- void removeOClass(OClass theClass)
theClass
- the class to be removedboolean containsOClass(ONodeID theURI)
theURI
- a ONodeID, usually an OURI specifying the ID of the
ontology classboolean containsOClass(OClass theClass)
theClass
- a ontology class objectSet<OClass> getOClasses(boolean top)
NOTE: for large ontologies with a large number of classes it may be
preferable to use method getOClassesIterator(boolean)
instead.
top
- If set to true, only returns those classes with no super
classes, otherwise - a set of all classes.ClosableIterator<OClass> getOClassesIterator(boolean top)
top
- If set to true, only returns those classes with no
super classes, otherwise all classesint getDistance(OClass class1, OClass class2)
class1
- the first classclass2
- the second classOInstance addOInstance(OURI theInstanceURI, OClass theClass)
theInstanceURI
- theClass
- the class to which the instance belongs.void removeOInstance(OInstance theInstance)
theInstance
- to be removedSet<OInstance> getOInstances()
Set
of OInstance objectsClosableIterator<OInstance> getOInstancesIterator()
@Deprecated Set<OInstance> getOInstances(OClass theClass, byte closure)
theClass
- the class of the instancesclosure
- either DIRECT_CLOSURE or TRANSITIVE_CLOSURE of
OConstants
Set
of OInstance objectsSet<OInstance> getOInstances(OClass theClass, OConstants.Closure closure)
theClass
- the class of the instancesclosure
- either OConstants.Closure.DIRECT_CLOSURE
or
OConstants.Closure.TRANSITIVE_CLOSURE
Set
of OInstance objectsClosableIterator<OInstance> getOInstancesIterator(OClass theClass, OConstants.Closure closure)
OInstance getOInstance(OURI theInstanceURI)
theInstanceURI
- the instance URIboolean containsOInstance(OInstance theInstance)
theInstance
- boolean containsOInstance(OURI theInstanceURI)
theInstanceURI
- @Deprecated RDFProperty addRDFProperty(OURI aPropertyURI, Set<OResource> domain, Set<OResource> range)
Set<RDFProperty> getRDFProperties()
Set
of RDFProperty
.boolean isRDFProperty(OURI thePropertyURI)
thePropertyURI
- AnnotationProperty addAnnotationProperty(OURI aPropertyURI)
aPropertyURI
- URI of the property to be added into the
ontology.Set<AnnotationProperty> getAnnotationProperties()
Set
of AnnotationProperty
.boolean isAnnotationProperty(OURI thePropertyURI)
thePropertyURI
- DatatypeProperty addDatatypeProperty(OURI aPropertyURI, Set<OClass> domain, DataType aDatatype)
If this method is called with an OURI of a datatype property that already exists, any specified domain class is added to the intersection of classes already defined for the domain.
aPropertyURI
- the URI for the new property.domain
- the set of ontology classes
that constitutes the domain for the new property.aDatatype
- a DataType object describing the datatype of the range.Set<DatatypeProperty> getDatatypeProperties()
Set
of DatatypeProperty
.boolean isDatatypeProperty(OURI thePropertyURI)
thePropertyURI
- ObjectProperty addObjectProperty(OURI aPropertyURI, Set<OClass> domain, Set<OClass> range)
If this method is called with an OURI of an object property that already exists, any specified domain or range class is added to the intersection of classes already defined for the domain or range.
aPropertyURI
- the URI for the new property.domain
- the set of ontology classes (i.e. OClass
objects} that constitutes the domain of the property.
An instance must belong to the intersection of all classes
in the set to be a valid member of the domain of the property.
If an empty set or null is passed, the instance can belong to any
class.range
- the set of ontology classes (i.e. OClass
objects} that constitutes the range for the new property. The instance
that is the value of a property must belong to the intersection of
all classes in this set to be valid. If an empty set or null is passed
on, the instance can belong to any class.Set<ObjectProperty> getObjectProperties()
Set
of ObjectProperty
.boolean isObjectProperty(OURI thePropertyURI)
thePropertyURI
- SymmetricProperty addSymmetricProperty(OURI aPropertyURI, Set<OClass> domainAndRange)
If this method is called with an OURI of a datatype property that already exists, any specified domainAndRange class is added to the intersection of classes already defined for the domain and range.
aPropertyURI
- the URI for the new property.domainAndRange
- the set of ontology classes (i.e.
OClass
objects} that constitutes the domain and
the range for the new property. The property only applies
to instances that belong to the intersection of all
classes included
in its domain. An empty set means that the property
applies to instances of any class.Set<SymmetricProperty> getSymmetricProperties()
Set
of SymmetricProperty
.boolean isSymmetricProperty(OURI thePropertyURI)
thePropertyURI
- TransitiveProperty addTransitiveProperty(OURI aPropertyURI, Set<OClass> domain, Set<OClass> range)
aPropertyURI
- the URI for the new property.domain
- the set of ontology classes (i.e. OClass
objects} that constitutes the range for the new property.
The property only applies to instances that belong to
the intersection of all classes included in its domain.
An empty set
means that the property applies to instances of any class.range
- the set of ontology classes (i.e. OClass
objects} that constitutes the range for the new property.Set<TransitiveProperty> getTransitiveProperties()
Set
of TransitiveProperty
.boolean isTransitiveProperty(OURI thePropertyURI)
thePropertyURI
- Set<RDFProperty> getPropertyDefinitions()
Set
of RDFProperty
,
DatatypeProperty
, ObjectProperty
,
TransitiveProperty
and , SymmetricProperty
objects. Please note that the method does not include
annotation properties.RDFProperty getProperty(OURI thePropertyURI)
thePropertyURI
- the URI of the propertyAnnotationProperty getAnnotationProperty(OURI theURI)
theURI
- the URI of the propertyDatatypeProperty getDatatypeProperty(OURI theURI)
theURI
- the URI of the propertyObjectProperty getObjectProperty(OURI theURI)
theURI
- the URI of the propertyvoid removeProperty(RDFProperty theProperty)
theProperty
- MinCardinalityRestriction addMinCardinalityRestriction(RDFProperty onProperty, String minCardinalityValue) throws InvalidValueException
onProperty
- - Specifies the property for which the restriction is being set.minCardinalityValue
- - generally a numeric number.InvalidValueException
- - if a value is not compatible with the nonNegativeIntegerNumber datatype.MaxCardinalityRestriction addMaxCardinalityRestriction(RDFProperty onProperty, String maxCardinalityValue) throws InvalidValueException
onProperty
- - Specifies the property for which the restriction is being set.maxCardinalityValue
- - generally a numeric number.InvalidValueException
- - if a value is not compatible with the nonNegativeIntegerNumber datatype.CardinalityRestriction addCardinalityRestriction(RDFProperty onProperty, String cardinalityValue) throws InvalidValueException
onProperty
- - Specifies the property for which the restriction is being set.cardinalityValue
- - generally a numeric number.InvalidValueException
- - if a value is not compatible with the nonNegativeIntegerNumber datatype.HasValueRestriction addHasValueRestriction(RDFProperty onProperty, OResource hasValue)
onProperty
- - Specifies the property for which the restriction is being set.hasValue
- - a resource used as a value for hasValue element of the restriction.@Deprecated AllValuesFromRestriction addAllValuesFromRestriction(RDFProperty onProperty, OResource hasValue)
addAllValuesFromRestriction(ObjectProperty, OClass)
instead.onProperty
- - Specifies the property for which the restriction is being set.hasValue
- - a resource used as a value for hasValue element of the restriction.AllValuesFromRestriction addAllValuesFromRestriction(ObjectProperty onProperty, OClass theClass)
SomeValuesFromRestriction addSomeValuesFromRestriction(RDFProperty onProperty, OResource hasValue)
onProperty
- - Specifies the property for which the restriction is being set.hasValue
- - a resource used as a value for hasValue element of the restriction.AnonymousClass addAnonymousClass()
void setModified(boolean isModified)
isModified
- sets this param as a value of the modified
property of the ontologyboolean isModified()
isModified
in interface LanguageResource
void addOntologyModificationListener(OntologyModificationListener oml)
void removeOntologyModificationListener(OntologyModificationListener oml)
void fireResourcePropertyValueChanged(OResource resource, RDFProperty property, Object value, int eventType)
void fireResourceRelationChanged(OResource resource1, OResource resource2, int eventType)
resource1
- resource2
- eventType
- void fireOntologyResourceAdded(OResource resource)
resource
- void fireOntologyResourcesRemoved(String[] resources)
resources
- void fireOntologyReset()
@Deprecated void commitTransaction()
@Deprecated boolean transationStarted()
@Deprecated Object getSesameRepository()
@Deprecated String getSesameRepositoryID()
@Deprecated OResource getOResourceFromMap(String uri)
@Deprecated void addOResourceToMap(String uri, OResource resource)
@Deprecated void removeOResourceFromMap(String uri)
uri
- @Deprecated OResource getOResourceByName(String resourceName)
List<OResource> getOResourcesByName(String resourceName)
@Deprecated List<OResource> getAllResources()
List<OResource> getOResourcesWith(RDFProperty aProperty, Literal aValue)
List<OResource> getOResourcesWith(RDFProperty aProperty, OResource aValue)
@Deprecated String executeQuery(String serqlQuery)
OntologyTupleQuery createTupleQuery(String theQuery, OConstants.QueryLanguage queryLanguage)
theQuery
- a String representing the tuple query.queryLanguage
- the query language, either SERQL or SPARQLOntologyBooleanQuery createBooleanQuery(String theQuery, OConstants.QueryLanguage queryLanguage)
theQuery
- a String representing the tuple query.queryLanguage
- the query language, either SERQL or SPARQLOntologyTripleStore getOntologyTripleStore()
OURI createOURI(String theURI)
theURI
- an URI or IRI stringOURI createOURIForName(String resourceName)
resourceName
- the resource name i.e. the part of the final URI/IRI
that is attached to the base URI (aftaer a trailing "#" or "/").OURI generateOURI(String resourceNamePrefix)
The URI fragment part that is appended to the given resourceName (if any) consists of 7 ASCII characters representing the system time in radix 36 followed by 3 ASCII characters representing a random number.
Note that this method will return an OURI that is guaranteed not to be contained in the ontology, but if called repeatedly without actually adding a resource with the newly generated OURI to the ontology, the method might, although extremely unlikely, still return the same OURI more than once. Generated OURIs should hence been used for adding resources before more OURIs are generated.
resourceNamePrefix
- the prefix to use for the generated resource
nameOURI generateOURI(String resourceNamePrefix, String baseURI)
generateOURI(java.lang.String)
but also allows the specification of the base URI part of the final
URI.resourceNamePrefix
- the prefix to use for the generated resource namebaseURI
- the base URI to use for the final URICopyright © 2024 GATE. All rights reserved.