|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface OntModel
An enhanced view of a Jena model that is known to contain ontology
data, under a given ontology vocabulary
(such as OWL).
This class does not by itself compute the deductive extension of the graph
under the semantic rules of the language. Instead, we wrap an underlying
model with this ontology interface, that presents a convenience syntax for accessing
the language elements. Depending on the inference capability of the underlying model,
the OntModel will appear to contain more or less triples. For example, if
this class is used to wrap a plain memory or database model, only the
relationships asserted by the document will be reported through this
convenience API. Alternatively, if the OntModel wraps an OWL inferencing model,
the inferred triples from the extension will be reported as well. For
example, assume the following ontology fragment:
In a non-inferencing model, the
:A rdf:type owl:Class .
:B rdf:type owl:Class ; rdfs:subClassOf :A .
:widget rdf:type :B .
rdf:type
of the widget will be
reported as class :B
only. In a model that can process the OWL
semantics, the widget's types will include :B
, :A
,
and owl:Thing
.
Note: that OntModel
is an extension to the
InfModel
interface. This is to support the case where an ontology model
wraps an inference graph, and we want to make the special capabilities of the
InfModel
, for example global consistency checking, accessible to
client programs. Since not all ont models use a reasoner, using these methods
may result in a runtime exception, though the typical behaviour is that such
calls will be silently ignored.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.hp.hpl.jena.shared.PrefixMapping |
---|
PrefixMapping.Factory, PrefixMapping.IllegalPrefixException, PrefixMapping.JenaLockedException |
Field Summary |
---|
Fields inherited from interface com.hp.hpl.jena.shared.PrefixMapping |
---|
Extended, Standard |
Fields inherited from interface com.hp.hpl.jena.rdf.model.ModelLock |
---|
READ, WRITE |
Method Summary | |
---|---|
void |
addLoadedImport(String uri)
Record that this model has now imported the document with the given URI, so that it will not be re-imported in the future. |
void |
addSubModel(Model model)
Add the given model as one of the sub-models of the enclosed ontology union model. |
void |
addSubModel(Model model,
boolean rebind)
Add the given model as one of the sub-models of the enclosed ontology union model. |
AllDifferent |
createAllDifferent()
Answer a new, anonymous node representing the fact that a given set of classes are all pair-wise distinct. |
AllDifferent |
createAllDifferent(RDFList differentMembers)
Answer a new, anonymous node representing the fact that a given set of classes are all pair-wise distinct. |
AllValuesFromRestriction |
createAllValuesFromRestriction(String uri,
Property prop,
Resource cls)
Answer a class description defined as the class of those individuals for which all values of the given property belong to the given class |
AnnotationProperty |
createAnnotationProperty(String uri)
Answer a resource that represents an annotation property in this model. |
CardinalityQRestriction |
createCardinalityQRestriction(String uri,
Property prop,
int cardinality,
OntClass cls)
Answer a class description defined as the class of those individuals that have exactly the given number of values for the given property, all values of which belong to the given class. |
CardinalityRestriction |
createCardinalityRestriction(String uri,
Property prop,
int cardinality)
Answer a class description defined as the class of those individuals that have exactly the given number of values for the given property. |
OntClass |
createClass()
Answer a resource that represents an anonymous class description in this model. |
OntClass |
createClass(String uri)
Answer a resource that represents a class description node in this model. |
ComplementClass |
createComplementClass(String uri,
Resource cls)
Answer a resource representing the class that is the complement of the given argument class |
DataRange |
createDataRange(RDFList literals)
Answer a data range defined as the given set of concrete data values. |
DatatypeProperty |
createDatatypeProperty(String uri)
Answer a resource that represents datatype property in this model, and that is not a functional property. |
DatatypeProperty |
createDatatypeProperty(String uri,
boolean functional)
Answer a resource that represents datatype property in this model. |
EnumeratedClass |
createEnumeratedClass(String uri,
RDFList members)
Answer a resource representing the class that is the enumeration of the given list of individuals |
HasValueRestriction |
createHasValueRestriction(String uri,
Property prop,
RDFNode value)
Answer a class description defined as the class of those individuals that have the given resource as the value of the given property |
Individual |
createIndividual(Resource cls)
Answer a resource that represents an Indvidual node in this model. |
Individual |
createIndividual(String uri,
Resource cls)
Answer a resource that represents an Individual node in this model. |
IntersectionClass |
createIntersectionClass(String uri,
RDFList members)
Answer a resource representing the class that is the intersection of the given list of class descriptions. |
InverseFunctionalProperty |
createInverseFunctionalProperty(String uri)
Answer a resource representing an inverse functional property |
InverseFunctionalProperty |
createInverseFunctionalProperty(String uri,
boolean functional)
Answer a resource representing an inverse functional property, which is optionally also functional. |
MaxCardinalityQRestriction |
createMaxCardinalityQRestriction(String uri,
Property prop,
int cardinality,
OntClass cls)
Answer a class description defined as the class of those individuals that have at most the given number of values for the given property, all values of which belong to the given class. |
MaxCardinalityRestriction |
createMaxCardinalityRestriction(String uri,
Property prop,
int cardinality)
Answer a class description defined as the class of those individuals that have at most the given number of values for the given property. |
MinCardinalityQRestriction |
createMinCardinalityQRestriction(String uri,
Property prop,
int cardinality,
OntClass cls)
Answer a class description defined as the class of those individuals that have at least the given number of values for the given property, all values of which belong to the given class. |
MinCardinalityRestriction |
createMinCardinalityRestriction(String uri,
Property prop,
int cardinality)
Answer a class description defined as the class of those individuals that have at least the given number of values for the given property. |
ObjectProperty |
createObjectProperty(String uri)
Answer a resource representing an object property in this model, and that is not a functional property. |
ObjectProperty |
createObjectProperty(String uri,
boolean functional)
Answer a resource that represents an object property in this model. |
Ontology |
createOntology(String uri)
Answer a resource that represents an ontology description node in this model. |
OntProperty |
createOntProperty(String uri)
Answer a resource representing an generic property in this model. |
OntResource |
createOntResource(Class javaClass,
Resource rdfType,
String uri)
Answer a resource that represents a generic ontology node in this model. |
Restriction |
createRestriction(Property p)
Answer a resource that represents an anonymous property restriction in this model. |
Restriction |
createRestriction(String uri,
Property p)
Answer a resource that represents a property restriction in this model. |
SomeValuesFromRestriction |
createSomeValuesFromRestriction(String uri,
Property prop,
Resource cls)
Answer a class description defined as the class of those individuals that have at least one property with a value belonging to the given class |
SymmetricProperty |
createSymmetricProperty(String uri)
Answer a resource representing a symmetric property |
SymmetricProperty |
createSymmetricProperty(String uri,
boolean functional)
Answer a resource representing a symmetric property, which is optionally also functional. |
TransitiveProperty |
createTransitiveProperty(String uri)
Answer a resource representing a transitive property |
TransitiveProperty |
createTransitiveProperty(String uri,
boolean functional)
Answer a resource representing a transitive property, which is optionally also functional. |
UnionClass |
createUnionClass(String uri,
RDFList members)
Answer a resource representing the class that is the union of the given list of class desctiptions |
AllValuesFromRestriction |
getAllValuesFromRestriction(String uri)
Answer a class description defined as the class of those individuals for which all values of the given property belong to the given class. |
AnnotationProperty |
getAnnotationProperty(String uri)
Answer a resource that represents an annotation property in this model. |
Model |
getBaseModel()
Answer the base model of this model. |
CardinalityQRestriction |
getCardinalityQRestriction(String uri)
Answer a class description defined as the class of those individuals that have a property p, with cardinality N, all values of which are members of a given class. |
CardinalityRestriction |
getCardinalityRestriction(String uri)
Answer a class description defined as the class of those individuals that have exactly the given number of values for the given property. |
ComplementClass |
getComplementClass(String uri)
Answer a resource representing the class that is the complement of another class. |
DatatypeProperty |
getDatatypeProperty(String uri)
Answer a resource that represents datatype property in this model. . |
OntDocumentManager |
getDocumentManager()
Answer a reference to the document manager that this model is using to manage ontology <-> mappings, and to load the imports closure. |
boolean |
getDynamicImports()
Answer true if the imports closure of the model will be dynamically updated as imports statements are added and removed. |
EnumeratedClass |
getEnumeratedClass(String uri)
Answer a resource representing the class that is the enumeration of a list of individuals. |
com.hp.hpl.jena.ontology.event.OntEventManager |
getEventManager()
Answer the ontology event manager for this model. |
HasValueRestriction |
getHasValueRestriction(String uri)
Answer a class description defined as the class of those individuals that have the given resource as the value of the given property. |
OntModel |
getImportedModel(String uri)
Answer an OntModel representing the imported ontology
with the given URI. |
ModelMaker |
getImportModelMaker()
Answer the model maker associated with this model (used for constructing the constituent models of the imports closure). |
Individual |
getIndividual(String uri)
Answer a resource that represents an Individual node in this model. |
IntersectionClass |
getIntersectionClass(String uri)
Answer a resource representing the class that is the intersection of a list of class descriptions. |
InverseFunctionalProperty |
getInverseFunctionalProperty(String uri)
Answer a resource representing an inverse functional property. |
MaxCardinalityQRestriction |
getMaxCardinalityQRestriction(String uri)
Answer a class description defined as the class of those individuals that have a property p, with max cardinality N, all values of which are members of a given class. |
MaxCardinalityRestriction |
getMaxCardinalityRestriction(String uri)
Answer a class description defined as the class of those individuals that have at most the given number of values for the given property. |
MinCardinalityQRestriction |
getMinCardinalityQRestriction(String uri)
Answer a class description defined as the class of those individuals that have a property p, with min cardinality N, all values of which are members of a given class. |
MinCardinalityRestriction |
getMinCardinalityRestriction(String uri)
Answer a class description defined as the class of those individuals that have at least the given number of values for the given property. |
ModelMaker |
getModelMaker()
Deprecated. use getImportModelMaker instead for consistency with name changes to OntModelSpec to avoid ambiguity with base vs import makers. |
ObjectProperty |
getObjectProperty(String uri)
Answer a resource representing an object property in this model. |
OntClass |
getOntClass(String uri)
Answer a resource that represents a class description node in this model. |
Ontology |
getOntology(String uri)
Answer a resource that represents an ontology description node in this model. |
OntProperty |
getOntProperty(String uri)
Answer a resource representing an generic property in this model. |
Resource |
getOWLLanguageLevel(List problems)
If this OntModel is presenting an OWL model, answer the minimum OWL language level that the constructs used in this model lie entirely within. |
Profile |
getProfile()
Answer the language profile (for example, OWL or DAML+OIL) that this model is working to. |
QualifiedRestriction |
getQualifiedRestriction(String uri)
Answer a class description defined as the class of those individuals that have a property p, all values of which are members of a given class. |
Restriction |
getRestriction(String uri)
Answer a resource that represents a property restriction in this model. |
SomeValuesFromRestriction |
getSomeValuesFromRestriction(String uri)
Answer a class description defined as the class of those individuals that have at least one property with a value belonging to the given class. |
OntModelSpec |
getSpecification()
Answer the ontology model specification that was used to construct this model |
List |
getSubGraphs()
Answer the sub-graphs of this model. |
SymmetricProperty |
getSymmetricProperty(String uri)
Answer a resource representing a symmetric property. |
TransitiveProperty |
getTransitiveProperty(String uri)
Answer a resource representing a transitive property. |
UnionClass |
getUnionClass(String uri)
Answer a resource representing the class that is the union of a list of class desctiptions. |
boolean |
hasLoadedImport(String uri)
Answer true if this model has had the given URI document imported into it. |
boolean |
isInBaseModel(RDFNode node)
Answer true if the given node is a member of the base model of this ontology model. |
boolean |
isInBaseModel(Statement stmt)
Answer true if the given statement is defined in the base model of this ontology model. |
ExtendedIterator |
listAllDifferent()
Answer an iterator that ranges over the nodes that denote pair-wise disjointness between sets of classes. |
ExtendedIterator |
listAnnotationProperties()
Answer an iterator that ranges over the properties in this model that are declared to be annotation properties. |
ExtendedIterator |
listClasses()
Answer an iterator that ranges over all of the various forms of class description resource in this model. |
ExtendedIterator |
listComplementClasses()
Answer an iterator that ranges over the complement class-descriptions in this model, i.e. the class resources specified to have a property complementOf (or equivalent) and a list of values. |
ExtendedIterator |
listDataRanges()
Answer an iterator over the DataRange objects in this ontology, if there are any. |
ExtendedIterator |
listDatatypeProperties()
Answer an iterator that ranges over the datatype property resources in this model, i.e. the resources with rdf:type DatatypeProperty or equivalent. |
ExtendedIterator |
listEnumeratedClasses()
Answer an iterator that ranges over the enumerated class class-descriptions in this model, i.e. the class resources specified to have a property oneOf (or equivalent) and a list of values. |
ExtendedIterator |
listFunctionalProperties()
Answer an iterator that ranges over the functional property resources in this model, i.e. the resources with rdf:type FunctionalProperty or equivalent. |
ExtendedIterator |
listImportedModels()
Answer an iterator over the ontologies that this ontology imports, each of which will have been wrapped as an ontology model using the same OntModelSpec as this model. |
Set |
listImportedOntologyURIs()
Answer a list of the imported URI's in this ontology model. |
Set |
listImportedOntologyURIs(boolean closure)
Answer a list of the imported URI's in this ontology model, and optionally in the closure of this model's imports. |
ExtendedIterator |
listIndividuals()
Answer an iterator that ranges over the individual resources in this model, i.e. the resources with rdf:type corresponding to a class defined
in the ontology. |
ExtendedIterator |
listIntersectionClasses()
Answer an iterator that ranges over the intersection class-descriptions in this model, i.e. the class resources specified to have a property intersectionOf (or equivalent) and a list of values. |
ExtendedIterator |
listInverseFunctionalProperties()
Answer an iterator that ranges over the inverse functional property resources in this model, i.e. the resources with rdf:type InverseFunctionalProperty or equivalent. |
ExtendedIterator |
listNamedClasses()
Answer an iterator that ranges over the named class-descriptions in this model, i.e. resources with rdf:type
Class (or equivalent) and a node URI. |
ExtendedIterator |
listObjectProperties()
Answer an iterator that ranges over the object property resources in this model, i.e. the resources with rdf:type ObjectProperty or equivalent. |
ExtendedIterator |
listOntologies()
Answer an iterator that ranges over the ontology resources in this model, i.e. the resources with rdf:type Ontology or equivalent. |
ExtendedIterator |
listOntProperties()
Answer an iterator that ranges over the property resources in this model, i.e. the resources with rdf:type Property or equivalent. |
ExtendedIterator |
listRestrictions()
Answer an iterator that ranges over the property restriction class-descriptions in this model, i.e. resources with rdf:type
Restriction (or equivalent). |
ExtendedIterator |
listSymmetricProperties()
Answer an iterator that ranges over the symmetric property resources in this model, i.e. the resources with rdf:type SymmetricProperty or equivalent. |
ExtendedIterator |
listTransitiveProperties()
Answer an iterator that ranges over the transitive property resources in this model, i.e. the resources with rdf:type TransitiveProperty or equivalent. |
ExtendedIterator |
listUnionClasses()
Answer an iterator that ranges over the union class-descriptions in this model, i.e. the class resources specified to have a property unionOf (or equivalent) and a list of values. |
ExtendedIterator |
queryFor(BindingQueryPlan query,
List altQueries,
Class asKey)
Answer the iterator over the resources from the graph that satisfy the given query, followed by the answers to the alternative queries (if specified). |
void |
removeLoadedImport(String uri)
Record that this model no longer imports the document with the given URI. |
void |
removeSubModel(Model model)
Remove the given model as one of the sub-models of the enclosed ontology union model. |
void |
removeSubModel(Model model,
boolean rebind)
Remove the given model as one of the sub-models of the enclosed ontology union model. |
void |
setDynamicImports(boolean dynamic)
Set the flag that controls whether adding or removing imports statements into the model will result in the imports closure changing dynamically. |
void |
setStrictMode(boolean strict)
Set the checking mode to strict or non-strict. |
boolean |
strictMode()
Answer true if this model is currently in strict checking mode. |
Model |
write(OutputStream out)
Write a serialization of this model as an XML document. |
Model |
write(OutputStream out,
String lang)
Write a serialized represention of this model in a specified language. |
Model |
write(OutputStream out,
String lang,
String base)
Write a serialized represention of a model in a specified language. |
Model |
write(Writer writer)
Write the model as an XML document. |
Model |
write(Writer writer,
String lang)
Write a serialized represention of a model in a specified language. |
Model |
write(Writer writer,
String lang,
String base)
Write a serialized represention of a model in a specified language. |
Model |
writeAll(OutputStream out,
String lang,
String base)
Write a serialized represention of all of the contents of the model, including inferred statements and statements imported from other documents. |
Model |
writeAll(Writer writer,
String lang,
String base)
Write a serialized represention of all of the contents of the model, including inferred statements and statements imported from other documents. |
Methods inherited from interface com.hp.hpl.jena.rdf.model.InfModel |
---|
getDeductionsModel, getDerivation, getRawModel, getReasoner, listStatements, prepare, rebind, reset, setDerivationLogging, validate |
Methods inherited from interface com.hp.hpl.jena.rdf.model.ModelGraphInterface |
---|
asRDFNode, asStatement, getGraph, queryHandler |
Methods inherited from interface com.hp.hpl.jena.rdf.model.RDFReaderF |
---|
getReader, getReader, setReaderClassName |
Methods inherited from interface com.hp.hpl.jena.rdf.model.RDFWriterF |
---|
getWriter, getWriter, setWriterClassName |
Methods inherited from interface com.hp.hpl.jena.shared.PrefixMapping |
---|
expandPrefix, getNsPrefixMap, getNsPrefixURI, getNsURIPrefix, lock, qnameFor, removeNsPrefix, setNsPrefix, setNsPrefixes, setNsPrefixes, shortForm, usePrefix, withDefaultMappings |
Methods inherited from interface com.hp.hpl.jena.rdf.model.ModelLock |
---|
enterCriticalSection, leaveCriticalSection |
Method Detail |
---|
ExtendedIterator listOntologies()
Answer an iterator that ranges over the ontology resources in this model, i.e.
the resources with rdf:type Ontology
or equivalent. These resources
typically contain metadata about the ontology document that contains them.
Specifically, the resources in this iterator will those whose type corresponds
to the value given in the ontology vocabulary associated with this model, see
Profile.ONTOLOGY()
.
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
ExtendedIterator listOntProperties()
Answer an iterator that ranges over the property resources in this model, i.e.
the resources with rdf:type Property
or equivalent. An OntProperty
is equivalent to an rdfs:Property
in a normal RDF graph; this type is
provided as a common super-type for the more specific ObjectProperty
and
DatatypeProperty
property types.
Specifically, the resources in this iterator will those whose type corresponds to the value given in the ontology vocabulary associated with this model.
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
ExtendedIterator listObjectProperties()
Answer an iterator that ranges over the object property resources in this model, i.e.
the resources with rdf:type ObjectProperty
or equivalent. An object
property is a property that is defined in the ontology language semantics as a
one whose range comprises individuals (rather than datatyped literals).
Specifically, the resources in this iterator will those whose type corresponds
to the value given in the ontology vocabulary associated with this model: see
Profile.OBJECT_PROPERTY()
.
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
ExtendedIterator listDatatypeProperties()
Answer an iterator that ranges over the datatype property resources in this model, i.e.
the resources with rdf:type DatatypeProperty
or equivalent. An datatype
property is a property that is defined in the ontology language semantics as a
one whose range comprises datatyped literals (rather than individuals).
Specifically, the resources in this iterator will those whose type corresponds
to the value given in the ontology vocabulary associated with this model: see
Profile.DATATYPE_PROPERTY()
.
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
ExtendedIterator listFunctionalProperties()
Answer an iterator that ranges over the functional property resources in this model, i.e.
the resources with rdf:type FunctionalProperty
or equivalent. A functional
property is a property that is defined in the ontology language semantics as having
a unique domain element for each instance of the relationship.
Specifically, the resources in this iterator will those whose type corresponds
to the value given in the ontology vocabulary associated with this model: see
Profile.FUNCTIONAL_PROPERTY()
.
ExtendedIterator listTransitiveProperties()
Answer an iterator that ranges over the transitive property resources in this model, i.e.
the resources with rdf:type TransitiveProperty
or equivalent.
Specifically, the resources in this iterator will those whose type corresponds
to the value given in the ontology vocabulary associated with this model: see
Profile.TRANSITIVE_PROPERTY()
.
ExtendedIterator listSymmetricProperties()
Answer an iterator that ranges over the symmetric property resources in this model, i.e.
the resources with rdf:type SymmetricProperty
or equivalent.
Specifically, the resources in this iterator will those whose type corresponds
to the value given in the ontology vocabulary associated with this model: see
Profile.SYMMETRIC_PROPERTY()
.
ExtendedIterator listInverseFunctionalProperties()
Answer an iterator that ranges over the inverse functional property resources in this model, i.e.
the resources with rdf:type InverseFunctionalProperty
or equivalent.
Specifically, the resources in this iterator will those whose type corresponds
to the value given in the ontology vocabulary associated with this model: see
Profile.INVERSE_FUNCTIONAL_PROPERTY()
.
ExtendedIterator listIndividuals()
Answer an iterator that ranges over the individual resources in this model, i.e.
the resources with rdf:type
corresponding to a class defined
in the ontology.
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
ExtendedIterator listClasses()
Answer an iterator that ranges over all of the various forms of class description resource
in this model. Class descriptions include enumerated
classes, union
classes, complement
classes, intersection
classes, named
classes and property restrictions
.
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
ExtendedIterator listEnumeratedClasses()
Answer an iterator that ranges over the enumerated class class-descriptions
in this model, i.e. the class resources specified to have a property
oneOf
(or equivalent) and a list of values.
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
Profile.ONE_OF()
ExtendedIterator listUnionClasses()
Answer an iterator that ranges over the union class-descriptions
in this model, i.e. the class resources specified to have a property
unionOf
(or equivalent) and a list of values.
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
Profile.UNION_OF()
ExtendedIterator listComplementClasses()
Answer an iterator that ranges over the complement class-descriptions
in this model, i.e. the class resources specified to have a property
complementOf
(or equivalent) and a list of values.
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
Profile.COMPLEMENT_OF()
ExtendedIterator listIntersectionClasses()
Answer an iterator that ranges over the intersection class-descriptions
in this model, i.e. the class resources specified to have a property
intersectionOf
(or equivalent) and a list of values.
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
Profile.INTERSECTION_OF()
ExtendedIterator listNamedClasses()
Answer an iterator that ranges over the named class-descriptions
in this model, i.e. resources with rdf:type
Class
(or equivalent) and a node URI.
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
ExtendedIterator listRestrictions()
Answer an iterator that ranges over the property restriction class-descriptions
in this model, i.e. resources with rdf:type
Restriction
(or equivalent).
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
Profile.RESTRICTION()
ExtendedIterator listAnnotationProperties()
Answer an iterator that ranges over the properties in this model that are declared to be annotation properties. Not all supported languages define annotation properties (the category of annotation properties is chiefly an OWL innovation).
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
Profile.getAnnotationProperties()
ExtendedIterator listAllDifferent()
Answer an iterator that ranges over the nodes that denote pair-wise disjointness between sets of classes.
Note: the number of nodes returned by this iterator will vary according to the completeness of the deductive extension of the underlying graph. See class overview for more details.
ExtendedIterator listDataRanges()
Answer an iterator over the DataRange objects in this ontology, if there are any.
DataRange
objects.Ontology getOntology(String uri)
Answer a resource that represents an ontology description node in this model. If a resource with the given uri exists in the model, and can be viewed as an Ontology, return the Ontology facet, otherwise return null.
uri
- The uri for the ontology node. Conventionally, this corresponds to the base URI
of the document itself.
Individual getIndividual(String uri)
Answer a resource that represents an Individual node in this model. If a resource with the given uri exists in the model, and can be viewed as an Individual, return the Individual facet, otherwise return null.
uri
- The URI for the requried individual
OntProperty getOntProperty(String uri)
Answer a resource representing an generic property in this model. If a property with the given uri exists in the model, return the OntProperty facet, otherwise return null.
uri
- The uri for the property.
ObjectProperty getObjectProperty(String uri)
Answer a resource representing an object property in this model. If a resource with the given uri exists in the model, and can be viewed as an ObjectProperty, return the ObjectProperty facet, otherwise return null.
uri
- The uri for the object property. May not be null.
TransitiveProperty getTransitiveProperty(String uri)
Answer a resource representing a transitive property. If a resource with the given uri exists in the model, and can be viewed as a TransitiveProperty, return the TransitiveProperty facet, otherwise return null.
uri
- The uri for the property. May not be null.
SymmetricProperty getSymmetricProperty(String uri)
Answer a resource representing a symmetric property. If a resource with the given uri exists in the model, and can be viewed as a SymmetricProperty, return the SymmetricProperty facet, otherwise return null.
uri
- The uri for the property. May not be null.
InverseFunctionalProperty getInverseFunctionalProperty(String uri)
Answer a resource representing an inverse functional property. If a resource with the given uri exists in the model, and can be viewed as a InverseFunctionalProperty, return the InverseFunctionalProperty facet, otherwise return null.
uri
- The uri for the property. May not be null.
DatatypeProperty getDatatypeProperty(String uri)
Answer a resource that represents datatype property in this model. . If a resource with the given uri exists in the model, and can be viewed as a DatatypeProperty, return the DatatypeProperty facet, otherwise return null.
uri
- The uri for the datatype property. May not be null.
AnnotationProperty getAnnotationProperty(String uri)
Answer a resource that represents an annotation property in this model. If a resource with the given uri exists in the model, and can be viewed as an AnnotationProperty, return the AnnotationProperty facet, otherwise return null.
uri
- The uri for the annotation property. May not be null.
OntClass getOntClass(String uri)
Answer a resource that represents a class description node in this model. If a resource with the given uri exists in the model, and can be viewed as an OntClass, return the OntClass facet, otherwise return null.
uri
- The uri for the class node, or null for an anonymous class.
ComplementClass getComplementClass(String uri)
Answer a resource representing the class that is the complement of another class. If a resource with the given uri exists in the model, and can be viewed as a ComplementClass, return the ComplementClass facet, otherwise return null.
uri
- The URI of the new complement class.
EnumeratedClass getEnumeratedClass(String uri)
Answer a resource representing the class that is the enumeration of a list of individuals. If a resource with the given uri exists in the model, and can be viewed as an EnumeratedClass, return the EnumeratedClass facet, otherwise return null.
uri
- The URI of the new enumeration class.
UnionClass getUnionClass(String uri)
Answer a resource representing the class that is the union of a list of class desctiptions. If a resource with the given uri exists in the model, and can be viewed as a UnionClass, return the UnionClass facet, otherwise return null.
uri
- The URI of the new union class.
IntersectionClass getIntersectionClass(String uri)
Answer a resource representing the class that is the intersection of a list of class descriptions. If a resource with the given uri exists in the model, and can be viewed as a IntersectionClass, return the IntersectionClass facet, otherwise return null.
uri
- The URI of the new intersection class.
Restriction getRestriction(String uri)
Answer a resource that represents a property restriction in this model. If a resource with the given uri exists in the model, and can be viewed as a Restriction, return the Restriction facet, otherwise return null.
uri
- The uri for the restriction node.
HasValueRestriction getHasValueRestriction(String uri)
Answer a class description defined as the class of those individuals that have the given resource as the value of the given property. If a resource with the given uri exists in the model, and can be viewed as a HasValueRestriction, return the HasValueRestriction facet, otherwise return null.
uri
- The URI for the restriction
SomeValuesFromRestriction getSomeValuesFromRestriction(String uri)
Answer a class description defined as the class of those individuals that have at least one property with a value belonging to the given class. If a resource with the given uri exists in the model, and can be viewed as a SomeValuesFromRestriction, return the SomeValuesFromRestriction facet, otherwise return null.
uri
- The URI for the restriction
AllValuesFromRestriction getAllValuesFromRestriction(String uri)
Answer a class description defined as the class of those individuals for which all values of the given property belong to the given class. If a resource with the given uri exists in the model, and can be viewed as an AllValuesFromResriction, return the AllValuesFromRestriction facet, otherwise return null.
uri
- The URI for the restriction
CardinalityRestriction getCardinalityRestriction(String uri)
Answer a class description defined as the class of those individuals that have exactly the given number of values for the given property. If a resource with the given uri exists in the model, and can be viewed as a CardinalityRestriction, return the CardinalityRestriction facet, otherwise return null.
uri
- The URI for the restriction
MinCardinalityRestriction getMinCardinalityRestriction(String uri)
Answer a class description defined as the class of those individuals that have at least the given number of values for the given property. If a resource with the given uri exists in the model, and can be viewed as a MinCardinalityRestriction, return the MinCardinalityRestriction facet, otherwise return null.
uri
- The URI for the restriction
MaxCardinalityRestriction getMaxCardinalityRestriction(String uri)
Answer a class description defined as the class of those individuals that have at most the given number of values for the given property. If a resource with the given uri exists in the model, and can be viewed as a MaxCardinalityRestriction, return the MaxCardinalityRestriction facet, otherwise return null.
uri
- The URI for the restriction
QualifiedRestriction getQualifiedRestriction(String uri)
Answer a class description defined as the class of those individuals that have a property p, all values of which are members of a given class. Typically used with a cardinality constraint. If a resource with the given uri exists in the model, and can be viewed as a QualifiedRestriction, return the QualifiedRestriction facet, otherwise return null.
uri
- The URI for the restriction
CardinalityQRestriction getCardinalityQRestriction(String uri)
Answer a class description defined as the class of those individuals that have a property p, with cardinality N, all values of which are members of a given class. If a resource with the given uri exists in the model, and can be viewed as a CardinalityQRestriction, return the CardinalityQRestriction facet, otherwise return null.
uri
- The URI for the restriction
MinCardinalityQRestriction getMinCardinalityQRestriction(String uri)
Answer a class description defined as the class of those individuals that have a property p, with min cardinality N, all values of which are members of a given class. If a resource with the given uri exists in the model, and can be viewed as a MinCardinalityQRestriction, return the MinCardinalityQRestriction facet, otherwise return null.
uri
- The URI for the restriction
MaxCardinalityQRestriction getMaxCardinalityQRestriction(String uri)
Answer a class description defined as the class of those individuals that have a property p, with max cardinality N, all values of which are members of a given class. If a resource with the given uri exists in the model, and can be viewed as a MaxCardinalityQRestriction, return the MaxCardinalityQRestriction facet, otherwise return null.
uri
- The URI for the restriction
Ontology createOntology(String uri)
Answer a resource that represents an ontology description node in this model. If a resource with the given uri exists in the model, it will be re-used. If not, a new one is created in the updateable sub-model of the ontology model.
uri
- The uri for the ontology node. Conventionally, this corresponds to the base URI
of the document itself.
Individual createIndividual(Resource cls)
Answer a resource that represents an Indvidual node in this model. A new anonymous resource will be created in the updateable sub-model of the ontology model.
cls
- Resource representing the ontology class to which the individual belongs
Individual createIndividual(String uri, Resource cls)
Answer a resource that represents an Individual node in this model. If a resource with the given uri exists in the model, it will be re-used. If not, a new one is created in the updateable sub-model of the ontology model.
cls
- Resource representing the ontology class to which the individual belongsuri
- The uri for the individual, or null for an anonymous individual.
OntProperty createOntProperty(String uri)
Answer a resource representing an generic property in this model. Effectively
this method is an alias for ModelCon.createProperty( String )
, except that
the return type is OntProperty
, which allow more convenient access to
a property's position in the property hierarchy, domain, range, etc.
uri
- The uri for the property. May not be null.
ObjectProperty createObjectProperty(String uri)
Answer a resource representing an object property in this model, and that is not a functional property.
uri
- The uri for the object property. May not be null.
createObjectProperty( String, boolean )
ObjectProperty createObjectProperty(String uri, boolean functional)
Answer a resource that represents an object property in this model. An object property is defined to have a range of individuals, rather than datatypes. If a resource with the given uri exists in the model, it will be re-used. If not, a new one is created in the updateable sub-model of the ontology model.
uri
- The uri for the object property. May not be null.functional
- If true, the resource will also be typed as a FunctionalProperty
,
that is, a property that has a unique range value for any given domain value.
TransitiveProperty createTransitiveProperty(String uri)
Answer a resource representing a transitive property
uri
- The uri for the property. May not be null.
createTransitiveProperty( String, boolean )
TransitiveProperty createTransitiveProperty(String uri, boolean functional)
Answer a resource representing a transitive property, which is optionally also functional. Note: although it is permitted in OWL full to have functional transitive properties, it makes the language undecideable. Functional transitive properties are not permitted in OWL Lite or OWL DL.
uri
- The uri for the property. May not be null.functional
- If true, the property is also functional
SymmetricProperty createSymmetricProperty(String uri)
Answer a resource representing a symmetric property
uri
- The uri for the property. May not be null.
createSymmetricProperty( String, boolean )
SymmetricProperty createSymmetricProperty(String uri, boolean functional)
Answer a resource representing a symmetric property, which is optionally also functional.
uri
- The uri for the property. May not be null.functional
- If true, the property is also functional
InverseFunctionalProperty createInverseFunctionalProperty(String uri)
Answer a resource representing an inverse functional property
uri
- The uri for the property. May not be null.
createInverseFunctionalProperty( String, boolean )
InverseFunctionalProperty createInverseFunctionalProperty(String uri, boolean functional)
Answer a resource representing an inverse functional property, which is optionally also functional.
uri
- The uri for the property. May not be null.functional
- If true, the property is also functional
DatatypeProperty createDatatypeProperty(String uri)
Answer a resource that represents datatype property in this model, and that is not a functional property.
uri
- The uri for the datatype property. May not be null.
createDatatypeProperty( String, boolean )
DatatypeProperty createDatatypeProperty(String uri, boolean functional)
Answer a resource that represents datatype property in this model. A datatype property is defined to have a range that is a concrete datatype, rather than an individual. If a resource with the given uri exists in the model, it will be re-used. If not, a new one is created in the updateable sub-model of the ontology model.
uri
- The uri for the datatype property. May not be null.functional
- If true, the resource will also be typed as a FunctionalProperty
,
that is, a property that has a unique range value for any given domain value.
AnnotationProperty createAnnotationProperty(String uri)
Answer a resource that represents an annotation property in this model. If a resource with the given uri exists in the model, it will be re-used. If not, a new one is created in the updateable sub-model of the ontology model.
uri
- The uri for the annotation property. May not be null.
OntClass createClass()
Answer a resource that represents an anonymous class description in this model. A new
anonymous resource of rdf:type C
, where C is the class type from the
language profile.
OntClass createClass(String uri)
Answer a resource that represents a class description node in this model. If a resource with the given uri exists in the model, it will be re-used. If not, a new one is created in the updateable sub-model of the ontology model.
uri
- The uri for the class node, or null for an anonymous class.
ComplementClass createComplementClass(String uri, Resource cls)
Answer a resource representing the class that is the complement of the given argument class
uri
- The URI of the new complement class, or null for an anonymous class description.cls
- Resource denoting the class that the new class is a complement of
EnumeratedClass createEnumeratedClass(String uri, RDFList members)
Answer a resource representing the class that is the enumeration of the given list of individuals
uri
- The URI of the new enumeration class, or null for an anonymous class description.members
- An optional list of resources denoting the individuals in the enumeration, or null.
UnionClass createUnionClass(String uri, RDFList members)
Answer a resource representing the class that is the union of the given list of class desctiptions
uri
- The URI of the new union class, or null for an anonymous class description.members
- A list of resources denoting the classes that comprise the union
IntersectionClass createIntersectionClass(String uri, RDFList members)
Answer a resource representing the class that is the intersection of the given list of class descriptions.
uri
- The URI of the new intersection class, or null for an anonymous class description.members
- A list of resources denoting the classes that comprise the intersection
Restriction createRestriction(Property p)
Answer a resource that represents an anonymous property restriction in this model. A new
anonymous resource of rdf:type R
, where R is the restriction type from the
language profile.
p
- The property that is restricted by this restriction, or null to omit from the restriction
Restriction createRestriction(String uri, Property p)
Answer a resource that represents a property restriction in this model. If a resource with the given uri exists in the model, it will be re-used. If not, a new one is created in the updateable sub-model of the ontology model.
uri
- The uri for the restriction node, or null for an anonymous restriction.p
- The property that is restricted by this restriction, or null to omit from the restriction
HasValueRestriction createHasValueRestriction(String uri, Property prop, RDFNode value)
Answer a class description defined as the class of those individuals that have the given resource as the value of the given property
uri
- The optional URI for the restriction, or null for an anonymous restriction (which
should be the normal case)prop
- The property the restriction applies tovalue
- The value of the property, as a resource or RDF literal
SomeValuesFromRestriction createSomeValuesFromRestriction(String uri, Property prop, Resource cls)
Answer a class description defined as the class of those individuals that have at least one property with a value belonging to the given class
uri
- The optional URI for the restriction, or null for an anonymous restriction (which
should be the normal case)prop
- The property the restriction applies tocls
- The class to which at least one value of the property belongs
AllValuesFromRestriction createAllValuesFromRestriction(String uri, Property prop, Resource cls)
Answer a class description defined as the class of those individuals for which all values of the given property belong to the given class
uri
- The optional URI for the restriction, or null for an anonymous restriction (which
should be the normal case)prop
- The property the restriction applies tocls
- The class to which any value of the property belongs
CardinalityRestriction createCardinalityRestriction(String uri, Property prop, int cardinality)
Answer a class description defined as the class of those individuals that have exactly the given number of values for the given property.
uri
- The optional URI for the restriction, or null for an anonymous restriction (which
should be the normal case)prop
- The property the restriction applies tocardinality
- The exact cardinality of the property
MinCardinalityRestriction createMinCardinalityRestriction(String uri, Property prop, int cardinality)
Answer a class description defined as the class of those individuals that have at least the given number of values for the given property.
uri
- The optional URI for the restriction, or null for an anonymous restriction (which
should be the normal case)prop
- The property the restriction applies tocardinality
- The minimum cardinality of the property
MaxCardinalityRestriction createMaxCardinalityRestriction(String uri, Property prop, int cardinality)
Answer a class description defined as the class of those individuals that have at most the given number of values for the given property.
uri
- The optional URI for the restriction, or null for an anonymous restriction (which
should be the normal case)prop
- The property the restriction applies tocardinality
- The maximum cardinality of the property
MaxCardinalityQRestriction createMaxCardinalityQRestriction(String uri, Property prop, int cardinality, OntClass cls)
Answer a class description defined as the class of those individuals that have at most the given number of values for the given property, all values of which belong to the given class.
uri
- The optional URI for the restriction, or null for an anonymous restriction (which
should be the normal case)prop
- The property the restriction applies tocardinality
- The maximum cardinality of the propertycls
- The class to which all values of the restricted property should belong
MinCardinalityQRestriction createMinCardinalityQRestriction(String uri, Property prop, int cardinality, OntClass cls)
Answer a class description defined as the class of those individuals that have at least the given number of values for the given property, all values of which belong to the given class.
uri
- The optional URI for the restriction, or null for an anonymous restriction (which
should be the normal case)prop
- The property the restriction applies tocardinality
- The minimun cardinality of the propertycls
- The class to which all values of the restricted property should belong
CardinalityQRestriction createCardinalityQRestriction(String uri, Property prop, int cardinality, OntClass cls)
Answer a class description defined as the class of those individuals that have exactly the given number of values for the given property, all values of which belong to the given class.
uri
- The optional URI for the restriction, or null for an anonymous restriction (which
should be the normal case)prop
- The property the restriction applies tocardinality
- The cardinality of the propertycls
- The class to which all values of the restricted property should belong
DataRange createDataRange(RDFList literals)
Answer a data range defined as the given set of concrete data values. DataRange resources are necessarily bNodes.
literals
- A list of literals that will be the members of the data range,
or null to define an empty data range
AllDifferent createAllDifferent()
Answer a new, anonymous node representing the fact that a given set of classes are all
pair-wise distinct. AllDifferent
is a feature of OWL only, and is something
of an anomoly in that it exists only to give a place to anchor the distinctMembers
property, which is the actual expression of the fact.
AllDifferent createAllDifferent(RDFList differentMembers)
Answer a new, anonymous node representing the fact that a given set of classes are all
pair-wise distinct. AllDifferent
is a feature of OWL only, and is something
of an anomoly in that it exists only to give a place to anchor the distinctMembers
property, which is the actual expression of the fact.
differentMembers
- A list of the class expressions that denote a set of mutually disjoint classes
OntResource createOntResource(Class javaClass, Resource rdfType, String uri)
Answer a resource that represents a generic ontology node in this model. If a resource with the given uri exists in the model, it will be re-used. If not, a new one is created in the updateable sub-model of the ontology model.
This is a generic method for creating any known ontology value. The selector that determines
which resource to create is the same as as the argument to the as()
method: the Java class object of the desired abstraction. For example, to create an
ontology class via this mechanism, use:
OntClass c = (OntClass) myModel.createOntResource( OntClass.class, null,
"http://example.org/ex#Parrot" );
javaClass
- The Java class object that represents the ontology abstraction to createrdfType
- Optional resource denoting the ontology class to which an individual or
axiom belongs, if that is the type of resource being created.uri
- The uri for the ontology resource, or null for an anonymous resource.
javaClass
Set listImportedOntologyURIs()
Answer a list of the imported URI's in this ontology model. Detection of imports
statments will be according to the local language profile. Note that, in order to allow this
method to be called during the imports closure process, we only query the base model,
thus side-stepping the any attached reasoner.
Set listImportedOntologyURIs(boolean closure)
Answer a list of the imported URI's in this ontology model, and optionally in the closure
of this model's imports. Detection of imports
statments will be according to the local language profile. Note that, in order to allow this
method to be called during the imports closure process, we only query the base model,
thus side-stepping the any attached reasoner.
closure
- If true, the set of uri's returned will include not only those directly
imported by this model, but those imported by the model's imports transitively.
boolean hasLoadedImport(String uri)
Answer true if this model has had the given URI document imported into it. This is important to know since an import only occurs once, and we also want to be able to detect cycles of imports.
uri
- An ontology URI
void addLoadedImport(String uri)
Record that this model has now imported the document with the given URI, so that it will not be re-imported in the future.
uri
- A document URI that has now been imported into the model.void removeLoadedImport(String uri)
Record that this model no longer imports the document with the given URI.
uri
- A document URI that is no longer imported into the model.Profile getProfile()
Answer the language profile (for example, OWL or DAML+OIL) that this model is working to.
ModelMaker getModelMaker()
Answer the model maker associated with this model (used for constructing the constituent models of the imports closure).
ModelMaker getImportModelMaker()
Answer the model maker associated with this model (used for constructing the constituent models of the imports closure).
List getSubGraphs()
Answer the sub-graphs of this model. A sub-graph is defined as a graph that is used to contain the triples from an imported document.
ExtendedIterator listImportedModels()
Answer an iterator over the ontologies that this ontology imports,
each of which will have been wrapped as an ontology model using the same
OntModelSpec
as this model. If this model has no imports,
the iterator will be non-null but will not have any values.
OntModel
representing an imported ontology.OntModel getImportedModel(String uri)
Answer an OntModel
representing the imported ontology
with the given URI. If an ontology with that URI has not been imported,
answer null.
uri
- The URI of an ontology that may have been imported into the
ontology represented by this model
Model getBaseModel()
Answer the base model of this model. The base model is the model
that contains the triples read from the source document for this
ontology. It is therefore this base model that will be updated if statements are
added to a model that is built from a union of documents (via the
imports
statements in the source document).
void addSubModel(Model model)
Add the given model as one of the sub-models of the enclosed ontology union model. Will cause the associated infererence engine (if any) to update, so this may be an expensive operation in some cases.
model
- A sub-model to addaddSubModel( Model, boolean )
void addSubModel(Model model, boolean rebind)
Add the given model as one of the sub-models of the enclosed ontology union model.
model
- A sub-model to addrebind
- If true, rebind any associated inferencing engine to the new data (which
may be an expensive operation)void removeSubModel(Model model)
Remove the given model as one of the sub-models of the enclosed ontology union model. Will cause the associated infererence engine (if any) to update, so this may be an expensive operation in some cases.
model
- A sub-model to removeaddSubModel( Model, boolean )
void removeSubModel(Model model, boolean rebind)
Remove the given model as one of the sub-models of the enclosed ontology union model.
model
- A sub-model to removerebind
- If true, rebind any associated inferencing engine to the new data (which
may be an expensive operation)boolean isInBaseModel(RDFNode node)
Answer true if the given node is a member of the base model of this ontology model. This is an important distiction, because only the base model receives updates when the ontology model is updated. Thus, removing properties of a resource that is not in the base model will not actually side-effect the overall model.
node
- An RDF node (Resource, Property or Literal) to test
boolean isInBaseModel(Statement stmt)
Answer true if the given statement is defined in the base model of this ontology model. This is an important distiction, because only the base model receives updates when the ontology model is updated. Thus, removing a statement that is not in the base model will not actually side-effect the overall model.
stmt
- A statement to test
boolean strictMode()
Answer true if this model is currently in strict checking mode. Strict mode means that converting a common resource to a particular language element, such as an ontology class, will be subject to some simple syntactic-level checks for appropriateness.
void setStrictMode(boolean strict)
Set the checking mode to strict or non-strict.
strict
- strictMode()
void setDynamicImports(boolean dynamic)
Set the flag that controls whether adding or removing imports statements into the model will result in the imports closure changing dynamically.
dynamic
- If true, adding or removing an imports statement to the
model will result in a change in the imports closure. If false, changes
to the imports are not monitored dynamically. Default false.boolean getDynamicImports()
Answer true if the imports closure of the model will be dynamically updated as imports statements are added and removed.
OntDocumentManager getDocumentManager()
Answer a reference to the document manager that this model is using to manage ontology <-> mappings, and to load the imports closure. Note by default, an ontology model is constructed with a reference to the shared, global document manager. Thus changing the settings via this model's document manager may affect other models also using the same instance.
OntModelSpec getSpecification()
Answer the ontology model specification that was used to construct this model
ExtendedIterator queryFor(BindingQueryPlan query, List altQueries, Class asKey)
Answer the iterator over the resources from the graph that satisfy the given
query, followed by the answers to the alternative queries (if specified). A
typical scenario is that the main query gets resources of a given class (say,
rdfs:Class
), while the altQueries query for aliases for that
type (such as daml:Class
).
query
- A query to run against the modelaltQueries
- An optional list of subsidiary queries to chain on to the first
Resource getOWLLanguageLevel(List problems)
If this OntModel is presenting an OWL model, answer the minimum OWL language
level that the constructs
used in this model lie entirely within. The three possible return values are
FULL_LANG
for OWL-full,
DL_LANG
for OWL-DL or
LITE_LANG
for OWL-lite.
Note that these URI's are not officially sanctioned by the WebOnt
working group. For unknown reasons, the working group chose not to assign official
URI's to represent the different OWL language levels. There is a slim chance that this
may change in future, in which case these return values will change apropriately.
In addition to the method return value,
the given problems list, if non-null, will be filled with the syntax
problems detected by the syntax checker.
The Jena OWL syntax checker will normally list as problems those constructs used in this model that are in OWL Full but not permitted in OWL DL. The exception to this is if the language profile for this model is OWL Lite, then the syntax checker will test for constructs that lie in OWL-DL or OWL-Full and hence outside in OWL-Lite.
Note that peforming this test requires every statement in the model to be examined, so it can be quite an expensive operation on large models, or on persistent database models.
problems
- A list that, if non-null, will have the various problems discovered by the OWL syntax
checker added to it.
OntologyException
- if this model is not an OWL modelModel write(Writer writer)
Write the model as an XML document.
It is often better to use an OutputStream rather than a Writer, since this
will avoid character encoding errors.
Note: This method is adapted for the ontology
model to write out only the base model (which contains the asserted data). To write
all triples, including imported data and inferred triples, use
writeAll
.
write
in interface Model
writer
- A writer to which the XML will be written
Model write(Writer writer, String lang)
Write a serialized represention of a model in a specified language.
It is often better to use an OutputStream rather than a Writer, since this
will avoid character encoding errors.
Note: This method is adapted for the ontology
model to write out only the base model (which contains the asserted data). To write
all triples, including imported data and inferred triples, use
writeAll
.
The language in which to write the model is specified by the
lang
argument. Predefined values are "RDF/XML",
"RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
represented by null
is "RDF/XML".
write
in interface Model
writer
- The output writerlang
- The output language
Model write(Writer writer, String lang, String base)
Write a serialized represention of a model in a specified language.
It is often better to use an OutputStream rather than a Writer,
since this will avoid character encoding errors.
Note: This method is adapted for the ontology
model to write out only the base model (which contains the asserted data). To write
all triples, including imported data and inferred triples, use
writeAll
.
The language in which to write the model is specified by the
lang
argument. Predefined values are "RDF/XML",
"RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
represented by null
, is "RDF/XML".
write
in interface Model
writer
- The output writerbase
- The base uri for relative URI calculations.
null
means use only absolute URI's.lang
- The language in which the RDF should be written
Model write(OutputStream out)
Write a serialization of this model as an XML document.
Note: This method is adapted for the ontology
model to write out only the base model (which contains the asserted data). To write
all triples, including imported data and inferred triples, use
writeAll
.
The language in which to write the model is specified by the
lang
argument. Predefined values are "RDF/XML",
"RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value is
represented by null
is "RDF/XML".
write
in interface Model
out
- The output stream to which the XML will be written
Model write(OutputStream out, String lang)
Write a serialized represention of this model in a specified language.
Note: This method is adapted for the ontology
model to write out only the base model (which contains the asserted data). To write
all triples, including imported data and inferred triples, use
writeAll
.
The language in which to write the model is specified by the
lang
argument. Predefined values are "RDF/XML",
"RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
represented by null
, is "RDF/XML".
write
in interface Model
out
- The output stream to which the RDF is writtenlang
- The output langauge
Model write(OutputStream out, String lang, String base)
Write a serialized represention of a model in a specified language.
Note: This method is adapted for the ontology
model to write out only the base model (which contains the asserted data). To write
all triples, including imported data and inferred triples, use
writeAll
.
The language in which to write the model is specified by the
lang
argument. Predefined values are "RDF/XML",
"RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
represented by null
, is "RDF/XML".
write
in interface Model
out
- The output stream to which the RDF is writtenbase
- The base uri to use when writing relative URI's. null
means use only absolute URI's.lang
- The language in which the RDF should be written
Model writeAll(Writer writer, String lang, String base)
Write a serialized represention of all of the contents of the model,
including inferred statements and statements imported from other
documents. To write only the data asserted in the base model, use
write
.
It is often better to use an OutputStream rather than a Writer,
since this will avoid character encoding errors.
The language in which to write the model is specified by the
lang
argument. Predefined values are "RDF/XML",
"RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
represented by null
, is "RDF/XML".
writer
- The output writerbase
- The base uri for relative URI calculations.
null
means use only absolute URI's.lang
- The language in which the RDF should be written
Model writeAll(OutputStream out, String lang, String base)
Write a serialized represention of all of the contents of the model,
including inferred statements and statements imported from other
documents. To write only the data asserted in the base model, use
write
.
The language in which to write the model is specified by the
lang
argument. Predefined values are "RDF/XML",
"RDF/XML-ABBREV", "N-TRIPLE" and "N3". The default value,
represented by null
, is "RDF/XML".
out
- The output stream to which the RDF is writtenbase
- The base uri to use when writing relative URI's. null
means use only absolute URI's.lang
- The language in which the RDF should be written
com.hp.hpl.jena.ontology.event.OntEventManager getEventManager()
Answer the ontology event manager for this model.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |