001/* ---------------------------------------------------------------------------- 002 * This file was automatically generated by SWIG (http://www.swig.org). 003 * Version 2.0.11 004 * 005 * Do not make changes to this file unless you know what you are doing--modify 006 * the SWIG interface file instead. 007 * ----------------------------------------------------------------------------- */ 008 009package org.sbml.libsbml; 010 011/** 012 * 013 * Representation of MIRIAM-compliant controlled vocabulary annotation. 014 * <p> 015 * <p style='color: #777; font-style: italic'> 016This class of objects is defined by libSBML only and has no direct 017equivalent in terms of SBML components. This class is not prescribed by 018the SBML specifications, although it is used to implement features 019defined in SBML. 020</p> 021 022 * <p> 023 * The SBML Level 2 and Level 3 specifications define a simple 024 * format for annotating models when (a) referring to controlled vocabulary 025 * terms and database identifiers that define and describe biological and 026 * biochemical entities, and (b) describing the creator of a model and the 027 * model's modification history. This SBML format is a concrete syntax that 028 * conforms to the guidelines of MIRIAM ('Minimum Information Requested in 029 * the Annotation of biochemical Models', <i>Nature Biotechnology</i>, 030 * vol. 23, no. 12, Dec. 2005). The format uses a subset of W3C RDF (<a 031 * target='_blank' href='http://www.w3.org/RDF/'>Resource Description 032 * Format</a>). In order to help application developers work with 033 * annotations in this format, libSBML provides several helper classes that 034 * provide higher-level interfaces to the data elements; these classes 035 * include {@link CVTerm}, {@link ModelCreator}, {@link ModelHistory}, {@link RDFAnnotationParser}, and 036 * {@link Date}. 037 * <p> 038 * <h2>Components of an SBML annotation</h2> 039 * <p> 040 * The SBML annotation format consists of RDF-based content placed inside 041 * an <code><annotation></code> element attached to an SBML component 042 * such as {@link Species}, {@link Compartment}, etc. The following template illustrates 043 * the different parts of SBML annotations in XML form: 044 * <p> 045 <pre class='fragment'> 046 <<span style='background-color: #bbb'>SBML_ELEMENT</span> <span style='background-color: #d0eed0'>+++</span> metaid="<span style='border-bottom: 1px solid black'>meta id</span>" <span style='background-color: #d0eed0'>+++</span>> 047 <span style='background-color: #d0eed0'>+++</span> 048 <annotation> 049 <span style='background-color: #d0eed0'>+++</span> 050 <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' 051 xmlns:dc='http://purl.org/dc/elements/1.1/' 052 xmlns:dcterm='http://purl.org/dc/terms/' 053 xmlns:vcard='http://www.w3.org/2001/vcard-rdf/3.0#' 054 xmlns:bqbiol='http://biomodels.net/biology-qualifiers/' 055 xmlns:bqmodel='http://biomodels.net/model-qualifiers/' > 056 <rdf:Description rdf:about="#<span style='border-bottom: 1px solid black'>meta id</span>"> 057 <span style='background-color: #e0e0e0; border-bottom: 2px dotted #888'>HISTORY</span> 058 <<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 059 <rdf:Bag> 060 <rdf:li rdf:resource="<span style='background-color: #d0d0ee'>URI</span>" /> 061 <span style='background-color: #edd'>...</span> 062 </rdf:Bag> 063 </<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 064 <span style='background-color: #edd'>...</span> 065 </rdf:Description> 066 <span style='background-color: #d0eed0'>+++</span> 067 </rdf:RDF> 068 <span style='background-color: #d0eed0'>+++</span> 069 </annotation> 070 <span style='background-color: #d0eed0'>+++</span> 071 </<span style='background-color: #bbb'>SBML_ELEMENT</span>> 072 </pre> 073 * <p> 074 * In the template above, the placeholder 075 * <span class='code' style='background-color: #bbb'>SBML_ELEMENT</span> stands for 076 * the XML tag name of an SBML model component (e.g., <code>model</code>, 077 * <code>reaction</code>, etc.) and the placeholder 078 * <span class='code' style='border-bottom: 1px solid black'>meta id</span> 079 * stands for the element's meta identifier, which is a field available 080 * on all SBML components derived from the {@link SBase} base object class. 081 * The <span style='border-bottom: 2px dotted #888'>dotted</span> 082 * portions are optional, the symbol 083 * <span class='code' style='background-color: #d0eed0'>+++</span> is a placeholder 084 * for either no content or valid XML content that is not defined by 085 * this annotation scheme, and the ellipses 086 * <span class='code' style='background-color: #edd'>...</span> 087 * are placeholders for zero or more elements of the same form as the 088 * immediately preceding element. The optional content 089 * <span class='code' style='background-color: #e0e0e0; border-bottom: 2px dotted #888'>HISTORY</span> 090 * is a creation and modification history; in libSBML, this is stored 091 * using {@link ModelHistory} objects. 092 * <p> 093 * The placeholder <span class='code' style='background-color: #bbb'>RELATION_ELEMENT</span> 094 * refers to a BioModels.net qualifier element name. This is an element in 095 * either the XML namespace 096 * <code>'http://biomodels.net/model-qualifiers'</code> (for model 097 * qualifiers) or <code>'http://biomodels.net/biology-qualifiers'</code> 098 * (for biological qualifier). The <span class='code' style='background-color: #d0d0ee'>URI</span> 099 * is a required data value that uniquely identifies a resource and 100 * data within that resource to which the annotation refers. (Since 101 * a URI is only a label, not an address, applications will often 102 * want a means of looking up the resource to which the URI refers. 103 * Providing the facilities for doing this is the purpose of 104 * <a target='_blank' href='http://biomodels.net/miriam'>MIRIAM Resources</a>.) 105 * <p> 106 * The relation-resource pairs above are the 'controlled vocabulary' terms 107 * that which {@link CVTerm} is designed to store and manipulate. The next section 108 * describes these parts in more detail. For more information about 109 * SBML annotations in general, please refer to Section 6 in the 110 * SBML Level 2 (Versions 2–4) or Level 3 specification 111 * documents. 112 * <p> 113 * <p> 114 * <h2>The parts of a {@link CVTerm}</h2> 115 * <p> 116 * Annotations that refer to controlled vocabularies are managed in libSBML 117 * using {@link CVTerm} objects. A set of RDF-based annotations attached to a 118 * given SBML <code><annotation></code> element are read by 119 * {@link RDFAnnotationParser} and converted into a list of these {@link CVTerm} objects. 120 * Each {@link CVTerm} object instance stores the following components of an 121 * annotation: 122 * <p> 123 * <ul> 124 * <p> 125 * <li>The <em>qualifier</em>, which can be a BioModels.net 'biological 126 * qualifier', a BioModels.net 'model qualifier', or an unknown qualifier 127 * (as far as the {@link CVTerm} class is concerned). Qualifiers are used in 128 * MIRIAM to indicate the nature of the relationship between the object 129 * being annotated and the resource. In {@link CVTerm}, the qualifiers can be 130 * manipulated using the methods {@link CVTerm#getQualifierType()}, 131 * {@link CVTerm#setQualifierType(int type)}, and related methods. 132 * <p> 133 * <li>The <em>resource</em>, represented by a URI (which, we must remind 134 * developers, is not the same as a URL). In the {@link CVTerm} class, the 135 * resource component can be manipulated using the methods 136 * {@link CVTerm#addResource(String resource)} and 137 * {@link CVTerm#removeResource(String resource)}. 138 * <p> 139 * </ul> 140 * <p> 141 * Note that a {@link CVTerm} contains a single qualifier, but possibly more than 142 * one resource. This corresponds to the possibility of an annotation that 143 * points to multiple resources, all of which are qualified by the same 144 * BioModels.net qualifier. The {@link CVTerm} object class supports this by 145 * supporting a list of resources. 146 * <p> 147 * Detailed explanations of the qualifiers defined by BioModels.net can be 148 * found at <a target='_blank' 149 * href='http://biomodels.net/qualifiers'>http://biomodels.net/qualifiers</a>. 150 */ 151 152public class CVTerm { 153 private long swigCPtr; 154 protected boolean swigCMemOwn; 155 156 protected CVTerm(long cPtr, boolean cMemoryOwn) 157 { 158 swigCMemOwn = cMemoryOwn; 159 swigCPtr = cPtr; 160 } 161 162 protected static long getCPtr(CVTerm obj) 163 { 164 return (obj == null) ? 0 : obj.swigCPtr; 165 } 166 167 protected static long getCPtrAndDisown (CVTerm obj) 168 { 169 long ptr = 0; 170 171 if (obj != null) 172 { 173 ptr = obj.swigCPtr; 174 obj.swigCMemOwn = false; 175 } 176 177 return ptr; 178 } 179 180 protected void finalize() { 181 delete(); 182 } 183 184 public synchronized void delete() { 185 if (swigCPtr != 0) { 186 if (swigCMemOwn) { 187 swigCMemOwn = false; 188 libsbmlJNI.delete_CVTerm(swigCPtr); 189 } 190 swigCPtr = 0; 191 } 192 } 193 194 /** 195 * Equality comparison method for CVTerm. 196 * <p> 197 * Because the Java methods for libSBML are actually wrappers around code 198 * implemented in C++ and C, certain operations will not behave as 199 * expected. Equality comparison is one such case. An instance of a 200 * libSBML object class is actually a <em>proxy object</em> 201 * wrapping the real underlying C/C++ object. The normal <code>==</code> 202 * equality operator in Java will <em>only compare the Java proxy objects</em>, 203 * not the underlying native object. The result is almost never what you 204 * want in practical situations. Unfortunately, Java does not provide a 205 * way to override <code>==</code>. 206 * <p> 207 * The alternative that must be followed is to use the 208 * <code>equals()</code> method. The <code>equals</code> method on this 209 * class overrides the default java.lang.Object one, and performs an 210 * intelligent comparison of instances of objects of this class. The 211 * result is an assessment of whether two libSBML Java objects are truly 212 * the same underlying native-code objects. 213 * <p> 214 * The use of this method in practice is the same as the use of any other 215 * Java <code>equals</code> method. For example, 216 * <em>a</em><code>.equals(</code><em>b</em><code>)</code> returns 217 * <code>true</code> if <em>a</em> and <em>b</em> are references to the 218 * same underlying object. 219 * 220 * @param sb a reference to an object to which the current object 221 * instance will be compared 222 * 223 * @return <code>true</code> if <code>sb</code> refers to the same underlying 224 * native object as this one, <code>false</code> otherwise 225 */ 226 public boolean equals(Object sb) 227 { 228 if ( this == sb ) 229 { 230 return true; 231 } 232 return swigCPtr == getCPtr((CVTerm)(sb)); 233 } 234 235 /** 236 * Returns a hashcode for this CVTerm object. 237 * 238 * @return a hash code usable by Java methods that need them. 239 */ 240 public int hashCode() 241 { 242 return (int)(swigCPtr^(swigCPtr>>>32)); 243 } 244 245 246/** 247 * Creates an empty {@link CVTerm}, optionally with the given qualifier <code>type</code>. 248 * <p> 249 * The SBML Level 2 and Level 3 specifications define a simple 250 * format for annotating models when (a) referring to controlled 251 * vocabulary terms and database identifiers that define and describe 252 * biological and other entities, and (b) describing the creator of a 253 * model and the model's modification history. The annotation content is 254 * stored in <code><annotation></code> elements attached to 255 * individual SBML elements. The format for storing the content inside 256 * SBML <code><annotation></code> elements is a subset of W3C RDF 257 * (<a target='_blank' href='http://www.w3.org/RDF/'>Resource Description 258 * Format</a>) expressed in XML. The {@link CVTerm} class provides a programming 259 * interface for working directly with controlled vocabulary term ('CV 260 * term') objects without having to deal directly with the XML form. 261 * When libSBML reads in an SBML model containing RDF annotations, it 262 * parses those annotations into a list of {@link CVTerm} objects, and when 263 * writing a model, it parses the {@link CVTerm} objects back into the 264 * appropriate SBML <code><annotation></code> structure. 265 * <p> 266 * This method creates an empty {@link CVTerm} object. The possible qualifier 267 * types usable as values of <code>type</code> are {@link 268 * libsbmlConstants#MODEL_QUALIFIER MODEL_QUALIFIER} and {@link 269 * libsbmlConstants#BIOLOGICAL_QUALIFIER BIOLOGICAL_QUALIFIER}. If 270 * an explicit value for <code>type</code> is not given, this method defaults to 271 * using {@link libsbmlConstants#UNKNOWN_QUALIFIER 272 * UNKNOWN_QUALIFIER}. The qualifier type 273 * can be set later using the 274 * {@link CVTerm#setQualifierType(int type)} method. 275 * <p> 276 * Different BioModels.net qualifier elements encode different types of 277 * relationships. Please refer to the SBML specification or the <a 278 * target='_blank' href='http://biomodels.net/qualifiers/'>BioModels.net 279 * qualifiers web page</a> for an explanation of the meaning of these 280 * different qualifiers. 281 * <p> 282 * @param type a qualifier type 283 * <p> 284 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 285</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 286The native C++ implementation of this method defines a default argument 287value. In the documentation generated for different libSBML language 288bindings, you may or may not see corresponding arguments in the method 289declarations. For example, in Java and C#, a default argument is handled by 290declaring two separate methods, with one of them having the argument and 291the other one lacking the argument. However, the libSBML documentation will 292be <em>identical</em> for both methods. Consequently, if you are reading 293this and do not see an argument even though one is described, please look 294for descriptions of other variants of this method near where this one 295appears in the documentation. 296</dd></dl> 297 298 */ public 299 CVTerm(int type) { 300 this(libsbmlJNI.new_CVTerm__SWIG_0(type), true); 301 } 302 303 304/** 305 * Creates an empty {@link CVTerm}, optionally with the given qualifier <code>type</code>. 306 * <p> 307 * The SBML Level 2 and Level 3 specifications define a simple 308 * format for annotating models when (a) referring to controlled 309 * vocabulary terms and database identifiers that define and describe 310 * biological and other entities, and (b) describing the creator of a 311 * model and the model's modification history. The annotation content is 312 * stored in <code><annotation></code> elements attached to 313 * individual SBML elements. The format for storing the content inside 314 * SBML <code><annotation></code> elements is a subset of W3C RDF 315 * (<a target='_blank' href='http://www.w3.org/RDF/'>Resource Description 316 * Format</a>) expressed in XML. The {@link CVTerm} class provides a programming 317 * interface for working directly with controlled vocabulary term ('CV 318 * term') objects without having to deal directly with the XML form. 319 * When libSBML reads in an SBML model containing RDF annotations, it 320 * parses those annotations into a list of {@link CVTerm} objects, and when 321 * writing a model, it parses the {@link CVTerm} objects back into the 322 * appropriate SBML <code><annotation></code> structure. 323 * <p> 324 * This method creates an empty {@link CVTerm} object. The possible qualifier 325 * types usable as values of <code>type</code> are {@link 326 * libsbmlConstants#MODEL_QUALIFIER MODEL_QUALIFIER} and {@link 327 * libsbmlConstants#BIOLOGICAL_QUALIFIER BIOLOGICAL_QUALIFIER}. If 328 * an explicit value for <code>type</code> is not given, this method defaults to 329 * using {@link libsbmlConstants#UNKNOWN_QUALIFIER 330 * UNKNOWN_QUALIFIER}. The qualifier type 331 * can be set later using the 332 * {@link CVTerm#setQualifierType(int type)} method. 333 * <p> 334 * Different BioModels.net qualifier elements encode different types of 335 * relationships. Please refer to the SBML specification or the <a 336 * target='_blank' href='http://biomodels.net/qualifiers/'>BioModels.net 337 * qualifiers web page</a> for an explanation of the meaning of these 338 * different qualifiers. 339 * <p> 340 * @param type a qualifier type 341 * <p> 342 * <!-- Don't remove the leading </dl> below. It's a hack for javadoc. --> 343</dl><dl class='docnote'><dt><b>Documentation note:</b></dt><dd> 344The native C++ implementation of this method defines a default argument 345value. In the documentation generated for different libSBML language 346bindings, you may or may not see corresponding arguments in the method 347declarations. For example, in Java and C#, a default argument is handled by 348declaring two separate methods, with one of them having the argument and 349the other one lacking the argument. However, the libSBML documentation will 350be <em>identical</em> for both methods. Consequently, if you are reading 351this and do not see an argument even though one is described, please look 352for descriptions of other variants of this method near where this one 353appears in the documentation. 354</dd></dl> 355 356 */ public 357 CVTerm() { 358 this(libsbmlJNI.new_CVTerm__SWIG_1(), true); 359 } 360 361 362/** 363 * Creates a new {@link CVTerm} from the given {@link XMLNode}. 364 * <p> 365 * The SBML Level 2 and Level 3 specifications define a simple 366 * format for annotating models when (a) referring to controlled 367 * vocabulary terms and database identifiers that define and describe 368 * biological and other entities, and (b) describing the creator of a 369 * model and the model's modification history. The annotation content is 370 * stored in <code><annotation></code> elements attached to 371 * individual SBML elements. The format for storing the content inside 372 * SBML <code><annotation></code> elements is a subset of W3C RDF 373 * (<a target='_blank' href='http://www.w3.org/RDF/'>Resource Description 374 * Format</a>) expressed in XML. The {@link CVTerm} class provides a programming 375 * interface for working directly with controlled vocabulary term ('CV 376 * term') objects without having to deal directly with the XML form. 377 * When libSBML reads in an SBML model containing RDF annotations, it 378 * parses those annotations into a list of {@link CVTerm} objects, and when 379 * writing a model, it parses the {@link CVTerm} objects back into the 380 * appropriate SBML <code><annotation></code> structure. 381 * <p> 382 * This method creates a {@link CVTerm} object from the {@link XMLNode} object <code>node</code>. 383 * Recall that {@link XMLNode} is a node in an XML tree of elements, and each 384 * such element can be placed in a namespace. This constructor looks for 385 * the element to be in the XML namespaces 386 * <code>'http://biomodels.net/model-qualifiers'</code> (for 387 * model qualifiers) and 388 * <code>'http://biomodels.net/biology-qualifiers'</code> (for 389 * biological qualifier), and if they are, creates {@link CVTerm} objects for 390 * the result. 391 * <p> 392 * @param node an XMLNode representing a {@link CVTerm}. 393 * <p> 394 * @note This method assumes that the given {@link XMLNode} object <code>node</code> is of 395 * the correct structural form. 396 */ public 397 CVTerm(XMLNode node) { 398 this(libsbmlJNI.new_CVTerm__SWIG_2(XMLNode.getCPtr(node), node), true); 399 } 400 401 402/** 403 * Copy constructor; creates a copy of a {@link CVTerm} object. 404 * <p> 405 * @param orig the {@link CVTerm} instance to copy. 406 * <p> 407 * @throws SBMLConstructorException 408 * Thrown if the argument <code>orig</code> is <code>null.</code> 409 */ public 410 CVTerm(CVTerm orig) { 411 this(libsbmlJNI.new_CVTerm__SWIG_3(CVTerm.getCPtr(orig), orig), true); 412 } 413 414 415/** 416 * Creates and returns a deep copy of this {@link CVTerm} object. 417 * <p> 418 * @return a (deep) copy of this {@link CVTerm}. 419 */ public 420 CVTerm cloneObject() { 421 long cPtr = libsbmlJNI.CVTerm_cloneObject(swigCPtr, this); 422 return (cPtr == 0) ? null : new CVTerm(cPtr, true); 423 } 424 425 426/** 427 * Returns the qualifier type of this {@link CVTerm} object. 428 * <p> 429 * The RDF element used in the SBML format for referring to external 430entities is <code><rdf:Description></code>, with a 431<code><rdf:Bag></code> element inside of it containing one or 432more <code><rdf:li></code> elements. The following template 433illustrates the structure: 434<pre class='fragment'> 435<rdf:Description rdf:about="#<span style='border-bottom: 1px solid black'>meta id</span>"> 436 <span style='background-color: #ddd; border-bottom: 2px dotted #888'>HISTORY</span> 437 <<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 438 <rdf:Bag> 439 <rdf:li rdf:resource="<span style='background-color: #d0d0ee'>resource URI</span>" /> 440 <span style='background-color: #edd'>...</span> 441 </rdf:Bag> 442 </<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 443 <span style='background-color: #edd'>...</span> 444</rdf:Description> 445</pre> 446In the template above, the placeholder <span class='code' 447style='border-bottom: 1px solid black'>meta id</span> stands for the 448element's meta identifier, which is a field available on all SBML 449components derived from the {@link SBase} base object class. The <span 450style='border-bottom: 2px dotted #888'>dotted</span> portions are 451optional, and the ellipses <span class='code' style='background-color: 452#edd'>...</span> are placeholders for zero or more elements of the 453same form as the immediately preceding element. 454 455 * <p> 456 * The placeholder <span class='code' style='background-color: #bbb'> 457 * RELATION_ELEMENT</span> refers to a BioModels.net qualifier 458 * element name. This is an element in either the XML namespace 459 * <code>'http://biomodels.net/model-qualifiers'</code> (for model 460 * qualifiers) or <code>'http://biomodels.net/biology-qualifiers'</code> 461 * (for biological qualifier). The present method returns a code 462 * identifying which one of these two relationship namespaces is being 463 * used; any other qualifier in libSBML is considered unknown (as far as 464 * the {@link CVTerm} class is concerned). Consequently, this method will return 465 * one of the following values: 466 * <p> 467 * <ul> 468 * <li> {@link libsbmlConstants#MODEL_QUALIFIER MODEL_QUALIFIER} 469 * <li> {@link libsbmlConstants#BIOLOGICAL_QUALIFIER BIOLOGICAL_QUALIFIER} 470 * <li> {@link libsbmlConstants#UNKNOWN_QUALIFIER UNKNOWN_QUALIFIER} 471 * </ul> 472 * <p> 473 * The specific relationship of this {@link CVTerm} to the enclosing SBML object 474 * can be determined using the {@link CVTerm} methods such as 475 * getModelQualifierType() and getBiologicalQualifierType(). Callers 476 * will typically want to use the present method to find out which one of 477 * the <em>other</em> two methods to call to find out the specific 478 * relationship. 479 * <p> 480 * @return the qualifier type 481 * of this object or {@link libsbmlConstants#UNKNOWN_QUALIFIER UNKNOWN_QUALIFIER} 482 * (the default). 483 * <p> 484 * @see #getResources() 485 * @see #getModelQualifierType() 486 * @see #getBiologicalQualifierType() 487 */ public 488 int getQualifierType() { 489 return libsbmlJNI.CVTerm_getQualifierType(swigCPtr, this); 490 } 491 492 493/** 494 * Returns the model qualifier type of this {@link CVTerm} object. 495 * <p> 496 * The RDF element used in the SBML format for referring to external 497entities is <code><rdf:Description></code>, with a 498<code><rdf:Bag></code> element inside of it containing one or 499more <code><rdf:li></code> elements. The following template 500illustrates the structure: 501<pre class='fragment'> 502<rdf:Description rdf:about="#<span style='border-bottom: 1px solid black'>meta id</span>"> 503 <span style='background-color: #ddd; border-bottom: 2px dotted #888'>HISTORY</span> 504 <<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 505 <rdf:Bag> 506 <rdf:li rdf:resource="<span style='background-color: #d0d0ee'>resource URI</span>" /> 507 <span style='background-color: #edd'>...</span> 508 </rdf:Bag> 509 </<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 510 <span style='background-color: #edd'>...</span> 511</rdf:Description> 512</pre> 513In the template above, the placeholder <span class='code' 514style='border-bottom: 1px solid black'>meta id</span> stands for the 515element's meta identifier, which is a field available on all SBML 516components derived from the {@link SBase} base object class. The <span 517style='border-bottom: 2px dotted #888'>dotted</span> portions are 518optional, and the ellipses <span class='code' style='background-color: 519#edd'>...</span> are placeholders for zero or more elements of the 520same form as the immediately preceding element. 521 522 * <p> 523 * The placeholder <span class='code' style='background-color: #bbb'> 524 * RELATION_ELEMENT</span> refers to a BioModels.net qualifier 525 * element name. This is an element in either the XML namespace 526 * <code>'http://biomodels.net/model-qualifiers'</code> (for model 527 * qualifiers) or <code>'http://biomodels.net/biology-qualifiers'</code> 528 * (for biological qualifier). Callers will typically use 529 * getQualifierType() to find out the type of qualifier relevant to this 530 * particular {@link CVTerm} object, then if it is a <em>model</em> qualifier, use the 531 * present method to determine the specific qualifier. The set of known 532 * model qualifiers is, at the time of this libSBML release, the 533 * following: 534 * <p> 535 * <ul> 536 * <li> {@link libsbmlConstants#BQM_IS BQM_IS} 537 * <li> {@link libsbmlConstants#BQM_IS_DESCRIBED_BY BQM_IS_DESCRIBED_BY} 538 * <li> {@link libsbmlConstants#BQM_IS_DERIVED_FROM BQM_IS_DERIVED_FROM} 539 * </ul> 540 * <p> 541 * Any other BioModels.net qualifier found in the model is considered 542 * unknown by libSBML and reported as 543 * {@link libsbmlConstants#BQM_UNKNOWN BQM_UNKNOWN}. 544 * <p> 545 * @return the model qualifier type 546 * of this object or {@link libsbmlConstants#BQM_UNKNOWN BQM_UNKNOWN} 547 * (the default). 548 */ public 549 int getModelQualifierType() { 550 return libsbmlJNI.CVTerm_getModelQualifierType(swigCPtr, this); 551 } 552 553 554/** 555 * Returns the biological qualifier type of this {@link CVTerm} object. 556 * <p> 557 * The RDF element used in the SBML format for referring to external 558entities is <code><rdf:Description></code>, with a 559<code><rdf:Bag></code> element inside of it containing one or 560more <code><rdf:li></code> elements. The following template 561illustrates the structure: 562<pre class='fragment'> 563<rdf:Description rdf:about="#<span style='border-bottom: 1px solid black'>meta id</span>"> 564 <span style='background-color: #ddd; border-bottom: 2px dotted #888'>HISTORY</span> 565 <<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 566 <rdf:Bag> 567 <rdf:li rdf:resource="<span style='background-color: #d0d0ee'>resource URI</span>" /> 568 <span style='background-color: #edd'>...</span> 569 </rdf:Bag> 570 </<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 571 <span style='background-color: #edd'>...</span> 572</rdf:Description> 573</pre> 574In the template above, the placeholder <span class='code' 575style='border-bottom: 1px solid black'>meta id</span> stands for the 576element's meta identifier, which is a field available on all SBML 577components derived from the {@link SBase} base object class. The <span 578style='border-bottom: 2px dotted #888'>dotted</span> portions are 579optional, and the ellipses <span class='code' style='background-color: 580#edd'>...</span> are placeholders for zero or more elements of the 581same form as the immediately preceding element. 582 583 * <p> 584 * The placeholder <span class='code' style='background-color: #bbb'> 585 * RELATION_ELEMENT</span> refers to a BioModels.net qualifier 586 * element name. This is an element in either the XML namespace 587 * <code>'http://biomodels.net/model-qualifiers'</code> (for model 588 * qualifiers) or <code>'http://biomodels.net/biology-qualifiers'</code> 589 * (for biological qualifier). Callers will typically use 590 * getQualifierType() to find out the type of qualifier relevant to this 591 * particular {@link CVTerm} object, then if it is a <em>biological</em> qualifier, 592 * use the present method to determine the specific qualifier. The set 593 * of known biological qualifiers is, at the time of this libSBML 594 * release, the following: 595 * <p> 596 * <ul> 597 * <li> {@link libsbmlConstants#BQB_IS BQB_IS} 598 * <li> {@link libsbmlConstants#BQB_HAS_PART BQB_HAS_PART} 599 * <li> {@link libsbmlConstants#BQB_IS_PART_OF BQB_IS_PART_OF} 600 * <li> {@link libsbmlConstants#BQB_IS_VERSION_OF BQB_IS_VERSION_OF} 601 * <li> {@link libsbmlConstants#BQB_HAS_VERSION BQB_HAS_VERSION} 602 * <li> {@link libsbmlConstants#BQB_IS_HOMOLOG_TO BQB_IS_HOMOLOG_TO} 603 * <li> {@link libsbmlConstants#BQB_IS_DESCRIBED_BY BQB_IS_DESCRIBED_BY} 604 * <li> {@link libsbmlConstants#BQB_IS_ENCODED_BY BQB_IS_ENCODED_BY} 605 * <li> {@link libsbmlConstants#BQB_ENCODES BQB_ENCODES} 606 * <li> {@link libsbmlConstants#BQB_OCCURS_IN BQB_OCCURS_IN} 607 * <li> {@link libsbmlConstants#BQB_HAS_PROPERTY BQB_HAS_PROPERTY} 608 * <li> {@link libsbmlConstants#BQB_IS_PROPERTY_OF BQB_IS_PROPERTY_OF} 609 * </ul> 610 * <p> 611 * Any other BioModels.net qualifier found in the model is considered 612 * unknown by libSBML and reported as 613 * {@link libsbmlConstants#BQB_UNKNOWN BQB_UNKNOWN}. 614 * <p> 615 * @return the biology qualifier type 616 * of this object or {@link libsbmlConstants#BQB_UNKNOWN BQB_UNKNOWN} 617 * (the default). 618 */ public 619 int getBiologicalQualifierType() { 620 return libsbmlJNI.CVTerm_getBiologicalQualifierType(swigCPtr, this); 621 } 622 623 624/** 625 * Returns the resource references for this {@link CVTerm} object. 626 * <p> 627 * The RDF element used in the SBML format for referring to external 628entities is <code><rdf:Description></code>, with a 629<code><rdf:Bag></code> element inside of it containing one or 630more <code><rdf:li></code> elements. The following template 631illustrates the structure: 632<pre class='fragment'> 633<rdf:Description rdf:about="#<span style='border-bottom: 1px solid black'>meta id</span>"> 634 <span style='background-color: #ddd; border-bottom: 2px dotted #888'>HISTORY</span> 635 <<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 636 <rdf:Bag> 637 <rdf:li rdf:resource="<span style='background-color: #d0d0ee'>resource URI</span>" /> 638 <span style='background-color: #edd'>...</span> 639 </rdf:Bag> 640 </<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 641 <span style='background-color: #edd'>...</span> 642</rdf:Description> 643</pre> 644In the template above, the placeholder <span class='code' 645style='border-bottom: 1px solid black'>meta id</span> stands for the 646element's meta identifier, which is a field available on all SBML 647components derived from the {@link SBase} base object class. The <span 648style='border-bottom: 2px dotted #888'>dotted</span> portions are 649optional, and the ellipses <span class='code' style='background-color: 650#edd'>...</span> are placeholders for zero or more elements of the 651same form as the immediately preceding element. 652 653 * <p> 654 * The <span class='code' style='background-color: #d0d0ee'>resource 655 * URI</span> values shown in the template above are stored internally in 656 * {@link CVTerm} objects using an {@link XMLAttributes} object. Each attribute stored 657 * inside the {@link XMLAttributes} will have the same name (specifically, 658 * "<code>rdf:resource</code>") but a different value, and the 659 * value will be a <span class='code' style='background-color: #d0d0ee'> 660 * resource URI</span> shown in the XML template above. 661 * <p> 662 * A valid {@link CVTerm} entity must always have at least one resource and 663 * a value for the relationship qualifier. 664 * <p> 665 * @return the {@link XMLAttributes} that store the resources of this {@link CVTerm}. 666 * <p> 667 * @see #getQualifierType() 668 * @see #addResource(String resource) 669 * @see #getResourceURI(long n) 670 */ public 671 XMLAttributes getResources() { 672 long cPtr = libsbmlJNI.CVTerm_getResources__SWIG_0(swigCPtr, this); 673 return (cPtr == 0) ? null : new XMLAttributes(cPtr, false); 674 } 675 676 677/** 678 * Returns the number of resources for this {@link CVTerm} object. 679 * <p> 680 * The RDF element used in the SBML format for referring to external 681entities is <code><rdf:Description></code>, with a 682<code><rdf:Bag></code> element inside of it containing one or 683more <code><rdf:li></code> elements. The following template 684illustrates the structure: 685<pre class='fragment'> 686<rdf:Description rdf:about="#<span style='border-bottom: 1px solid black'>meta id</span>"> 687 <span style='background-color: #ddd; border-bottom: 2px dotted #888'>HISTORY</span> 688 <<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 689 <rdf:Bag> 690 <rdf:li rdf:resource="<span style='background-color: #d0d0ee'>resource URI</span>" /> 691 <span style='background-color: #edd'>...</span> 692 </rdf:Bag> 693 </<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 694 <span style='background-color: #edd'>...</span> 695</rdf:Description> 696</pre> 697In the template above, the placeholder <span class='code' 698style='border-bottom: 1px solid black'>meta id</span> stands for the 699element's meta identifier, which is a field available on all SBML 700components derived from the {@link SBase} base object class. The <span 701style='border-bottom: 2px dotted #888'>dotted</span> portions are 702optional, and the ellipses <span class='code' style='background-color: 703#edd'>...</span> are placeholders for zero or more elements of the 704same form as the immediately preceding element. 705 706 * <p> 707 * The fragment above illustrates that there can be more than one 708 * resource referenced by a given relationship annotation (i.e., the 709 * <span class='code' style='background-color: #d0d0ee'>resource 710 * URI</span> values associated with a particular <span class='code' 711 * style='background-color: #bbb'>RELATION_ELEMENT</span>). The present 712 * method returns a count of the resources stored in this {@link CVTerm} object. 713 * <p> 714 * @return the number of resources in the set of {@link XMLAttributes} 715 * of this {@link CVTerm}. 716 * <p> 717 * @see #getResources() 718 * @see #getResourceURI(long n) 719 */ public 720 long getNumResources() { 721 return libsbmlJNI.CVTerm_getNumResources(swigCPtr, this); 722 } 723 724 725/** 726 * Returns the value of the <em>n</em>th resource for this {@link CVTerm} object. 727 * <p> 728 * The RDF element used in the SBML format for referring to external 729entities is <code><rdf:Description></code>, with a 730<code><rdf:Bag></code> element inside of it containing one or 731more <code><rdf:li></code> elements. The following template 732illustrates the structure: 733<pre class='fragment'> 734<rdf:Description rdf:about="#<span style='border-bottom: 1px solid black'>meta id</span>"> 735 <span style='background-color: #ddd; border-bottom: 2px dotted #888'>HISTORY</span> 736 <<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 737 <rdf:Bag> 738 <rdf:li rdf:resource="<span style='background-color: #d0d0ee'>resource URI</span>" /> 739 <span style='background-color: #edd'>...</span> 740 </rdf:Bag> 741 </<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 742 <span style='background-color: #edd'>...</span> 743</rdf:Description> 744</pre> 745In the template above, the placeholder <span class='code' 746style='border-bottom: 1px solid black'>meta id</span> stands for the 747element's meta identifier, which is a field available on all SBML 748components derived from the {@link SBase} base object class. The <span 749style='border-bottom: 2px dotted #888'>dotted</span> portions are 750optional, and the ellipses <span class='code' style='background-color: 751#edd'>...</span> are placeholders for zero or more elements of the 752same form as the immediately preceding element. 753 754 * <p> 755 * The fragment above illustrates that there can be more than one 756 * resource referenced by a given relationship annotation (i.e., the 757 * <span class='code' style='background-color: #d0d0ee'>resource 758 * URI</span> values associated with a particular <span class='code' 759 * style='background-color: #bbb'>RELATION_ELEMENT</span>). LibSBML 760 * stores all resource URIs in a single {@link CVTerm} object for a given 761 * relationship. Callers can use getNumResources() to find out how many 762 * resources are stored in this {@link CVTerm} object, then call this method to 763 * retrieve the <em>n</em>th resource URI. 764 * <p> 765 * @param n the index of the resource to query 766 * <p> 767 * @return string representing the value of the nth resource 768 * in the set of {@link XMLAttributes} of this {@link CVTerm}. 769 * <p> 770 * @see #getNumResources() 771 * @see #getQualifierType() 772 */ public 773 String getResourceURI(long n) { 774 return libsbmlJNI.CVTerm_getResourceURI(swigCPtr, this, n); 775 } 776 777 778/** 779 * Sets the qualifier code of this 780 * {@link CVTerm} object. 781 * <p> 782 * @param type the qualifier type. 783 * The possible values returned by this function are: 784 * <ul> 785 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 786 * </ul> 787 * <p> 788 * @see #getQualifierType() 789 */ public 790 int setQualifierType(int type) { 791 return libsbmlJNI.CVTerm_setQualifierType(swigCPtr, this, type); 792 } 793 794 795/** 796 * Sets the model qualifier type 797 * of this {@link CVTerm} object. 798 * <p> 799 * @param type the model qualifier type 800 * <p> 801 * @return integer value indicating success/failure of the 802 * function. The possible values returned by this function are: 803 * <ul> 804 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 805 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 806 * </ul> 807 * <p> 808 * @note If the Qualifier Type of this object is not 809 * {@link libsbmlConstants#MODEL_QUALIFIER MODEL_QUALIFIER}, 810 * then the ModelQualifierType_t value will default to 811 * {@link libsbmlConstants#BQM_UNKNOWN BQM_UNKNOWN}. 812 * <p> 813 * @see #getQualifierType() 814 * @see #setQualifierType(int type) 815 */ public 816 int setModelQualifierType(int type) { 817 return libsbmlJNI.CVTerm_setModelQualifierType__SWIG_0(swigCPtr, this, type); 818 } 819 820 821/** 822 * Sets the biology qualifier type 823 * of this {@link CVTerm} object. 824 * <p> 825 * @param type the biology qualifier type. 826 * <p> 827 * @return integer value indicating success/failure of the 828 * function. The possible values returned by this function are: 829 * <ul> 830 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 831 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 832 * </ul> 833 * <p> 834 * @note If the Qualifier Type of this object is not 835 * {@link libsbmlConstants#BIOLOGICAL_QUALIFIER BIOLOGICAL_QUALIFIER}, 836 * then the biology qualifier type will default 837 * to {@link libsbmlConstants#BQB_UNKNOWN BQB_UNKNOWN}. 838 * <p> 839 * @see #getQualifierType() 840 * @see #setQualifierType(int type) 841 */ public 842 int setBiologicalQualifierType(int type) { 843 return libsbmlJNI.CVTerm_setBiologicalQualifierType__SWIG_0(swigCPtr, this, type); 844 } 845 846 847/** 848 * Sets the model qualifier type code value of this {@link CVTerm} object. 849 * <p> 850 * @param qualifier the string representing a model qualifier 851 * <p> 852 * @return integer value indicating success/failure of the 853 * function. The possible values 854 * returned by this function are: 855 * <ul> 856 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 857 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 858 * </ul> 859 * <p> 860 * @note If the Qualifier Type of this object is not 861 * {@link libsbmlConstants#MODEL_QUALIFIER MODEL_QUALIFIER}, 862 * then the ModelQualifierType_t value will default to 863 * {@link libsbmlConstants#BQM_UNKNOWN BQM_UNKNOWN}. 864 * <p> 865 * @see #getQualifierType() 866 * @see #setQualifierType(int type) 867 */ public 868 int setModelQualifierType(String qualifier) { 869 return libsbmlJNI.CVTerm_setModelQualifierType__SWIG_1(swigCPtr, this, qualifier); 870 } 871 872 873/** 874 * Sets the biology qualifier type code of this {@link CVTerm} object. 875 * <p> 876 * @param qualifier the string representing a biology qualifier 877 * <p> 878 * @return integer value indicating success/failure of the 879 * function. The possible values 880 * returned by this function are: 881 * <ul> 882 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 883 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 884 * </ul> 885 * <p> 886 * @note If the Qualifier Type of this object is not 887 * {@link libsbmlConstants#BIOLOGICAL_QUALIFIER BIOLOGICAL_QUALIFIER}, 888 * then the biology qualifier type code value will default 889 * to {@link libsbmlConstants#BQB_UNKNOWN BQB_UNKNOWN}. 890 * <p> 891 * @see #getQualifierType() 892 * @see #setQualifierType(int type) 893 */ public 894 int setBiologicalQualifierType(String qualifier) { 895 return libsbmlJNI.CVTerm_setBiologicalQualifierType__SWIG_1(swigCPtr, this, qualifier); 896 } 897 898 899/** 900 * Adds a resource reference to this {@link CVTerm} object. 901 * <p> 902 * The SBML Level 2 and Level 3 specifications define a simple 903 * standardized format for annotating models with references to 904 * controlled vocabulary terms and database identifiers that define and 905 * describe biological or other entities. This annotation format 906 * consists of RDF-based content placed inside an 907 * <code><annotation></code> element attached to an SBML component 908 * such as {@link Species}, {@link Compartment}, etc. 909 * <p> 910 * The specific RDF element used in this SBML format for referring to 911 * external entities is <code><rdf:Description></code>, with a 912 * <code><rdf:Bag></code> element containing one or more 913 * <code><rdf:li></code> elements. Each such element refers to a 914 * data item in an external resource; the resource and data item are 915 * together identified uniquely using a URI. The following template 916 * illustrates the structure: 917 * <p> 918 <pre class='fragment'> 919 <rdf:Description rdf:about="#<span style='border-bottom: 1px solid black'>meta id</span>"> 920 <span style='background-color: #e0e0e0; border-bottom: 2px dotted #888'>HISTORY</span> 921 <<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 922 <rdf:Bag> 923 <rdf:li rdf:resource="<span style='background-color: #d0d0ee'>resource URI</span>" /> 924 <span style='background-color: #edd'>...</span> 925 </rdf:Bag> 926 </<span style='background-color: #bbb'>RELATION_ELEMENT</span>> 927 <span style='background-color: #edd'>...</span> 928 </rdf:Description> 929 </pre> 930 * <p> 931 * In the template above, the placeholder <span class='code' 932 * style='border-bottom: 1px solid black'>meta id</span> stands for the 933 * element's meta identifier, which is a field available on all SBML 934 * components derived from the {@link SBase} base object class. The <span 935 * style='border-bottom: 2px dotted #888'>dotted</span> portions are 936 * optional, and the ellipses <span class='code' 937 * style='background-color: #edd'>...</span> are placeholders for zero or 938 * more elements of the same form as the immediately preceding element. 939 * The placeholder <span class='code' style='background-color: #bbb'> 940 * RELATION_ELEMENT</span> refers to a BioModels.net qualifier element 941 * name. This is an element in either the XML namespace 942 * <code>'http://biomodels.net/model-qualifiers'</code> (for model 943 * qualifiers) or <code>'http://biomodels.net/biology-qualifiers'</code> 944 * (for biological qualifier). 945 * <p> 946 * The <span class='code' style='background-color: #d0d0ee'>resource 947 * URI</span> is a required data value that uniquely identifies a 948 * resource and data within that resource to which the annotation refers. 949 * The present method allows callers to add a reference to a resource URI 950 * with the same relationship to the enclosing SBML object. (In other 951 * words, the argument to this method is a <span class='code' 952 * style='background-color: #d0d0ee'>resource URI</span> as shown in the 953 * XML fragment above.) Resources are stored in this {@link CVTerm} object 954 * within an {@link XMLAttributes} object. 955 * <p> 956 * The relationship of this {@link CVTerm} to the enclosing SBML object can be 957 * determined using the {@link CVTerm} methods such as getModelQualifierType() 958 * and getBiologicalQualifierType(). 959 * <p> 960 * @param resource a string representing the URI of the resource and data 961 * item being referenced; e.g., 962 * <code>'http://www.geneontology.org/#GO:0005892'</code>. 963 * <p> 964 * @return integer value indicating success/failure of the call. The 965 * possible values returned by this function are: 966 * <ul> 967 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 968 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_FAILED LIBSBML_OPERATION_FAILED} 969 * </ul> 970 * <p> 971 * @see #getResources() 972 * @see #removeResource(String resource) 973 * @see #getQualifierType() 974 * @see #getModelQualifierType() 975 * @see #getBiologicalQualifierType() 976 */ public 977 int addResource(String resource) { 978 return libsbmlJNI.CVTerm_addResource(swigCPtr, this, resource); 979 } 980 981 982/** 983 * Removes a resource URI from the set of resources stored in this {@link CVTerm} 984 * object. 985 * <p> 986 * @param resource a string representing the resource URI to remove; 987 * e.g., <code>'http://www.geneontology.org/#GO:0005892'</code>. 988 * <p> 989 * @return integer value indicating success/failure of the 990 * function. The possible values 991 * returned by this function are: 992 * <ul> 993 * <li> {@link libsbmlConstants#LIBSBML_OPERATION_SUCCESS LIBSBML_OPERATION_SUCCESS} 994 * <li> {@link libsbmlConstants#LIBSBML_INVALID_ATTRIBUTE_VALUE LIBSBML_INVALID_ATTRIBUTE_VALUE} 995 * </ul> 996 * <p> 997 * @see #addResource(String resource) 998 */ public 999 int removeResource(String resource) { 1000 return libsbmlJNI.CVTerm_removeResource(swigCPtr, this, resource); 1001 } 1002 1003 1004/** 1005 * Predicate returning <code>true</code> if all the required elements for this 1006 * {@link CVTerm} object have been set. 1007 * <p> 1008 * @note The required attributes for a {@link CVTerm} are: 1009 * <ul> 1010 * <li> a <em>qualifier type</em>, which can be either a model qualifier or a biological qualifier 1011 * <li> at least one resource 1012 * </ul> 1013 */ public 1014 boolean hasRequiredAttributes() { 1015 return libsbmlJNI.CVTerm_hasRequiredAttributes(swigCPtr, this); 1016 } 1017 1018 1019/** 1020 * Predicate returning <code>true</code> if all the required elements for this 1021 * {@link CVTerm} object have been set. 1022 * <p> 1023 * @note The required attributes for a {@link CVTerm} are: 1024 * <ul> 1025 * <li> a <em>qualifier type</em>, which can be either a model qualifier or a biological qualifier 1026 * <li> at least one resource 1027 * </ul> 1028 * @internal 1029 */ public 1030 boolean hasBeenModified() { 1031 return libsbmlJNI.CVTerm_hasBeenModified(swigCPtr, this); 1032 } 1033 1034 1035/** 1036 * Predicate returning <code>true</code> if all the required elements for this 1037 * {@link CVTerm} object have been set. 1038 * <p> 1039 * @note The required attributes for a {@link CVTerm} are: 1040 * <ul> 1041 * <li> a <em>qualifier type</em>, which can be either a model qualifier or a biological qualifier 1042 * <li> at least one resource 1043 * </ul> 1044 * @internal 1045 */ public 1046 void resetModifiedFlags() { 1047 libsbmlJNI.CVTerm_resetModifiedFlags(swigCPtr, this); 1048 } 1049 1050}