/** * <p>Answer true if this resource can be viewed as a property</p> * @return True if this resource can be viewed as an OntProperty */ @Override public boolean isProperty() { return canAs( OntProperty.class ); }
/** * <p>Answer true if this resource can be viewed as a class</p> * @return True if this resource can be viewed as an OntClass */ @Override public boolean isClass() { return canAs( OntClass.class ); }
/** * <p>Answer true if this resource can be viewed as a property</p> * @return True if this resource can be viewed as an OntProperty */ @Override public boolean isProperty() { return canAs( OntProperty.class ); }
/** * <p>Answer true if this resource can be viewed as a class</p> * @return True if this resource can be viewed as an OntClass */ @Override public boolean isClass() { return canAs( OntClass.class ); }
/** * <p>Answer true if this resource can be viewed as a data range</p> * @return True if this resource can be viewed as a DataRange */ @Override public boolean isDataRange() { return getProfile().DATARANGE() != null && canAs( DataRange.class ); }
/** * <p>Answer true if this resource can be viewed as an annotation property</p> * @return True if this resource can be viewed as an AnnotationProperty */ @Override public boolean isAnnotationProperty() { return getProfile().ANNOTATION_PROPERTY() != null && canAs( AnnotationProperty.class ); }
/** * <p>Answer true if this resource can be viewed as a data range</p> * @return True if this resource can be viewed as a DataRange */ @Override public boolean isDataRange() { return getProfile().DATARANGE() != null && canAs( DataRange.class ); }
/** * <p>Answer true if this resource can be viewed as a datatype property</p> * @return True if this resource can be viewed as a DatatypeProperty */ @Override public boolean isDatatypeProperty() { return getProfile().DATATYPE_PROPERTY() != null && canAs( DatatypeProperty.class ); }
/** * <p>Answer true if this resource can be viewed as an 'all different' declaration</p> * @return True if this resource can be viewed as an AllDifferent node */ @Override public boolean isAllDifferent() { return getProfile().ALL_DIFFERENT() != null && canAs( AllDifferent.class ); }
/** * <p>Answer true if this resource can be viewed as a datatype property</p> * @return True if this resource can be viewed as a DatatypeProperty */ @Override public boolean isDatatypeProperty() { return getProfile().DATATYPE_PROPERTY() != null && canAs( DatatypeProperty.class ); }
/** * <p>Answer true if this resource can be viewed as an ontology description node</p> * @return True if this resource can be viewed as an Ontology */ @Override public boolean isOntology() { return getProfile().ONTOLOGY() != null && canAs( Ontology.class ); }
/** * <p>Answer true if this resource can be viewed as an annotation property</p> * @return True if this resource can be viewed as an AnnotationProperty */ @Override public boolean isAnnotationProperty() { return getProfile().ANNOTATION_PROPERTY() != null && canAs( AnnotationProperty.class ); }
/** * <p>Answer true if this resource can be viewed as an object property</p> * @return True if this resource can be viewed as an ObjectProperty */ @Override public boolean isObjectProperty() { return getProfile().OBJECT_PROPERTY() != null && canAs( ObjectProperty.class ); }
/** * <p>Answer true if this resource can be viewed as an object property</p> * @return True if this resource can be viewed as an ObjectProperty */ @Override public boolean isObjectProperty() { return getProfile().OBJECT_PROPERTY() != null && canAs( ObjectProperty.class ); }
/** * <p>Answer true if this resource can be viewed as an 'all different' declaration</p> * @return True if this resource can be viewed as an AllDifferent node */ @Override public boolean isAllDifferent() { return getProfile().ALL_DIFFERENT() != null && canAs( AllDifferent.class ); }
/** * <p>Answer true if this resource can be viewed as an ontology description node</p> * @return True if this resource can be viewed as an Ontology */ @Override public boolean isOntology() { return getProfile().ONTOLOGY() != null && canAs( Ontology.class ); }
/** Convert this resource to the facet denoted by cls, by adding rdf:type type if necessary */ protected <T extends RDFNode> T convertToType( Resource type, String name, Class<T> cls ) { checkProfile( type, name ); if (canAs( cls )) { // don't need to update the model, we already can do the given facet return as( cls ); } // we're told that adding this rdf:type will make the as() possible - let's see addProperty( RDF.type, type ); return as( cls ); }
/** Convert this resource to the facet denoted by cls, by adding rdf:type type if necessary */ protected <T extends RDFNode> T convertToType( Resource type, String name, Class<T> cls ) { checkProfile( type, name ); if (canAs( cls )) { // don't need to update the model, we already can do the given facet return as( cls ); } // we're told that adding this rdf:type will make the as() possible - let's see addProperty( RDF.type, type ); return as( cls ); }