📄 ontmodelimpl.java
字号:
public HasValueRestriction getHasValueRestriction( String uri ) {
return (HasValueRestriction) findByURIAs( uri, HasValueRestriction.class );
}
/**
* <p>Answer a class description defined as the class of those individuals that have at least
* one property with a value belonging to the given class. If a resource
* with the given uri exists in the model, and can be viewed as a SomeValuesFromRestriction, return the
* SomeValuesFromRestriction facet, otherwise return null. </p>
*
* @param uri The URI for the restriction
* @return A resource representing a some-values-from restriction, or null
*/
public SomeValuesFromRestriction getSomeValuesFromRestriction( String uri ) {
return (SomeValuesFromRestriction) findByURIAs( uri, SomeValuesFromRestriction.class );
}
/**
* <p>Answer a class description defined as the class of those individuals for which all values
* of the given property belong to the given class. If a resource
* with the given uri exists in the model, and can be viewed as an AllValuesFromResriction, return the
* AllValuesFromRestriction facet, otherwise return null. </p>
*
* @param uri The URI for the restriction
* @return A resource representing an all-values-from restriction or null
*/
public AllValuesFromRestriction getAllValuesFromRestriction( String uri ) {
return (AllValuesFromRestriction) findByURIAs( uri, AllValuesFromRestriction.class );
}
/**
* <p>Answer a class description defined as the class of those individuals that have exactly
* the given number of values for the given property. If a resource
* with the given uri exists in the model, and can be viewed as a CardinalityRestriction, return the
* CardinalityRestriction facet, otherwise return null. </p>
*
* @param uri The URI for the restriction
* @return A resource representing a has-value restriction, or null
*/
public CardinalityRestriction getCardinalityRestriction( String uri ) {
return (CardinalityRestriction) findByURIAs( uri, CardinalityRestriction.class );
}
/**
* <p>Answer a class description defined as the class of those individuals that have at least
* the given number of values for the given property. If a resource
* with the given uri exists in the model, and can be viewed as a MinCardinalityRestriction, return the
* MinCardinalityRestriction facet, otherwise return null. </p>
*
* @param uri The URI for the restriction
* @return A resource representing a min-cardinality restriction, or null
*/
public MinCardinalityRestriction getMinCardinalityRestriction( String uri ) {
return (MinCardinalityRestriction) findByURIAs( uri, MinCardinalityRestriction.class );
}
/**
* <p>Answer a class description defined as the class of those individuals that have at most
* the given number of values for the given property. If a resource
* with the given uri exists in the model, and can be viewed as a MaxCardinalityRestriction, return the
* MaxCardinalityRestriction facet, otherwise return null.</p>
*
* @param uri The URI for the restriction
* @return A resource representing a mas-cardinality restriction, or null
*/
public MaxCardinalityRestriction getMaxCardinalityRestriction( String uri ) {
return (MaxCardinalityRestriction) findByURIAs( uri, MaxCardinalityRestriction.class );
}
/**
* <p>Answer a class description defined as the class of those individuals that have a property
* p, all values of which are members of a given class. Typically used with a cardinality constraint.
* If a resource
* with the given uri exists in the model, and can be viewed as a QualifiedRestriction, return the
* QualifiedRestriction facet, otherwise return null.</p>
*
* @param uri The URI for the restriction
* @return A resource representing a qualified restriction, or null
*/
public QualifiedRestriction getQualifiedRestriction( String uri ) {
return (QualifiedRestriction) findByURIAs( uri, QualifiedRestriction.class );
}
/**
* <p>Answer a class description defined as the class of those individuals that have a property
* p, with cardinality N, all values of which are members of a given class.
* If a resource
* with the given uri exists in the model, and can be viewed as a CardinalityQRestriction, return the
* CardinalityQRestriction facet, otherwise return null.</p>
*
* @param uri The URI for the restriction
* @return A resource representing a qualified cardinality restriction, or null
*/
public CardinalityQRestriction getCardinalityQRestriction( String uri ) {
return (CardinalityQRestriction) findByURIAs( uri, CardinalityQRestriction.class );
}
/**
* <p>Answer a class description defined as the class of those individuals that have a property
* p, with min cardinality N, all values of which are members of a given class.
* If a resource
* with the given uri exists in the model, and can be viewed as a MinCardinalityQRestriction, return the
* MinCardinalityQRestriction facet, otherwise return null.</p>
*
* @param uri The URI for the restriction
* @return A resource representing a qualified min cardinality restriction, or null
*/
public MinCardinalityQRestriction getMinCardinalityQRestriction( String uri ) {
return (MinCardinalityQRestriction) findByURIAs( uri, MinCardinalityQRestriction.class );
}
/**
* <p>Answer a class description defined as the class of those individuals that have a property
* p, with max cardinality N, all values of which are members of a given class.
* If a resource
* with the given uri exists in the model, and can be viewed as a MaxCardinalityQRestriction, return the
* MaxCardinalityQRestriction facet, otherwise return null.</p>
*
* @param uri The URI for the restriction
* @return A resource representing a qualified max cardinality restriction, or null
*/
public MaxCardinalityQRestriction getMaxCardinalityQRestriction( String uri ) {
return (MaxCardinalityQRestriction) findByURIAs( uri, MaxCardinalityQRestriction.class );
}
/**
* <p>
* Answer a resource that represents an ontology description node in this model. If a resource
* with the given uri exists in the model, it will be re-used. If not, a new one is created in
* the updateable sub-graph of the ontology model.
* </p>
*
* @param uri The uri for the ontology node. Conventionally, this corresponds to the base URI
* of the document itself.
* @return An Ontology resource.
*/
public Ontology createOntology( String uri ) {
checkProfileEntry( getProfile().ONTOLOGY(), "ONTOLOGY" );
return (Ontology) createOntResource( Ontology.class, getProfile().ONTOLOGY(), uri );
}
/**
* <p>
* Answer a resource that represents an Indvidual node in this model. A new anonymous resource
* will be created in the updateable sub-graph of the ontology model.
* </p>
*
* @param cls Resource representing the ontology class to which the individual belongs
* @return A new anoymous Individual of the given class.
*/
public Individual createIndividual( Resource cls ) {
return (Individual) createOntResource( Individual.class, cls, null );
}
/**
* <p>
* Answer a resource that represents an Individual node in this model. If a resource
* with the given uri exists in the model, it will be re-used. If not, a new one is created in
* the updateable sub-graph of the ontology model.
* </p>
*
* @param cls Resource representing the ontology class to which the individual belongs
* @param uri The uri for the individual, or null for an anonymous individual.
* @return An Individual resource.
*/
public Individual createIndividual( String uri, Resource cls ) {
return (Individual) createOntResource( Individual.class, cls, uri );
}
/**
* <p>
* Answer a resource representing an generic property in this model. Effectively
* this method is an alias for {@link #createProperty( String )}, except that
* the return type is {@link OntProperty}, which allow more convenient access to
* a property's position in the property hierarchy, domain, range, etc.
* </p>
*
* @param uri The uri for the property. May not be null.
* @return An OntProperty resource.
*/
public OntProperty createOntProperty( String uri ) {
Property p = createProperty( uri );
p.addProperty( RDF.type, getProfile().PROPERTY() );
return (OntProperty) p.as( OntProperty.class );
}
/**
* <p>
* Answer a resource representing an object property in this model,
* and that is not a functional property.
* </p>
*
* @param uri The uri for the object property. May not be null.
* @return An ObjectProperty resource.
* @see #createObjectProperty( String, boolean )
*/
public ObjectProperty createObjectProperty( String uri ) {
return createObjectProperty( uri, false );
}
/**
* <p>
* Answer a resource that represents an object property in this model. An object property
* is defined to have a range of individuals, rather than datatypes.
* If a resource
* with the given uri exists in the model, it will be re-used. If not, a new one is created in
* the updateable sub-graph of the ontology model.
* </p>
*
* @param uri The uri for the object property. May not be null.
* @param functional If true, the resource will also be typed as a {@link FunctionalProperty},
* that is, a property that has a unique range value for any given domain value.
* @return An ObjectProperty resource, optionally also functional.
*/
public ObjectProperty createObjectProperty( String uri, boolean functional ) {
checkProfileEntry( getProfile().OBJECT_PROPERTY(), "OBJECT_PROPERTY" );
ObjectProperty p = (ObjectProperty) createOntResource( ObjectProperty.class, getProfile().OBJECT_PROPERTY(), uri );
if (functional) {
checkProfileEntry( getProfile().FUNCTIONAL_PROPERTY(), "FUNCTIONAL_PROPERTY" );
p.addProperty( RDF.type, getProfile().FUNCTIONAL_PROPERTY() );
}
return p;
}
/**
* <p>Answer a resource representing a transitive property</p>
* @param uri The uri for the property. May not be null.
* @return An TransitiveProperty resource
* @see #createTransitiveProperty( String, boolean )
*/
public TransitiveProperty createTransitiveProperty( String uri ) {
return createTransitiveProperty( uri, false );
}
/**
* <p>Answer a resource representing a transitive property, which is optionally
* also functional. <strong>Note:</strong> although it is permitted in OWL full
* to have functional transitive properties, it makes the language undecideable.
* Functional transitive properties are not permitted in OWL Lite or OWL DL.</p>
* @param uri The uri for the property. May not be null.
* @param functional If true, the property is also functional
* @return An TransitiveProperty resource, optionally also functional.
*/
public TransitiveProperty createTransitiveProperty( String uri, boolean functional ) {
checkProfileEntry( getProfile().TRANSITIVE_PROPERTY(), "TRANSITIVE_PROPERTY" );
TransitiveProperty p = (TransitiveProperty) createOntResource( TransitiveProperty.class, getProfile().TRANSITIVE_PROPERTY(), uri );
if (functional) {
checkProfileEntry( getProfile().FUNCTIONAL_PROPERTY(), "FUNCTIONAL_PROPERTY" );
p.addProperty( RDF.type, getProfile().FUNCTIONAL_PROPERTY() );
}
return p;
}
/**
* <p>Answer a resource representing a symmetric property</p>
* @param uri The uri for the property. May not be null.
* @return An SymmetricProperty resource
* @see #createSymmetricProperty( String, boolean )
*/
public SymmetricProperty createSymmetricProperty( String uri ) {
return createSymmetricProperty( uri, false );
}
/**
* <p>Answer a resource representing a symmetric property, which is optionally
* also functional.</p>
* @param uri The uri for the property. May not be null.
* @param functional If true, the property is also functional
* @return An SymmetricProperty resource, optionally also functional.
*/
public SymmetricProperty createSymmetricProperty( String uri, boolean functional ) {
checkProfileEntry( getProfile().SYMMETRIC_PROPERTY(), "SYMMETRIC_PROPERTY" );
SymmetricProperty p = (SymmetricProperty) createOntResource( SymmetricProperty.class, getProfile().SYMMETRIC_PROPERTY(), uri );
if (functional) {
checkProfileEntry( getProfile().FUNCTIONAL_PROPERTY(), "FUNCTIONAL_PROPERTY" );
p.addProperty( RDF.type, getProfile().FUNCTIONAL_PROPERTY() );
}
return p;
}
/**
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -