/** * <p>Answer the model that this resource is attached to, assuming that it * is an {@link OntModel}. If this resource is not attached to any model, * or is (unusually) attached to a model that is not an <code>OntModel</code>, * answer null.</p> * @return The ont model that this resource is attached to, or null. */ @Override public OntModel getOntModel() { Model m = getModel(); return (m instanceof OntModel) ? (OntModel) m : null; }
/** * <p>Answer the model that this resource is attached to, assuming that it * is an {@link OntModel}. If this resource is not attached to any model, * or is (unusually) attached to a model that is not an <code>OntModel</code>, * answer null.</p> * @return The ont model that this resource is attached to, or null. */ @Override public OntModel getOntModel() { Model m = getModel(); return (m instanceof OntModel) ? (OntModel) m : null; }
/** * <p>Remove the specific RDF property-value pair from this DAML resource.</p> * * @param property The property to be removed * @param value The specific value of the property to be removed */ @Override public void removeProperty( Property property, RDFNode value ) { getModel().remove( this, property, value ); }
/** * <p>Remove the specific RDF property-value pair from this DAML resource.</p> * * @param property The property to be removed * @param value The specific value of the property to be removed */ @Override public void removeProperty( Property property, RDFNode value ) { getModel().remove( this, property, value ); }
/** * <p>Remove the statement that the given string is a label for * this resource. If this statement * is not true of the current model, nothing happens.</p> * @param label A label string to be removed * @param lang A lang tag */ @Override public void removeLabel( String label, String lang ) { removeLabel( getModel().createLiteral( label, lang ) ); }
/** * <p>Answer true if this resource has the given comment.</p> * @param comment The comment to test for * @param lang The optional language tag, or null for don't care. * @return True if this resource has <code>comment</code> as a comment. */ @Override public boolean hasComment( String comment, String lang ) { return hasComment( getModel().createLiteral( comment, lang ) ); }
/** * <p>Add the given label to this resource.</p> * @param label A label string for this resource * @param lang The language attribute for this label (EN, FR, etc) or null if not specified. * @exception ProfileException If the {@link Profile#LABEL()} property is not supported in the current language profile. */ @Override public void addLabel( String label, String lang ) { addLabel( getModel().createLiteral( label, lang ) ); }
/** * <p>Remove the statement that the given string is a label for * this resource. If this statement * is not true of the current model, nothing happens.</p> * @param label A label string to be removed * @param lang A lang tag */ @Override public void removeLabel( String label, String lang ) { removeLabel( getModel().createLiteral( label, lang ) ); }
/** * <p>Add the given label to this resource.</p> * @param label A label string for this resource * @param lang The language attribute for this label (EN, FR, etc) or null if not specified. * @exception ProfileException If the {@link Profile#LABEL()} property is not supported in the current language profile. */ @Override public void addLabel( String label, String lang ) { addLabel( getModel().createLiteral( label, lang ) ); }
/** * <p>Remove the statement that the given string is a comment on * this resource. If this statement * is not true of the current model, nothing happens.</p> * @param comment A comment string to be removed * @param lang A lang tag */ @Override public void removeComment( String comment, String lang ) { removeComment( getModel().createLiteral( comment, lang ) ); }
/** Remove a specified property-value pair, if it exists */ protected void removePropertyValue( Property prop, String name, RDFNode value ) { checkProfile( prop, name ); getModel().remove( this, prop, value ); }
/** * <p>Remove the statement that the given string is a comment on * this resource. If this statement * is not true of the current model, nothing happens.</p> * @param comment A comment string to be removed * @param lang A lang tag */ @Override public void removeComment( String comment, String lang ) { removeComment( getModel().createLiteral( comment, lang ) ); }
/** * <p> * Answer true if this resource is a member of the class denoted by the * given URI.</p> * * @param uri Denotes the URI of a class to which this value may belong * @return True if this resource has the given class as one of its <code>rdf:type</code>'s. */ @Override public boolean hasRDFType( String uri ) { return hasRDFType( getModel().getResource( uri ) ); }
/** * <p>Answer true if this resource has the given label</p> * @param label The label to test for * @param lang The optional language tag, or null for don't care. * @return True if this resource has <code>label</code> as a label. */ @Override public boolean hasLabel( String label, String lang ) { return hasLabel( getModel().createLiteral( label, lang ) ); }
/** * <p>Add the given comment to this resource.</p> * @param comment A comment string for this resource * @param lang The language attribute for this comment (EN, FR, etc) or null if not specified. * @exception ProfileException If the {@link Profile#COMMENT()} property is not supported in the current language profile. */ @Override public void addComment( String comment, String lang ) { addComment( getModel().createLiteral( comment, lang ) ); }
/** * <p> * Answer true if this resource is a member of the class denoted by the * given URI.</p> * * @param uri Denotes the URI of a class to which this value may belong * @return True if this resource has the given class as one of its <code>rdf:type</code>'s. */ @Override public boolean hasRDFType( String uri ) { return hasRDFType( getModel().getResource( uri ) ); }
/** * <p>Add the given comment to this resource.</p> * @param comment A comment string for this resource * @param lang The language attribute for this comment (EN, FR, etc) or null if not specified. * @exception ProfileException If the {@link Profile#COMMENT()} property is not supported in the current language profile. */ @Override public void addComment( String comment, String lang ) { addComment( getModel().createLiteral( comment, lang ) ); }
/** * <p>Remove the statement that the given string provides version information about * this resource. If this statement * is not true of the current model, nothing happens.</p> * @param info A version information string to be removed */ @Override public void removeVersionInfo( String info ) { checkProfile( getProfile().VERSION_INFO(), "VERSION_INFO" ); Literal infoAsLiteral = ResourceFactory.createPlainLiteral( info ); getModel().remove( this, getProfile().VERSION_INFO(), infoAsLiteral ); }
/** * <p>Add the given version information to this resource.</p> * @param info A version information string for this resource * @exception ProfileException If the {@link Profile#VERSION_INFO()} property is not supported in the current language profile. */ @Override public void addVersionInfo( String info ) { checkProfile( getProfile().VERSION_INFO(), "VERSION_INFO" ); addProperty( getProfile().VERSION_INFO(), getModel().createLiteral( info ) ); }
/** * <p>Remove the statement that the given string provides version information about * this resource. If this statement * is not true of the current model, nothing happens.</p> * @param info A version information string to be removed */ @Override public void removeVersionInfo( String info ) { checkProfile( getProfile().VERSION_INFO(), "VERSION_INFO" ); Literal infoAsLiteral = ResourceFactory.createPlainLiteral( info ); getModel().remove( this, getProfile().VERSION_INFO(), infoAsLiteral ); }