| com.hp.hpl.jena.ontology.impl.OntResourceImpl com.hp.hpl.jena.ontology.impl.IndividualImpl
IndividualImpl | public class IndividualImpl extends OntResourceImpl implements Individual(Code) | |
Implementation for the ontology abstraction representing ontology class descriptions.
author: Ian Dickinson, HP Labs author: (email) version: CVS $Id: IndividualImpl.java,v 1.17 2008/01/23 12:47:00 ian_dickinson Exp $ |
Field Summary | |
public static Implementation | factory A factory for generating Individual facets from nodes in enhanced graphs. |
Constructor Summary | |
public | IndividualImpl(Node n, EnhGraph g)
Construct an individual represented by the given node in the given graph. |
Method Summary | |
public void | addOntClass(Resource cls) Add the given ontology class as one of the classes to which
this individual belongs. | public OntClass | getOntClass()
Answer an ontology class to which this individual belongs. | public OntClass | getOntClass(boolean direct)
Answer an ontology class to which this individual belongs. | public boolean | hasOntClass(Resource ontClass, boolean direct)
Answer true if this individual is a member of the class denoted by the
given class resource.
Parameters: ontClass - Denotes an ontology class to which this individual may belong Parameters: direct - If true, only consider the direct types of this individual, ignoringthe super-classes of the stated types. | public boolean | hasOntClass(Resource ontClass)
Answer true if this individual is a member of the class denoted by the
given ontology class resource. | public boolean | hasOntClass(String uri) | public ExtendedIterator | listOntClasses(boolean direct)
Answer an iterator over the ontology classes to which this individual belongs.
The members of the iterator will be
OntClass objects.
Parameters: direct - If true, only answer those resources that are direct typesof this individual, not the super-classes of the class etc. | public void | removeOntClass(Resource ontClass) Attempt to remove this individual as a member of the
given ontology class. | public void | setOntClass(Resource cls) Set the ontology class for this individual, replacing any
existing class membership. |
IndividualImpl | public IndividualImpl(Node n, EnhGraph g)(Code) | |
Construct an individual represented by the given node in the given graph.
Parameters: n - The node that represents the resource Parameters: g - The enh graph that contains n |
addOntClass | public void addOntClass(Resource cls)(Code) | | Add the given ontology class as one of the classes to which
this individual belongs. Class membership is encoded using the
rdf:type property.
Parameters: cls - An RDF resource denoting an additional class to which this individualbelongs. |
getOntClass | public OntClass getOntClass()(Code) | |
Answer an ontology class to which this individual belongs. If the individual
belongs to more than one class, which is common in ontology models using
a reasoner, then the return value will be one of
the possible values but it is not specified which one.
In the case of multiple classes, callers should not rely on
the return value being consistent, e.g. across runs, since it may
depend on the underlying hash indexes in the model.
This method considers any ontology class for the individual, not just
direct classes. It is equivalent to getOntClass(false) .
A resource denoting the ontology class for this individual, or one of them ifmore than one is defined. exception: ConversionException - if the return value is known to be anontology class, assuming strict type checking is turned on for the underlyingOntModel . See OntModel.setStrictMode(boolean) |
getOntClass | public OntClass getOntClass(boolean direct)(Code) | |
Answer an ontology class to which this individual belongs. If the resource
belongs to more than one class, which is common in ontology models using
a reasoner, then the return value will be one of
the possible values but it is not specified which one.
In the case of multiple classes, callers should not rely on
the return value being consistent, e.g. across runs, since it may
depend on the underlying hash indexes in the model.
Parameters: direct - If true , only direct classes are considered.A class is a direct class of this Individual if and only ifthere is no other resource is both an rdf:type of thisindividual and a sub-class of the candidate class. A resource denoting the ontology class for this individual, or one of them ifmore than one is defined. exception: ConversionException - if the return value is known to be anontology class, assuming strict type checking is turned on for the underlyingOntModel . See OntModel.setStrictMode(boolean) |
hasOntClass | public boolean hasOntClass(Resource ontClass, boolean direct)(Code) | |
Answer true if this individual is a member of the class denoted by the
given class resource.
Parameters: ontClass - Denotes an ontology class to which this individual may belong Parameters: direct - If true, only consider the direct types of this individual, ignoringthe super-classes of the stated types. True if this individual is a member of the given class, possibly taking thedirectness constraint into account. |
hasOntClass | public boolean hasOntClass(Resource ontClass)(Code) | |
Answer true if this individual is a member of the class denoted by the
given ontology class resource. Not limited to only direct class relationships,
so this is equivalent to:
hasOntClass( ontClass, false );
Parameters: ontClass - Denotes a class to which this individual may belong True if this individual has the given class as one of its rdf:type 's. |
hasOntClass | public boolean hasOntClass(String uri)(Code) | |
Answer true if this individual is a member of the class denoted by the
given URI.
Parameters: uri - Denotes the URI of a class to which this value may belong True if this individual has the given class as one of its rdf:type 's. |
listOntClasses | public ExtendedIterator listOntClasses(boolean direct)(Code) | |
Answer an iterator over the ontology classes to which this individual belongs.
The members of the iterator will be
OntClass objects.
Parameters: direct - If true, only answer those resources that are direct typesof this individual, not the super-classes of the class etc. An iterator over the set of this individual's classes. Each memberof the iteration will be an OntClass. |
removeOntClass | public void removeOntClass(Resource ontClass)(Code) | | Attempt to remove this individual as a member of the
given ontology class. This relationship is represented by a rdf:type
statement in the underlying model. If this relationship was originally
asserted, then removal will always succeed. However, if the rdf:type
relationship is entailed by the action of an attached reasoner, it may not be
possible to directly remove it. Callers should instead update the assertions
and axioms that entail the class membership relationship, and ensure the
reasoner gets chance to update the entailments.
If this individual is not a member of the given class, the
operation has no effect.
Parameters: ontClass - A resource denoting a class that that is to be removed fromthe set of classes to which this individual belongs |
setOntClass | public void setOntClass(Resource cls)(Code) | | Set the ontology class for this individual, replacing any
existing class membership. Class membership is encoded using the
rdf:type property. Any existing statements for the RDF type
will first be removed.
Parameters: cls - The RDF resource denoting the new class to which this individual belongs,which will replace any existing rdf:type property. |
Methods inherited from com.hp.hpl.jena.ontology.impl.OntResourceImpl | public void addComment(String comment, String lang)(Code)(Java Doc) public void addComment(Literal comment)(Code)(Java Doc) public void addDifferentFrom(Resource res)(Code)(Java Doc) public void addIsDefinedBy(Resource res)(Code)(Java Doc) public void addLabel(String label, String lang)(Code)(Java Doc) public void addLabel(Literal label)(Code)(Java Doc) protected void addListPropertyValue(Property p, String name, RDFNode value)(Code)(Java Doc) protected void addPropertyValue(Property p, String name, RDFNode value)(Code)(Java Doc) public void addRDFType(Resource cls)(Code)(Java Doc) public void addSameAs(Resource res)(Code)(Java Doc) public void addSeeAlso(Resource res)(Code)(Java Doc) public void addVersionInfo(String info)(Code)(Java Doc) public AllDifferent asAllDifferent()(Code)(Java Doc) public AnnotationProperty asAnnotationProperty()(Code)(Java Doc) public OntClass asClass()(Code)(Java Doc) public DataRange asDataRange()(Code)(Java Doc) public DatatypeProperty asDatatypeProperty()(Code)(Java Doc) public Individual asIndividual()(Code)(Java Doc) public ObjectProperty asObjectProperty()(Code)(Java Doc) public Ontology asOntology()(Code)(Java Doc) public OntProperty asProperty()(Code)(Java Doc) protected void checkProfile(Object term, String name)(Code)(Java Doc) protected RDFNode convertToType(Resource type, String name, Class cls)(Code)(Java Doc) public int getCardinality(Property p)(Code)(Java Doc) public String getComment(String lang)(Code)(Java Doc) public OntResource getDifferentFrom()(Code)(Java Doc) public Resource getIsDefinedBy()(Code)(Java Doc) public String getLabel(String lang)(Code)(Java Doc) public OntModel getOntModel()(Code)(Java Doc) public Profile getProfile()(Code)(Java Doc) public RDFNode getPropertyValue(Property property)(Code)(Java Doc) public Resource getRDFType()(Code)(Java Doc) public Resource getRDFType(boolean direct)(Code)(Java Doc) public OntResource getSameAs()(Code)(Java Doc) public Resource getSeeAlso()(Code)(Java Doc) public String getVersionInfo()(Code)(Java Doc) public boolean hasComment(String comment, String lang)(Code)(Java Doc) public boolean hasComment(Literal comment)(Code)(Java Doc) public boolean hasLabel(String label, String lang)(Code)(Java Doc) public boolean hasLabel(Literal label)(Code)(Java Doc) protected boolean hasPropertyValue(Property p, String name, RDFNode value)(Code)(Java Doc) public boolean hasRDFType(String uri)(Code)(Java Doc) public boolean hasRDFType(Resource ontClass)(Code)(Java Doc) public boolean hasRDFType(Resource ontClass, boolean direct)(Code)(Java Doc) protected boolean hasRDFType(Resource ontClass, String name, boolean direct)(Code)(Java Doc) public boolean hasSeeAlso(Resource res)(Code)(Java Doc) protected static boolean hasType(Node n, EnhGraph g, Resource type)(Code)(Java Doc) public boolean hasVersionInfo(String info)(Code)(Java Doc) public boolean isAllDifferent()(Code)(Java Doc) public boolean isAnnotationProperty()(Code)(Java Doc) public boolean isClass()(Code)(Java Doc) public boolean isDataRange()(Code)(Java Doc) public boolean isDatatypeProperty()(Code)(Java Doc) public boolean isDefinedBy(Resource res)(Code)(Java Doc) public boolean isDifferentFrom(Resource res)(Code)(Java Doc) public boolean isIndividual()(Code)(Java Doc) public boolean isObjectProperty()(Code)(Java Doc) public boolean isOntLanguageTerm()(Code)(Java Doc) public boolean isOntology()(Code)(Java Doc) public boolean isProperty()(Code)(Java Doc) public boolean isSameAs(Resource res)(Code)(Java Doc) protected boolean langTagMatch(String desired, String target)(Code)(Java Doc) protected ExtendedIterator listAs(Property p, String name, Class cls)(Code)(Java Doc) public ExtendedIterator listComments(String lang)(Code)(Java Doc) public ExtendedIterator listDifferentFrom()(Code)(Java Doc) protected ExtendedIterator listDirectPropertyValues(Property p, String name, Class cls, Property orderRel, boolean direct, boolean inverse)(Code)(Java Doc) public ExtendedIterator listIsDefinedBy()(Code)(Java Doc) public ExtendedIterator listLabels(String lang)(Code)(Java Doc) public NodeIterator listPropertyValues(Property property)(Code)(Java Doc) public ExtendedIterator listRDFTypes(boolean direct)(Code)(Java Doc) public ExtendedIterator listSameAs()(Code)(Java Doc) public ExtendedIterator listSeeAlso()(Code)(Java Doc) public ExtendedIterator listVersionInfo()(Code)(Java Doc) protected Object objectAs(Property p, String name, Class asClass)(Code)(Java Doc) protected int objectAsInt(Property p, String name)(Code)(Java Doc) protected OntProperty objectAsProperty(Property p, String name)(Code)(Java Doc) protected OntResource objectAsResource(Property p, String name)(Code)(Java Doc) public void remove()(Code)(Java Doc) public void removeComment(String comment, String lang)(Code)(Java Doc) public void removeComment(Literal comment)(Code)(Java Doc) public void removeDefinedBy(Resource res)(Code)(Java Doc) public void removeDifferentFrom(Resource res)(Code)(Java Doc) public void removeLabel(String label, String lang)(Code)(Java Doc) public void removeLabel(Literal label)(Code)(Java Doc) public void removeProperty(Property property, RDFNode value)(Code)(Java Doc) protected void removePropertyValue(Property prop, String name, RDFNode value)(Code)(Java Doc) public void removeRDFType(Resource cls)(Code)(Java Doc) public void removeSameAs(Resource res)(Code)(Java Doc) public void removeSeeAlso(Resource res)(Code)(Java Doc) public void removeVersionInfo(String info)(Code)(Java Doc) protected String selectLang(StmtIterator stmts, String lang)(Code)(Java Doc) public void setComment(String comment, String lang)(Code)(Java Doc) public void setDifferentFrom(Resource res)(Code)(Java Doc) public void setIsDefinedBy(Resource res)(Code)(Java Doc) public void setLabel(String label, String lang)(Code)(Java Doc) public void setPropertyValue(Property property, RDFNode value)(Code)(Java Doc) protected void setPropertyValue(Property p, String name, RDFNode value)(Code)(Java Doc) public void setRDFType(Resource cls)(Code)(Java Doc) public void setSameAs(Resource res)(Code)(Java Doc) public void setSeeAlso(Resource res)(Code)(Java Doc) public void setVersionInfo(String info)(Code)(Java Doc)
|
|
|