001    /**
002     * Copyright (C) 2007-2011, Jens Lehmann
003     *
004     * This file is part of DL-Learner.
005     *
006     * DL-Learner is free software; you can redistribute it and/or modify
007     * it under the terms of the GNU General Public License as published by
008     * the Free Software Foundation; either version 3 of the License, or
009     * (at your option) any later version.
010     *
011     * DL-Learner is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014     * GNU General Public License for more details.
015     *
016     * You should have received a copy of the GNU General Public License
017     * along with this program.  If not, see <http://www.gnu.org/licenses/>.
018     */
019    
020    package org.dllearner.core.owl;
021    
022    import java.net.URI;
023    import java.util.Map;
024    
025    /**
026     * An annotation, e.g. rdfs:label "foo".
027     * 
028     * @author Jens Lehmann
029     *
030     */
031    public class Annotation implements KBElement {
032    
033            /**
034             * 
035             */
036            private static final long serialVersionUID = 46761104877109257L;
037            protected URI annotationURI;
038            protected KBElement annotationValue;
039            
040            public Annotation(URI annotationURI, KBElement annotationValue) {
041                    this.annotationURI = annotationURI;
042                    this.annotationValue = annotationValue;
043            }
044            
045            /* (non-Javadoc)
046             * @see org.dllearner.core.owl.KBElement#accept(org.dllearner.core.owl.KBElementVisitor)
047             */
048            @Override
049            public void accept(KBElementVisitor visitor) {
050                    visitor.visit(this);
051            }
052    
053            /* (non-Javadoc)
054             * @see org.dllearner.core.owl.KBElement#getLength()
055             */
056            @Override
057            public int getLength() {
058                    return 1 + annotationValue.getLength();
059            }
060    
061            /* (non-Javadoc)
062             * @see org.dllearner.core.owl.KBElement#toKBSyntaxString(java.lang.String, java.util.Map)
063             */
064            @Override
065            public String toKBSyntaxString(String baseURI, Map<String, String> prefixes) {
066                    return annotationURI + annotationValue.toKBSyntaxString(baseURI, prefixes);
067            }
068    
069            /* (non-Javadoc)
070             * @see org.dllearner.core.owl.KBElement#toString(java.lang.String, java.util.Map)
071             */
072            @Override
073            public String toString(String baseURI, Map<String, String> prefixes) {
074                    return annotationURI + annotationValue.toString(baseURI, prefixes);     
075            }
076    
077            /**
078             * @return the annotationURI
079             */
080            public URI getAnnotationURI() {
081                    return annotationURI;
082            }
083    
084            /**
085             * @return the annotationValue
086             */
087            public KBElement getAnnotationValue() {
088                    return annotationValue;
089            }
090    
091            /* (non-Javadoc)
092             * @see org.dllearner.core.owl.KBElement#toManchesterSyntaxString(java.lang.String, java.util.Map)
093             */
094            @Override
095            public String toManchesterSyntaxString(String baseURI, Map<String, String> prefixes) {
096                    // TODO Auto-generated method stub
097                    return null;
098            }
099    
100    }