⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 damlclassimpl.java

📁 jena2.5.4推理机系统的一种最基本实现 HP实验室出品
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
     * Answer true if this class expression is an enumeration (i.e. has a property
     * 'oneOf' with a list of values).  This is not an exclusive property, a class
     * expression can be an enumeration at the same time as one of the other kinds
     * of class expression, though the conjunction of these may produce the Nothing
     * class.
     *
     * @return true if this class expression is an enumeration.
     */
    public boolean isEnumeration() {
        return hasProperty( getVocabulary().oneOf() );
    }


    /**
     * Answer true if this class expression is an named class (i.e. is not an anonymous
     * class expression).  This is not an exclusive property, a class
     * expression can be named at the same time as one of the other kinds
     * of class expression, though the conjunction of these may produce the Nothing
     * class.
     *
     * @return true if this class expression is a named class.
     */
    public boolean isNamedClass() {
        return !isAnon();
    }


    /**
     * Answer true if this class expression is an property restriction (i.e. is a
     * Restriction value).  This is not an exclusive property, a class
     * expression can be a property restriction at the same time as one of the other kinds
     * of class expression, though the conjunction of these may produce the Nothing
     * class.
     *
     * @return necessarily false, since restrictions are represented by a different Java class (see
     *         {@link com.hp.hpl.jena.ontology.daml.DAMLRestriction}).
     */
    public boolean isRestriction() {
        return hasProperty( RDF.type, getProfile().RESTRICTION() );
    }


    /**
     * Answer true if this class expression is an boolean intersection of a list
     * of class expressions.  This is not an exclusive property, a class
     * expression can be an intersection at the same time as one of the other kinds
     * of class expression, though the conjunction of these may produce the Nothing
     * class.
     *
     * @return true if this class expression is an intersection.
     */
    public boolean isIntersection() {
        return hasProperty( getVocabulary().intersectionOf() );
    }


    /**
     * Answer true if this class expression is an boolean union of a list
     * of class expressions.  This is not an exclusive property, a class
     * expression can be an union at the same time as one of the other kinds
     * of class expression, though the conjunction of these may produce the Nothing
     * class.
     *
     * @return true if this class expression is a union.
     */
    public boolean isUnion() {
        return hasProperty( getVocabulary().unionOf() );
    }


    /**
     * Answer true if this class expression is a disjoint union of a list
     * of class expressions.  This is not an exclusive property, a class
     * expression can be a disjoint union at the same time as one of the other kinds
     * of class expression, though the conjunction of these may produce the Nothing
     * class.
     *
     * @return true if this class expression is a disjoint union.
     */
    public boolean isDisjointUnion() {
        return hasProperty( getVocabulary().disjointUnionOf() );
    }


    /**
     * Answer true if this class expression is an boolean complement of a list
     * of class expressions.  This is not an exclusive property, a class
     * expression can be an complement at the same time as one of the other kinds
     * of class expression, though the conjunction of these may produce the Nothing
     * class.
     *
     * @return true if this class expression is a complement.
     */
    public boolean isComplement() {
        return hasProperty( getVocabulary().complementOf() );
    }


    /**
     * <p>Answer an iterator over the DAML classes
     * that mention this class as one of its super-classes.  Will return
     * all available sub-classes (see {@link #getSubClasses(boolean)} for
     * more details). The elements
     * of the iterator will be {@link DAMLClass} objects.</p>
     * @return An iterator over all available sub-classes of this class
     */
    public ExtendedIterator getSubClasses() {
        return getSubClasses( true );
    }


    /**
     * <p>Answer an iterator over the DAML classes
     * that mention this class as one of its super-classes.
     * The members of the iterator will be {@link DAMLClass} objects
     * </p>
     * <p><strong>Note:</strong> In a change to the Jena 1 DAML API, whether
     * this iterator includes <em>inferred</em> sub-classes is determined
     * not by a flag at the API level, but by the construction of the DAML
     * model itself.  See {@link ModelFactory} for details. The boolean parameter
     * <code>closed</code> is now re-interpreted to mean the inverse of <code>
     * direct</code>, see {@link OntClass#listSubClasses(boolean)} for more details.
     * </p>
     *
     * @param closed If true, return all available values; otherwise, return
     * only local (direct) sub-classes. See note for details.
     * @return An iterator over this class's sub-classes.
     */
    public ExtendedIterator getSubClasses( boolean closed ) {
        return WrappedIterator.create( super.listSubClasses( !closed ) ).mapWith( new AsMapper( DAMLClass.class ) );
    }


    /**
     * <p>Answer an iterator over the DAML classes
     * that are super-classes of this class.  Will return
     * all available super-classes (see {@link #getSuperClasses(boolean)} for
     * more details). The elements
     * of the iterator will be {@link DAMLClass} objects.</p>
     * @return An iterator over all available super-classes of this class
     */
    public ExtendedIterator getSuperClasses() {
        return getSuperClasses( true );
    }


    /**
     * <p>Answer an iterator over the DAML classes
     * that are super-classes of this class.
     * The members of the iterator will be {@link DAMLClass} objects
     * </p>
     * <p><strong>Note:</strong> In a change to the Jena 1 DAML API, whether
     * this iterator includes <em>inferred</em> super-classes is determined
     * not by a flag at the API level, but by the construction of the DAML
     * model itself.  See {@link ModelFactory} for details. The boolean parameter
     * <code>closed</code> is now re-interpreted to mean the inverse of <code>
     * direct</code>, see {@link OntClass#listSubClasses(boolean)} for more details.
     * </p>
     *
     * @param closed If true, return all available values; otherwise, return
     * only local (direct) super-classes. See note for details.
     * @return an iterator over this class's super-classes.
     */
    public ExtendedIterator getSuperClasses( boolean closed ) {
        return WrappedIterator.create( super.listSuperClasses( !closed ) ).mapWith( new AsMapper( DAMLClass.class ) );
    }


    /**
     * <p>Answer an iterator over all of the DAML classes that are equivalent to this
     * value under the <code>daml:sameClassAs</code> relation.  Note: only considers
     * <code>daml:sameClassAs</code>, for general equivalence, see
     * {@link #getEquivalentValues}.  Note also that the first member of the iteration is
     * always the DAMLClass on which the method is invoked: trivially, a DAMLClass is
     * a member of the set of DAMLClasses equivalent to itself.  If the caller wants
     * the set of classes equivalent to this one, not including itself, simply ignore
     * the first element of the iteration.</p>
     *
     * @return an iterator ranging over every equivalent DAML classes
     */
    public ExtendedIterator getSameClasses() {
        return WrappedIterator.create( super.listEquivalentClasses() ).mapWith( new AsMapper( DAMLClass.class ) );
    }



    /**
     * <p>Answer an iterator over the instances of this class that currently exist
     * in the model.<p>
     *
     * @return An iterator over those instances that have this class as one of
     *         the classes to which they belong
     * @see com.hp.hpl.jena.ontology.daml.DAMLCommon#getRDFTypes
     */
    public ExtendedIterator getInstances() {
        return WrappedIterator.create( listInstances() ).mapWith( new AsMapper( DAMLInstance.class ) );
    }


    /**
     * <p>Answer an iteration of the properties that may be used for
     * instances of this class: i&#046;e&#046; the properties that have this class,
     * or one of its super-classes, as domain.<p>
     *
     * @return An iteration of the properties that have this class in the domain
     */
    public ExtendedIterator getDefinedProperties() {
        return getDefinedProperties( true );
    }


    /**
     * <p>Answer an iteration of the properties that may be used for
     * instances of this class: i&#046;e&#046; the properties that have this class,
     * or optionally one of its super-classes, as domain.</p>
     * <p><strong>Note:</strong> In a change to the Jena 1 DAML API, whether
     * this iterator includes the defined properties for <em>inferred</em>
     * super-classes is determined
     * not by a flag at the API level, but by the construction of the DAML
     * model itself.  See {@link ModelFactory} for details. The boolean parameter
     * <code>closed</code> is now re-interpreted to mean the inverse of <code>
     * direct</code>, see {@link OntClass#listSubClasses(boolean)} for more details.
     * </p>
     *
     * @param closed If true, use all available information from the class hierarchy;
     * if false, only use local properties.
     * @return An iteration of the properties that have this class as domain
     */
    public ExtendedIterator getDefinedProperties( boolean closed ) {
        return WrappedIterator.create( listDeclaredProperties( !closed ) ).mapWith( new AsMapper( DAMLProperty.class ) );
    }


    // Internal implementation methods
    //////////////////////////////////


    //==============================================================================
    // Inner class definitions
    //==============================================================================

}

/*
    (c) Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007 Hewlett-Packard Development Company, LP
    All rights reserved.

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:

    1. Redistributions of source code must retain the above copyright
       notice, this list of conditions and the following disclaimer.

    2. Redistributions in binary form must reproduce the above copyright
       notice, this list of conditions and the following disclaimer in the
       documentation and/or other materials provided with the distribution.

    3. The name of the author may not be used to endorse or promote products
       derived from this software without specific prior written permission.

    THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -