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 java.util.Collection;
027    import java.util.Set;
028    
029    
030    /**
031     * @author Holger Knublauch  <holger@knublauch.com>
032     */
033    public interface RDFSNamedClass extends RDFSClass, Deprecatable {
034    
035        /**
036         * Creates an instance of this class so that Protege will recognize
037         * this as an "anonymous" node in the RDF rendering.  Protege uses
038         * an internal naming convention to simulate anonymous nodes.
039         *
040         * @return a new, anonymous instance of this
041         * @see OWLModel#getNextAnonymousResourceName
042         * @see OWLModel#isAnonymousResource
043         */
044        RDFResource createAnonymousInstance();
045    
046    
047        /**
048         * Creates a new individual of this (assuming this is not a metaclass).
049         *
050         * @param name the name of the new instance or null for a default value
051         * @return the new instance
052         */
053        RDFIndividual createRDFIndividual(String name);
054    
055    
056        /**
057         * Gets all properties that have been associated with this class.
058         * This includes all properties that have this in their union domain.
059         * If this is an OWL class, then it also includes all domainless properties
060         * that have been mentioned in any restriction on this class, except those
061         * that have been restricted to a maximum cardinality of 0.
062         * It also includes all subproperties of the aforementioned properties.
063         * <p/>
064         * This method is for example used to determine which properties shall appear
065         * by default on a class form.
066         *
067         * @return the associated properties
068         */
069        Set getAssociatedProperties();
070    
071    
072        /**
073         * A convenience method to get the first direct superclass of this.
074         * This method is typically used if it is known that there is only one parent,
075         * e.g. in simple hierarchies.
076         *
077         * @return the first superclass
078         */
079        RDFSClass getFirstSuperclass();
080    
081    
082        /**
083         * Checks whether a given property is "functional" at this class.
084         * A property is "functional" if it is declared to be owl:FunctionalProperty
085         * or if this is an OWLNamedClass with a max cardinality restriction or 0 or 1.
086         *
087         * @param property the property to test
088         * @return true  if property is functional at this class
089         */
090        boolean isFunctionalProperty(RDFProperty property);
091    
092    
093        /**
094         * Gets the allowed classes for a given property at this class.
095         * This assumes that the property takes objects as values.
096         * The method tests whether an allValuesFrom restriction has been
097         * defined on this class, and resolves this into a collection if the
098         * restriction has a union class as filler.
099         * If no restriction could be found in the inheritance hierarchy, the
100         * method looks for a global range restriction for the property.
101         *
102         * @param property the property to get the local range of
103         * @return a Collection of RDFSClasses
104         */
105        Collection getUnionRangeClasses(RDFProperty property);
106    
107    
108        /**
109         * Checks whether this and a path to the root class is visible.
110         *
111         * @return true if visible
112         */
113        boolean isVisibleFromOWLThing();
114    }
115