001    /*
002     * The contents of this file are subject to the Mozilla Public License
003     * Version 1.1 (the "License");  you may not use this file except in 
004     * compliance with the License.  You may obtain a copy of the License at
005     * http://www.mozilla.org/MPL/
006     *
007     * Software distributed under the License is distributed on an "AS IS" basis,
008     * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
009     * the specific language governing rights and limitations under the License.
010     *
011     * The Original Code is Protege-2000.
012     *
013     * The Initial Developer of the Original Code is Stanford University. Portions
014     * created by Stanford University are Copyright (C) 2007.  All Rights Reserved.
015     *
016     * Protege was developed by Stanford Medical Informatics
017     * (http://www.smi.stanford.edu) at the Stanford University School of Medicine
018     * with support from the National Library of Medicine, the National Science
019     * Foundation, and the Defense Advanced Research Projects Agency.  Current
020     * information about Protege can be obtained at http://protege.stanford.edu.
021     *
022     */
023    
024    package edu.stanford.smi.protegex.owl.model;
025    
026    import com.hp.hpl.jena.ontology.AnnotationProperty;
027    import com.hp.hpl.jena.ontology.OntModel;
028    
029    /**
030     * The namespaces and names from the Protege meta ontology.
031     * This ontology is used to represent Protege-specific metadata such as
032     * whether a class is abstract or not.
033     *
034     * @author Holger Knublauch  <holger@knublauch.com>
035     */
036    public class ProtegeNames {
037    
038            public final static String PREFIX_LOCALNAME_SEPARATOR = ":";
039    
040            //maybe move this later to a different class 
041            public final static String DEFAULT_DEFAULT_BASE = "http://www.owl-ontologies.com/unnamed.owl";
042            
043            //maybe move this later to a different class
044            public final static String DEFAULT_DEFAULT_NAMESPACE = DEFAULT_DEFAULT_BASE + "#";
045            
046            //should be used only in initializations
047            public final static String DEFAULT_ONTOLOGY = DEFAULT_DEFAULT_BASE;
048    
049        public static String PROTEGE_PREFIX = "protege";
050    
051        public final static String PREFIX = PROTEGE_PREFIX + ":";
052        
053        public static interface Cls {
054            final static String PAL_CONSTRAINT = (PROTEGE_OWL_NAMESPACE + "PAL-CONSTRAINT").intern();
055            
056            final static String DIRECTED_BINARY_RELATION = (PROTEGE_OWL_NAMESPACE + "DIRECTED-BINARY-RELATION").intern();
057            
058            final static String EXTERNAL_CLASS = (PROTEGE_OWL_NAMESPACE + "ExternalClass").intern();
059        }
060    
061    
062        public static interface Slot {
063    
064            final static String ABSTRACT = (PROTEGE_OWL_NAMESPACE + "abstract").intern();
065    
066            final static String CLASSIFICATION_STATUS = (PROTEGE_OWL_NAMESPACE + "classificationStatus").intern();
067            
068            final static String CONSTRAINTS = (PROTEGE_OWL_NAMESPACE + "SLOT-CONSTRAINTS").intern();
069    
070            final static String INFERRED_TYPE = (PROTEGE_OWL_NAMESPACE + "inferredType").intern();
071    
072            final static String INFERRED_SUBCLASSES = (PROTEGE_OWL_NAMESPACE + "inferredSuperclassOf").intern();
073    
074            final static String INFERRED_SUPERCLASSES = (PROTEGE_OWL_NAMESPACE + "inferredSubclassOf").intern();
075    
076                final static String IS_COMMENTED_OUT = (PROTEGE_OWL_NAMESPACE + "isCommentedOut").intern();
077                
078                final static String PAL_NAME = (PROTEGE_OWL_NAMESPACE + "PAL-NAME").intern();
079                
080                final static String PAL_STATEMENT = (PROTEGE_OWL_NAMESPACE + "PAL-STATEMENT").intern();
081                
082                final static String PAL_DESCRIPTION = (PROTEGE_OWL_NAMESPACE + "PAL-DESCRIPTION").intern();
083                
084                final static String PAL_RANGE = (PROTEGE_OWL_NAMESPACE + "PAL-RANGE").intern();
085                
086                final static String TO = (PROTEGE_OWL_NAMESPACE + "TO").intern();
087                
088                final static String FROM = (PROTEGE_OWL_NAMESPACE + "FROM").intern();
089        }
090    
091        public static String PROTEGE_OWL_ONTOLOGY = "http://protege.stanford.edu/plugins/owl/protege";
092        
093        /**
094         * @deprecated use {@link #PROTEGE_OWL_ONTOLOGY}
095         */
096        @Deprecated
097        public static String FILE = PROTEGE_OWL_ONTOLOGY;
098    
099        public final static String PROTEGE_OWL_NAMESPACE = PROTEGE_OWL_ONTOLOGY + "#";
100     
101        /**
102         * @deprecated use {@link #PROTEGE_OWL_NAMESPACE}
103         */
104        @Deprecated
105        public final static String NS = PROTEGE_OWL_NAMESPACE;
106    
107        public final static String ABSTRACT = "abstract";
108    
109        public final static String ALLOWED_PARENT = "allowedParent";
110    
111        public final static String DEFAULT_LANGUAGE = "defaultLanguage";
112    
113        public final static String EXCLUDED_TEST = "excludedTest";
114    
115        public final static String PROBE_CLASS = "probeClass";
116    
117        public static final String READ_ONLY = "readOnly";
118    
119        public final static String SUBCLASSES_DISJOINT = "subclassesDisjoint";
120    
121        public final static String TODO_PREFIX = "todoPrefix";
122    
123        public final static String TODO_PROPERTY = "todoProperty";
124    
125        public final static String RDFS_SUB_CLASS_OF_INVERSE = "superClassOf";
126    
127        public final static String RDFS_SUB_CLASS_OF_INVERSE_PREFIXED = PREFIX + RDFS_SUB_CLASS_OF_INVERSE;
128    
129        /**
130         * Not represented as a property yet, but in the future the
131         * :DIRECT-INSTANCES system slot could be mapped into this,
132         * to access the inverses of rdf:type
133         */
134        public final static String RDF_TYPE_INVERSE = "typeOf";
135    
136        public final static String RDF_TYPE_INVERSE_PREFIXED = PREFIX + RDF_TYPE_INVERSE;
137    
138        public final static String USED_LANGUAGE = "usedLanguage";
139    
140    
141        public static AnnotationProperty getAbstractProperty(OntModel ontModel) {
142            return ontModel.getAnnotationProperty(PROTEGE_OWL_NAMESPACE + ABSTRACT);
143        }
144    
145    
146        public static AnnotationProperty getAllowedParentProperty(OntModel ontModel) {
147            return ontModel.getAnnotationProperty(PROTEGE_OWL_NAMESPACE + ALLOWED_PARENT);
148        }
149    
150    
151        public static String getProbeClassSlotName() {
152            return PROTEGE_OWL_NAMESPACE + PROBE_CLASS;
153        }
154    
155    
156        public static String getReadOnlySlotName() {
157            return PROTEGE_OWL_NAMESPACE + READ_ONLY;
158        }
159    
160    
161        public static String getSubclassesDisjointSlotName() {
162            return PROTEGE_OWL_NAMESPACE + SUBCLASSES_DISJOINT;
163        }
164    
165    
166        public static String getTodoPrefixSlotName() {
167            return PROTEGE_OWL_NAMESPACE + TODO_PREFIX;
168        }
169    
170    
171        public static String getTodoPropertySlotName() {
172            return PROTEGE_OWL_NAMESPACE + TODO_PROPERTY;
173        }
174    
175    
176        public static String getDefaultLanguageSlotName() {
177            return PROTEGE_OWL_NAMESPACE + DEFAULT_LANGUAGE;
178        }
179    
180    
181        public static String getUsedLanguagesSlotName() {
182            return PROTEGE_OWL_NAMESPACE + USED_LANGUAGE;
183        }
184    
185    
186    }
187