📄 ontproperty.java
字号:
/*****************************************************************************
* Source code information
* -----------------------
* Original author Ian Dickinson, HP Labs Bristol
* Author email Ian.Dickinson@hp.com
* Package Jena 2
* Web http://sourceforge.net/projects/jena/
* Created 10 Feb 2003
* Filename $RCSfile: OntProperty.java,v $
* Revision $Revision: 1.19 $
* Release status $State: Exp $
*
* Last modified on $Date: 2007/01/02 11:48:50 $
* by $Author: andy_seaborne $
*
* (c) Copyright 2002, 2003, 2004, 2005, 2006, 2007 Hewlett-Packard Development Company, LP
* footer for full conditions)
* ****************************************************************************/
// Package
///////////////
package com.hp.hpl.jena.ontology;
// Imports
///////////////
import com.hp.hpl.jena.rdf.model.*;
import com.hp.hpl.jena.util.iterator.ExtendedIterator;
/**
* <p>
* Interface encapsulating a property in an ontology. This is an extension to the
* standard {@link Property} interface, adding a collection of convenience methods
* for accessing the additional semantic features of properties in OWL, RDFS and DAML+OIL,
* such as domain, range, inverse, etc. Not all such capabilities exist in all
* supported ontology languages.
* </p>
*
* @author Ian Dickinson, HP Labs
* (<a href="mailto:Ian.Dickinson@hp.com" >email</a>)
* @version CVS $Id: OntProperty.java,v 1.19 2007/01/02 11:48:50 andy_seaborne Exp $
*/
public interface OntProperty
extends OntResource, Property
{
// Constants
//////////////////////////////////
// External signature methods
//////////////////////////////////
// subPropertyOf
/**
* <p>Assert that this property is sub-property of the given property. Any existing
* statements for <code>subPropertyOf</code> will be removed.</p>
* @param prop The property that this property is a sub-property of
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public void setSuperProperty( Property prop );
/**
* <p>Add a super-property of this property.</p>
* @param prop A property that is a super-property of this property.
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public void addSuperProperty( Property prop );
/**
* <p>Answer a property that is the super-property of this property. If there is
* more than one such property, an arbitrary selection is made.</p>
* @return A super-property of this property
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public OntProperty getSuperProperty();
/**
* <p>Answer an iterator over all of the properties that are declared to be super-properties of
* this property. Each element of the iterator will be an {@link OntProperty}.</p>
* @return An iterator over the super-properties of this property.
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public ExtendedIterator listSuperProperties();
/**
* <p>Answer an iterator over all of the properties that are declared to be super-properties of
* this property. Each element of the iterator will be an {@link OntProperty}.</p>
* @param direct If true, only answer the direcly adjacent properties in the
* property hierarchy: i.e. eliminate any property for which there is a longer route
* to reach that child under the super-property relation.
* @return An iterator over the super-properties of this property.
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public ExtendedIterator listSuperProperties( boolean direct );
/**
* <p>Answer true if the given property is a super-property of this property.</p>
* @param prop A property to test.
* @param direct If true, only consider the direcly adjacent properties in the
* property hierarchy
* @return True if the given property is a super-property of this property.
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public boolean hasSuperProperty( Property prop, boolean direct );
/**
* <p>Remove the given property from the super-properties of this property. If this statement
* is not true of the current model, nothing happens.</p>
* @param prop A property to be removed from the super-properties of this property
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public void removeSuperProperty( Property prop );
/**
* <p>Assert that this property is super-property of the given property. Any existing
* statements for <code>subPropertyOf</code> on <code>prop</code> will be removed.</p>
* @param prop The property that is a sub-property of this property
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public void setSubProperty( Property prop );
/**
* <p>Add a sub-property of this property.</p>
* @param prop A property that is a sub-property of this property.
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public void addSubProperty( Property prop );
/**
* <p>Answer a property that is the sub-property of this property. If there is
* more than one such property, an arbitrary selection is made.</p>
* @return A sub-property of this property
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public OntProperty getSubProperty();
/**
* <p>Answer an iterator over all of the properties that are declared to be sub-properties of
* this property. Each element of the iterator will be an {@link OntProperty}.</p>
* @return An iterator over the sub-properties of this property.
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public ExtendedIterator listSubProperties();
/**
* <p>Answer an iterator over all of the properties that are declared to be sub-properties of
* this property. Each element of the iterator will be an {@link OntProperty}.</p>
* @param direct If true, only answer the direcly adjacent properties in the
* property hierarchy: i.e. eliminate any property for which there is a longer route
* to reach that child under the sub-property relation.
* @return An iterator over the sub-properties of this property.
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public ExtendedIterator listSubProperties( boolean direct );
/**
* <p>Answer true if the given property is a sub-property of this property.</p>
* @param prop A property to test.
* @param direct If true, only consider the direcly adjacent properties in the
* property hierarchy
* @return True if the given property is a sub-property of this property.
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public boolean hasSubProperty( Property prop, boolean direct );
/**
* <p>Remove the given property from the sub-properties of this property. If this statement
* is not true of the current model, nothing happens.</p>
* @param prop A property to be removed from the sub-properties of this property
* @exception OntProfileException If the {@link Profile#SUB_PROPERTY_OF()} property is not supported in the current language profile.
*/
public void removeSubProperty( Property prop );
// domain
/**
* <p>Assert that the given resource represents the class of individuals that form the
* domain of this property. Any existing <code>domain</code> statements for this property are removed.</p>
* @param res The resource that represents the domain class for this property.
* @exception OntProfileException If the {@link Profile#DOMAIN()} property is not supported in the current language profile.
*/
public void setDomain( Resource res );
/**
* <p>Add a resource representing the domain of this property.</p>
* @param res A resource that represents a domain class for this property.
* @exception OntProfileException If the {@link Profile#DOMAIN()} property is not supported in the current language profile.
*/
public void addDomain( Resource res );
/**
* <p>Answer a resource that represents the domain class of this property. If there is
* more than one such resource, an arbitrary selection is made.</p>
* @return An resource representing the class that forms the domain of this property
* @exception OntProfileException If the {@link Profile#DOMAIN()} property is not supported in the current language profile.
*/
public OntResource getDomain();
/**
* <p>Answer an iterator over all of the declared domain classes of this property.
* Each element of the iterator will be an {@link OntResource}.</p>
* @return An iterator over the classes that form the domain of this property.
* @exception OntProfileException If the {@link Profile#DOMAIN()} property is not supported in the current language profile.
*/
public ExtendedIterator listDomain();
/**
* <p>Answer true if the given resource a class specifying the domain of this property.</p>
* @param res A resource representing a class
* @return True if the given resource is one of the domain classes of this property.
* @exception OntProfileException If the {@link Profile#DOMAIN()} property is not supported in the current language profile.
*/
public boolean hasDomain( Resource res );
/**
* <p>Remove the given class from the stated domain(s) of this property. If this statement
* is not true of the current model, nothing happens.</p>
* @param cls A class to be removed from the declared domain(s) of this property
* @exception OntProfileException If the {@link Profile#DOMAIN()} property is not supported in the current language profile.
*/
public void removeDomain( Resource cls );
// range
/**
* <p>Assert that the given resource represents the class of individuals that form the
* range of this property. Any existing <code>range</code> statements for this property are
* first removed. Therefore, if the property is known not to have a range declaration, it
* is more efficient to use {@link #addRange} since no removal step is necessary.
* See {@link #addRange} for additional usage notes on the value of <code>res</code>.</p>
* @param res The resource that represents the range class for this property.
* @exception OntProfileException If the {@link Profile#RANGE()} property is not supported in the current language profile.
*/
public void setRange( Resource res );
/**
* <p>Add a resource representing the range of this property. The resource denotes the class
* or datatype that objects of statements using this property as predicate should
* belong to. For datatype properties, XML Schema Datatype names are pre-declared
* as resources in the {@link com.hp.hpl.jena.vocabulary.XSD XSD} vocabulary class. For object properties,
* the resource should be represent the range class. Note that {@link OntClass} is
* a Java sub-class of {@link Resource}, so OntClass objects can be passed directly.</p>
* @param res A resource that represents a range class for this property.
* @exception OntProfileException If the {@link Profile#RANGE()} property is not supported in the current language profile.
*/
public void addRange( Resource res );
/**
* <p>Answer a resource that represents the range class of this property. If there is
* more than one such resource, an arbitrary selection is made.</p>
* @return An resource representing the class that forms the range of this property
* @exception OntProfileException If the {@link Profile#RANGE()} property is not supported in the current language profile.
*/
public OntResource getRange();
/**
* <p>Answer an iterator over all of the declared range classes of this property.
* Each element of the iterator will be an {@link OntResource}.</p>
* @return An iterator over the classes that form the range of this property.
* @exception OntProfileException If the {@link Profile#RANGE()} property is not supported in the current language profile.
*/
public ExtendedIterator listRange();
/**
* <p>Answer true if the given resource a class specifying the range of this property.</p>
* @param res A resource representing a class
* @return True if the given resource is one of the range classes of this property.
* @exception OntProfileException If the {@link Profile#RANGE()} property is not supported in the current language profile.
*/
public boolean hasRange( Resource res );
/**
* <p>Remove the given class from the stated range(s) of this property. If this statement
* is not true of the current model, nothing happens.</p>
* @param cls A class to be removed from the declared range(s) of this property
* @exception OntProfileException If the {@link Profile#RANGE()} property is not supported in the current language profile.
*/
public void removeRange( Resource cls );
// relationships between properties
// equivalentProperty
/**
* <p>Assert that the given property is equivalent to this property. Any existing
* statements for <code>equivalentProperty</code> will be removed.</p>
* @param prop The property that this property is a equivalent to.
* @exception OntProfileException If the {@link Profile#EQUIVALENT_PROPERTY()} property is not supported in the current language profile.
*/
public void setEquivalentProperty( Property prop );
/**
* <p>Add a property that is equivalent to this property.</p>
* @param prop A property that is equivalent to this property.
* @exception OntProfileException If the {@link Profile#EQUIVALENT_PROPERTY()} property is not supported in the current language profile.
*/
public void addEquivalentProperty( Property prop );
/**
* <p>Answer a property that is equivalent to this property. If there is
* more than one such property, an arbitrary selection is made.</p>
* @return A property equivalent to this property
* @exception OntProfileException If the {@link Profile#EQUIVALENT_PROPERTY()} property is not supported in the current language profile.
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -