OWLIndividual.java revision 13
2ronwalf// The MIT License
2ronwalf//
2ronwalf// Copyright (c) 2004 Evren Sirin
2ronwalf//
2ronwalf// Permission is hereby granted, free of charge, to any person obtaining a copy
2ronwalf// of this software and associated documentation files (the "Software"), to
2ronwalf// deal in the Software without restriction, including without limitation the
2ronwalf// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
2ronwalf// sell copies of the Software, and to permit persons to whom the Software is
2ronwalf// furnished to do so, subject to the following conditions:
2ronwalf//
2ronwalf// The above copyright notice and this permission notice shall be included in
2ronwalf// all copies or substantial portions of the Software.
2ronwalf//
2ronwalf// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
2ronwalf// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
2ronwalf// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2ronwalf// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2ronwalf// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2ronwalf// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2ronwalf// IN THE SOFTWARE.
2ronwalf
2ronwalf/*
2ronwalf * Created on Dec 27, 2003
2ronwalf *
2ronwalf */
2ronwalfpackage org.mindswap.owl;
2ronwalf
2ronwalfimport java.net.URI;
2ronwalfimport java.util.Map;
2ronwalfimport java.util.Set;
2ronwalf
2ronwalf
2ronwalf/**
2ronwalf * The interface for OWL individuals.
2ronwalf *
2ronwalf * @author Evren Sirin
2ronwalf *
2ronwalf */
2ronwalfpublic interface OWLIndividual extends OWLEntity, OWLValue {
2ronwalf /**
2ronwalf * Return true if a value for the given property exists.
2ronwalf *
2ronwalf * @param propURI
2ronwalf * @return
2ronwalf */
2ronwalf public boolean hasProperty(OWLProperty prop);
2ronwalf
2ronwalf /**
2ronwalf * Return true if the given value for the property exists.
2ronwalf *
2ronwalf * @param propURI
2ronwalf * @return
2ronwalf */
2ronwalf public boolean hasProperty(OWLProperty prop, OWLValue value);
2ronwalf
2ronwalf /**
2ronwalf * Get the value for the given object property. If the resource has more than one value for this property
2ronwalf * a random one will be returned
2ronwalf *
2ronwalf * @param propURI
2ronwalf * @return
2ronwalf */
2ronwalf public OWLIndividual getProperty(OWLObjectProperty prop);
2ronwalf
2ronwalf
2ronwalf /**
2ronwalf * Get all the values for the given object property.
2ronwalf *
2ronwalf * @param propURI
2ronwalf * @return
2ronwalf */
2ronwalf public OWLIndividualList getProperties(OWLObjectProperty prop);
2ronwalf
2ronwalf /**
2ronwalf * Get the value for the given datatype property. If the resource has more than one value for this property
2ronwalf * with different language identifiers than the returned value will be determined according to the
2ronwalf * settings defined in {@link org.mindswap.owl.OWLConfig#DEFAULT_LANGS OWLConfig}
2ronwalf *
2ronwalf * @param propURI
2ronwalf * @return
2ronwalf */
2ronwalf public OWLDataValue getProperty(OWLDataProperty prop);
2ronwalf
2ronwalf /**
2ronwalf * Get the value for the given property URI with the specified language identifier. If the value
2ronwalf * for the given language does not exist return null even if a value is found for another language.
2ronwalf * Use {@link org.mindswap.owl.OWLIndividual#getProperty(URI) getProperty(URI)} to be more flexible.
2ronwalf *
2ronwalf * @param propURI
2ronwalf * @param lang
2ronwalf * @return
2ronwalf */
2ronwalf public OWLDataValue getProperty(OWLDataProperty prop, String lang);
2ronwalf
2ronwalf /**
2ronwalf * Get all the values for the given datatype property.
2ronwalf *
2ronwalf * @param propURI
2ronwalf * @return
2ronwalf */
2ronwalf public OWLDataValueList getProperties(OWLDataProperty prop);
2ronwalf
2ronwalf /**
2ronwalf * Get all the properties asserted about this individual.
2ronwalf */
2ronwalf public Map getProperties();
2ronwalf
2ronwalf public OWLIndividual getIncomingProperty(OWLObjectProperty prop);
2ronwalf
2ronwalf public OWLIndividualList getIncomingProperties(OWLObjectProperty prop);
2ronwalf
2ronwalf public OWLIndividualList getIncomingProperties();
2ronwalf
2ronwalf /**
2ronwalf * Set the value for the given data property to the given plain literal
2ronwalf * value (no language identifier). All the existing data values (that has
2ronwalf * no language identifier) will be removed.
2ronwalf *
2ronwalf * @param propURI
2ronwalf * @param value
2ronwalf */
2ronwalf public void setProperty(OWLDataProperty prop, String value);
2ronwalf
2ronwalf /**
2ronwalf * Set the value for the given data property to the given literal by
2ronwalf * determining the RDF datatype from Java class. This function is
2ronwalf * equivalent to <code>setProperty(prop, OWLFactory.createDataValue(value))</code>.
2ronwalf *
2ronwalf * @param prop
2ronwalf * @param value
2ronwalf */
2ronwalf public void setProperty(OWLDataProperty prop, Object value);
2ronwalf
2ronwalf /**
2ronwalf * Set the value for the given data property. All the existing data values
2ronwalf * (that has the same language identifier with the given value) will be removed.
2ronwalf *
2ronwalf * @param propURI
2ronwalf * @param value
2ronwalf */
2ronwalf public void setProperty(OWLDataProperty prop, OWLDataValue value);
2ronwalf
2ronwalf public void addProperty(OWLDataProperty prop, OWLDataValue value);
2ronwalf
2ronwalf public void addProperty(OWLDataProperty prop, String value);
2ronwalf
2ronwalf public void addProperty(OWLDataProperty prop, Object value);
2ronwalf
2ronwalf public void removeProperties(OWLProperty prop);
2ronwalf
2ronwalf public void removeProperty(OWLProperty theProp, OWLValue theValue);
2ronwalf
2ronwalf public void addProperty(OWLObjectProperty prop, OWLIndividual value);
2ronwalf
2ronwalf public void setProperty(OWLObjectProperty prop, OWLIndividual value);
2ronwalf
2ronwalf public void addType(OWLClass c);
2ronwalf
2ronwalf public void removeTypes();
13daenzerorama
13daenzerorama /**
13daenzerorama * Removes this individual from its enclosing ontology
13daenzerorama */
13daenzerorama public void remove();
2ronwalf
2ronwalf public OWLClass getType();
2ronwalf
2ronwalf public Set getTypes();
2ronwalf
2ronwalf public boolean isType(OWLClass c);
2ronwalf
2ronwalf /**
2ronwalf * Return the RDF/XML representation of this individual. The returned RDF/XML is
2ronwalf * supposed to be a nested RDF statement which is the b-node closure of the
2ronwalf * individual.
2ronwalf */
2ronwalf public String toRDF();
2ronwalf
2ronwalf /**
2ronwalf * Return the RDF/XML representation of this individual. The returned RDF/XML is
2ronwalf * supposed to be a nested RDF statement which is the b-node closure of the
2ronwalf * individual.
2ronwalf *
2ronwalf * @param withRDFTag If false the enclosing <rdf:RDF> tag will be omitted
2ronwalf * @return
2ronwalf */
2ronwalf public String toRDF(boolean withRDFTag);
2ronwalf
2ronwalf /**
2ronwalf * Return the RDF/XML representation of this individual. The returned RDF/XML is
2ronwalf * supposed to be a nested RDF statement which is the b-node closure of the
2ronwalf * individual.
2ronwalf *
2ronwalf * @param withRDFTag If false the enclosing <rdf:RDF> tag will be omitted
2ronwalf * @param keepNamespaces If true namespace declarations will be kept even if
2ronwalf * there is no enclosing enclosing <rdf:RDF> tag (good to quote whole expression)
2ronwalf * @return
2ronwalf */
2ronwalf public String toRDF(boolean withRDFTag, boolean keepNamespaces);
2ronwalf
2ronwalf
2ronwalf /**
2ronwalf * Return the original OWL ontology this individual comes from. If the
2ronwalf * OWL-S ontology this individual comes from is the latest version then
2ronwalf * this function will return the same value as <code>getOntology()</code>.
2ronwalf * If the original ontology was from an older version of OWL-S and
2ronwalf * translated to the latest version then this function will return a
2ronwalf * reference to the original ontology. This way the information that
2ronwalf * might have been lost during translation, e.g. non-OWL-S descriptions
2ronwalf * in the original file, can still be accessed.
2ronwalf *
2ronwalf * @return
2ronwalf */
2ronwalf public OWLOntology getSourceOntology();
2ronwalf
2ronwalf /**
2ronwalf * @deprecated Use getOntology() instead
2ronwalf */
2ronwalf public org.mindswap.owls.OWLSOntology getOWLSOntology();
2ronwalf
2ronwalf
2ronwalf /**
2ronwalf * Return true if this individuals is same as the given individual
2ronwalf * (according to the semantics of owl:differentFrom).
2ronwalf *
2ronwalf * @param other
2ronwalf * @return
2ronwalf */
2ronwalf public boolean isSameAs(OWLIndividual other);
2ronwalf
2ronwalf /**
2ronwalf * Return all then individuals that are same as this individual.
2ronwalf *
2ronwalf * @return
2ronwalf */
2ronwalf public OWLIndividualList getSameIndividuals();
2ronwalf
2ronwalf /**
2ronwalf * Return true if given this individual is different from the given
2ronwalf * individual (according to the semantics of owl:differentFrom).
2ronwalf *
2ronwalf * @param ind1
2ronwalf * @param ind2
2ronwalf * @return
2ronwalf */
2ronwalf public boolean isDifferentFrom(OWLIndividual other);
2ronwalf
2ronwalf /**
2ronwalf * Get all the individuals that are different from this individual.
2ronwalf *
2ronwalf * @return
2ronwalf */
2ronwalf public OWLIndividualList getDifferentIndividuals();
2ronwalf
2ronwalf}