bcb4e51a409d94ae670de96afb8483a4f7855294Stephan Bosch// The MIT License
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen// Copyright (c) 2004 Evren Sirin
bdd36cfdba3ff66d25570a9ff568d69e1eb543cfTimo Sirainen// Permission is hereby granted, free of charge, to any person obtaining a copy
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen// of this software and associated documentation files (the "Software"), to
3ef05dbd1be6cb311e4d196bab87e73fdc660e19Timo Sirainen// deal in the Software without restriction, including without limitation the
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen// sell copies of the Software, and to permit persons to whom the Software is
7a60e1dc9e93ef3f7c7fe1af6385a0bfa1e31bc3Timo Sirainen// furnished to do so, subject to the following conditions:
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen// The above copyright notice and this permission notice shall be included in
381daab1e3b56a0bc94d2191cf62beba0df51af9Pascal Volk// all copies or substantial portions of the Software.
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
4ee00532a265bdfb38539d811fcd12d51210ac35Timo Sirainen// IN THE SOFTWARE.
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen * Created on Dec 28, 2004
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen * @author Evren Sirin
678d0463849ba777106eb7875f27db07a5d8e3dfTimo Sirainenpublic class WrappedIndividual extends OWLObjectImpl implements OWLIndividual {
f6b8ff28fe15eff03e0127f11cd122d3eb872e2eTimo Sirainen public boolean hasProperty(OWLProperty prop) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen public boolean hasProperty(OWLProperty prop, OWLValue value) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen public OWLIndividual getProperty(OWLObjectProperty prop) {
c03f712279c54fc29368a914375a4c66855d253bTimo Sirainen protected OWLIndividualList getPropertiesAs(OWLObjectProperty prop, Class result) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen return new CastingList(individual.getProperties(prop), result);
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen protected OWLObject getPropertyAs(OWLObjectProperty prop, Class result) {
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen OWLObject value = individual.getProperty(prop);
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen return (value == null) ? null : value.castTo(result);
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen protected OWLObject getPropertyAs(OWLDataProperty prop, Class result) {
2fa41e3cd6393ce4b5f7e6f6048d7706aa93ac0dTimo Sirainen OWLObject value = individual.getProperty(prop);
2fa41e3cd6393ce4b5f7e6f6048d7706aa93ac0dTimo Sirainen return (value == null) ? null : value.castTo(result);
ffcf7f97c7d82b895bbb745031042ee8c378c6b6Timo Sirainen protected String getPropertyAsString(OWLDataProperty prop) {
e48f289d2e5b2546a2c5dcc90f7ab624cc58cca2Stephan Bosch OWLDataValue value = individual.getProperty(prop);
e48f289d2e5b2546a2c5dcc90f7ab624cc58cca2Stephan Bosch return (value == null) ? null : value.toString();
2fa41e3cd6393ce4b5f7e6f6048d7706aa93ac0dTimo Sirainen protected String getPropertyAsString(OWLDataProperty prop, String lang) {
2fa41e3cd6393ce4b5f7e6f6048d7706aa93ac0dTimo Sirainen OWLDataValue value = individual.getProperty(prop, lang);
2fa41e3cd6393ce4b5f7e6f6048d7706aa93ac0dTimo Sirainen return (value == null) ? null : value.toString();
2fa41e3cd6393ce4b5f7e6f6048d7706aa93ac0dTimo Sirainen protected URI getPropertyAsURI(OWLDataProperty prop) {
2fa41e3cd6393ce4b5f7e6f6048d7706aa93ac0dTimo Sirainen OWLDataValue value = individual.getProperty(prop);
c93aca832ee532010ead91b85fa9f614132e1be2Stephan Bosch return (value == null) ? null : URI.create(value.getLexicalValue().trim());
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen protected URL getPropertyAsURL(OWLDataProperty prop) {
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen OWLDataValue value = individual.getProperty(prop);
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen /* (non-Javadoc)
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen * @see org.mindswap.owl.OWLIndividual#getProperties(org.mindswap.owl.OWLObjectProperty)
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen public OWLIndividualList getProperties(OWLObjectProperty prop) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen /* (non-Javadoc)
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen * @see org.mindswap.owl.OWLIndividual#getProperty(org.mindswap.owl.OWLDataProperty)
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen public OWLDataValue getProperty(OWLDataProperty prop) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen /* (non-Javadoc)
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen * @see org.mindswap.owl.OWLIndividual#getProperty(org.mindswap.owl.OWLDataProperty, java.lang.String)
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen public OWLDataValue getProperty(OWLDataProperty prop, String lang) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen public OWLDataValueList getProperties(OWLDataProperty prop) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen public OWLIndividualList getIncomingProperties() {
a7fc192e2177fd869bca779e9f6014f7149cda2dAki Tuomi public OWLIndividual getIncomingProperty(OWLObjectProperty prop) {
a7fc192e2177fd869bca779e9f6014f7149cda2dAki Tuomi public OWLIndividualList getIncomingProperties(OWLObjectProperty prop) {
a7fc192e2177fd869bca779e9f6014f7149cda2dAki Tuomi public void setProperty(OWLDataProperty prop, String value) {
a7fc192e2177fd869bca779e9f6014f7149cda2dAki Tuomi public void setProperty(OWLDataProperty prop, Object value) {
a7fc192e2177fd869bca779e9f6014f7149cda2dAki Tuomi public void setProperty(OWLDataProperty prop, OWLDataValue value) {
a7fc192e2177fd869bca779e9f6014f7149cda2dAki Tuomi public void addProperty(OWLDataProperty prop, OWLDataValue value) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen public void addProperty(OWLDataProperty prop, Object value) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen public void addProperty(OWLDataProperty prop, String value) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen public void removeProperties(OWLProperty prop) {
bace943c67e6cd14ce6c994f533d82a3caad5bf1Timo Sirainen public void removeProperty(OWLProperty theProp, OWLValue theValue) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen public void addProperty(OWLObjectProperty prop, OWLIndividual value) {
c03f712279c54fc29368a914375a4c66855d253bTimo Sirainen public void setProperty(OWLObjectProperty prop, OWLIndividual value) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen /* (non-Javadoc)
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen * @see org.mindswap.owl.OWLObject#getURI()
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen /* (non-Javadoc)
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen * @see org.mindswap.owl.OWLObject#getAnonID()
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen /* (non-Javadoc)
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen * @see org.mindswap.owl.OWLObject#getLabel()
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen /* (non-Javadoc)
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen * @see org.mindswap.owl.OWLObject#getLabel(java.lang.String)
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen /* (non-Javadoc)
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen * @see org.mindswap.owl.OWLObject#getLabels()
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen /* (non-Javadoc)
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen * @see org.mindswap.owl.OWLObject#setLabel(java.lang.String)
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen /* (non-Javadoc)
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen * @see org.mindswap.owl.OWLObject#setLabel(java.lang.String, java.lang.String)
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen public void setLabel(String label, String lang) {
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen /* (non-Javadoc)
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen * @see org.mindswap.owl.OWLObject#getAnnotation(java.net.URI)
381daab1e3b56a0bc94d2191cf62beba0df51af9Pascal Volk /* (non-Javadoc)
381daab1e3b56a0bc94d2191cf62beba0df51af9Pascal Volk * @see org.mindswap.owl.OWLObject#getAnnotation(java.net.URI, java.lang.String)
bbd2991d36c5d1d5e34eb274d1e52f0f799e2ee4Timo Sirainen public OWLDataValue getAnnotation(URI prop, String lang) {
bbd2991d36c5d1d5e34eb274d1e52f0f799e2ee4Timo Sirainen /* (non-Javadoc)
bbd2991d36c5d1d5e34eb274d1e52f0f799e2ee4Timo Sirainen * @see org.mindswap.owl.OWLObject#getAnnotations(java.net.URI)
bbd2991d36c5d1d5e34eb274d1e52f0f799e2ee4Timo Sirainen public OWLDataValueList getAnnotations(URI prop) {
bbd2991d36c5d1d5e34eb274d1e52f0f799e2ee4Timo Sirainen /* (non-Javadoc)
bbd2991d36c5d1d5e34eb274d1e52f0f799e2ee4Timo Sirainen * @see org.mindswap.owl.OWLObject#addAnnotation(java.net.URI, org.mindswap.owl.OWLDataValue)
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen public void addAnnotation(URI prop, OWLDataValue value) {
bbd2991d36c5d1d5e34eb274d1e52f0f799e2ee4Timo Sirainen /* (non-Javadoc)
bbd2991d36c5d1d5e34eb274d1e52f0f799e2ee4Timo Sirainen * @see org.mindswap.owl.OWLObject#addAnnotation(java.net.URI, java.lang.String)
7ed711d973b319320da100d3e905ef7b99ed69d6Timo Sirainen public void addAnnotation(URI prop, String value) {
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen /* (non-Javadoc)
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen * @see org.mindswap.owl.OWLObject#addAnnotation(java.net.URI, java.lang.String, java.lang.String)
99819adc9638200bc2ec1b68da9d2c68e8435740Aki Tuomi public void addAnnotation(URI prop, String value, String lang) {
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen /* (non-Javadoc)
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen * @see org.mindswap.owl.OWLObject#setAnnotation(java.net.URI, org.mindswap.owl.OWLDataValue)
99819adc9638200bc2ec1b68da9d2c68e8435740Aki Tuomi public void setAnnotation(URI prop, OWLDataValue value) {
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen /* (non-Javadoc)
678d0463849ba777106eb7875f27db07a5d8e3dfTimo Sirainen * @see org.mindswap.owl.OWLObject#setAnnotation(java.net.URI, java.lang.String)
2839c7cdfc759d21084cc009f2b60fa28ea77da1Timo Sirainen public void setAnnotation(URI prop, String value) {
2839c7cdfc759d21084cc009f2b60fa28ea77da1Timo Sirainen /* (non-Javadoc)
2839c7cdfc759d21084cc009f2b60fa28ea77da1Timo Sirainen * @see org.mindswap.owl.OWLObject#setAnnotation(java.net.URI, java.lang.String, java.lang.String)
52ffa11d672a9bd150ae3e758a19f1cc4f01471bTimo Sirainen public void setAnnotation(URI prop, String value, String lang) {
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen /* (non-Javadoc)
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen * @see org.mindswap.owl.OWLObject#removeAnnotations(java.net.URI)
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen /* (non-Javadoc)
c68ba18d99f3e4fead1e259b9dc50cb139e0b1c7Timo Sirainen * @see org.mindswap.owl.OWLObject#getModel()
99819adc9638200bc2ec1b68da9d2c68e8435740Aki Tuomi /* (non-Javadoc)
99819adc9638200bc2ec1b68da9d2c68e8435740Aki Tuomi * @see org.mindswap.owl.OWLObject#debugString()
99819adc9638200bc2ec1b68da9d2c68e8435740Aki Tuomi /* (non-Javadoc)
99819adc9638200bc2ec1b68da9d2c68e8435740Aki Tuomi * @see org.mindswap.owl.OWLValue#isDataValue()