1 //------------------------------------------------------------------------------ 2 // <auto-generated /> 3 // 4 // This file was automatically generated by SWIG (http://www.swig.org). 5 // Version 4.0.2 6 // 7 // Do not make changes to this file unless you know what you are doing--modify 8 // the SWIG interface file instead. 9 //------------------------------------------------------------------------------ 10 11 namespace libsbml { 12 13 using System; 14 using System.Runtime.InteropServices; 15 16 /** 17 * @sbmlpackage{core} 18 * 19 @htmlinclude pkg-marker-core.html MIRIAM-compliant RDF annotation reader/writer. 20 * 21 * @htmlinclude not-sbml-warning.html 22 * 23 * RDFAnnotationParser is a libSBML construct used as part of the libSBML 24 * support for annotations conforming to the guidelines specified by MIRIAM 25 * (<a target='_blank' 26 * href='http://www.nature.com/nbt/journal/v23/n12/abs/nbt1156.html'>'Minimum 27 * Information Requested in the Annotation of biochemical Models'</a>, 28 * <i>Nature Biotechnology</i>, vol. 23, no. 12, Dec. 2005). Section 6 of 29 * the SBML Level 2 and Level 3 specification documents defines a 30 * recommended way of encoding MIRIAM information using a subset of RDF (<a 31 * target='_blank' href='http://www.w3.org/RDF/'>Resource Description 32 * Format</a>). The general scheme is as follows. A set of RDF-based 33 * annotations attached to a given SBML <code><annotation></code> 34 * element are read by RDFAnnotationParser and converted into a list of 35 * CVTerm objects. There are different versions of the main method, @if clike RDFAnnotationParser::parseRDFAnnotation(XMLNode annotation, %List *CVTerms) @endif@if java RDFAnnotationParser::parseRDFAnnotation(XMLNode, %CVTermList) @endif and 36 * RDFAnnotationParser::parseRDFAnnotation(XMLNode annotation), used 37 * depending on whether the annotation in question concerns the MIRIAM model 38 * history or other MIRIAM resource annotations. A special object class, 39 * ModelHistory, is used to make it easier to manipulate model history 40 * annotations. 41 * 42 * All of the methods on RDFAnnotationParser are static; the class exists 43 * only to encapsulate the annotation and CVTerm parsing and manipulation 44 * functionality. 45 */ 46 47 public class RDFAnnotationParser : global::System.IDisposable { 48 private HandleRef swigCPtr; 49 protected bool swigCMemOwn; 50 RDFAnnotationParser(IntPtr cPtr, bool cMemoryOwn)51 internal RDFAnnotationParser(IntPtr cPtr, bool cMemoryOwn) 52 { 53 swigCMemOwn = cMemoryOwn; 54 swigCPtr = new HandleRef(this, cPtr); 55 } 56 getCPtr(RDFAnnotationParser obj)57 internal static HandleRef getCPtr(RDFAnnotationParser obj) 58 { 59 return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr; 60 } 61 getCPtrAndDisown(RDFAnnotationParser obj)62 internal static HandleRef getCPtrAndDisown (RDFAnnotationParser obj) 63 { 64 HandleRef ptr = new HandleRef(null, IntPtr.Zero); 65 66 if (obj != null) 67 { 68 ptr = obj.swigCPtr; 69 obj.swigCMemOwn = false; 70 } 71 72 return ptr; 73 } 74 ~RDFAnnotationParser()75 ~RDFAnnotationParser() { 76 Dispose(false); 77 } 78 Dispose()79 public void Dispose() { 80 Dispose(true); 81 global::System.GC.SuppressFinalize(this); 82 } 83 Dispose(bool disposing)84 protected virtual void Dispose(bool disposing) { 85 lock(this) { 86 if (swigCPtr.Handle != global::System.IntPtr.Zero) { 87 if (swigCMemOwn) { 88 swigCMemOwn = false; 89 libsbmlPINVOKE.delete_RDFAnnotationParser(swigCPtr); 90 } 91 swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); 92 } 93 } 94 } 95 96 97 /** 98 * Parses an annotation into a ModelHistory class instance. 99 * 100 * This is used to take an annotation that has been read into an SBML 101 * model, identify the RDF elements representing model history 102 * information, and create a list of corresponding CVTerm objects. 103 * 104 * @param annotation XMLNode containing the annotation. 105 * @param stream optional XMLInputStream that facilitates error logging. 106 * @param metaId optional metaId, if set only the RDF annotation for this metaId will be returned. 107 * 108 * 109 * @if python @note Because this is a static method on a class, the Python 110 * language interface for libSBML will contain two variants. One will be the 111 * expected, normal static method on the class (i.e., a regular 112 * <em>methodName</em>), and the other will be a standalone top-level 113 * function with the name <em>ClassName_methodName()</em>. This is merely an 114 * artifact of how the language interfaces are created in libSBML. The 115 * methods are functionally identical. @endif 116 * 117 * 118 * 119 * @return a pointer to the ModelHistory created. 120 */ public parseRDFAnnotation(XMLNode annotation, string metaId, XMLInputStream stream)121 static ModelHistory parseRDFAnnotation(XMLNode annotation, string metaId, XMLInputStream stream) { 122 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_parseRDFAnnotation__SWIG_0(XMLNode.getCPtr(annotation), metaId, XMLInputStream.getCPtr(stream)); 123 ModelHistory ret = (cPtr == global::System.IntPtr.Zero) ? null : new ModelHistory(cPtr, false); 124 return ret; 125 } 126 127 128 /** 129 * Parses an annotation into a ModelHistory class instance. 130 * 131 * This is used to take an annotation that has been read into an SBML 132 * model, identify the RDF elements representing model history 133 * information, and create a list of corresponding CVTerm objects. 134 * 135 * @param annotation XMLNode containing the annotation. 136 * @param stream optional XMLInputStream that facilitates error logging. 137 * @param metaId optional metaId, if set only the RDF annotation for this metaId will be returned. 138 * 139 * 140 * @if python @note Because this is a static method on a class, the Python 141 * language interface for libSBML will contain two variants. One will be the 142 * expected, normal static method on the class (i.e., a regular 143 * <em>methodName</em>), and the other will be a standalone top-level 144 * function with the name <em>ClassName_methodName()</em>. This is merely an 145 * artifact of how the language interfaces are created in libSBML. The 146 * methods are functionally identical. @endif 147 * 148 * 149 * 150 * @return a pointer to the ModelHistory created. 151 */ public parseRDFAnnotation(XMLNode annotation, string metaId)152 static ModelHistory parseRDFAnnotation(XMLNode annotation, string metaId) { 153 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_parseRDFAnnotation__SWIG_1(XMLNode.getCPtr(annotation), metaId); 154 ModelHistory ret = (cPtr == global::System.IntPtr.Zero) ? null : new ModelHistory(cPtr, false); 155 return ret; 156 } 157 158 159 /** 160 * Parses an annotation into a ModelHistory class instance. 161 * 162 * This is used to take an annotation that has been read into an SBML 163 * model, identify the RDF elements representing model history 164 * information, and create a list of corresponding CVTerm objects. 165 * 166 * @param annotation XMLNode containing the annotation. 167 * @param stream optional XMLInputStream that facilitates error logging. 168 * @param metaId optional metaId, if set only the RDF annotation for this metaId will be returned. 169 * 170 * 171 * @if python @note Because this is a static method on a class, the Python 172 * language interface for libSBML will contain two variants. One will be the 173 * expected, normal static method on the class (i.e., a regular 174 * <em>methodName</em>), and the other will be a standalone top-level 175 * function with the name <em>ClassName_methodName()</em>. This is merely an 176 * artifact of how the language interfaces are created in libSBML. The 177 * methods are functionally identical. @endif 178 * 179 * 180 * 181 * @return a pointer to the ModelHistory created. 182 */ public parseRDFAnnotation(XMLNode annotation)183 static ModelHistory parseRDFAnnotation(XMLNode annotation) { 184 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_parseRDFAnnotation__SWIG_2(XMLNode.getCPtr(annotation)); 185 ModelHistory ret = (cPtr == global::System.IntPtr.Zero) ? null : new ModelHistory(cPtr, false); 186 return ret; 187 } 188 189 190 /** 191 * Creates a blank annotation and returns its root XMLNode object. 192 * 193 * This creates a completely empty SBML <code><annotation></code> 194 * element. It is not attached to any SBML element. An example of how 195 * this might be used is illustrated in the following code fragment. In 196 * this example, suppose that @c content is an XMLNode object previously 197 * created, containing MIRIAM-style annotations, and that @c sbmlObject 198 * is an SBML object derived from SBase (e.g., a Model, or a Species, or 199 * a Compartment, etc.). Then:@if clike 200 @code{.cpp} 201 int success; // Status code variable. 202 203 XMLNode RDF = createRDFAnnotation(); // Create XML structure. 204 success = RDF->addChild(...content...); // Put some content into it. 205 ... // Check return code value. 206 207 XMLNode ann = createAnnotation(); // Create <annotation>. 208 success = ann->addChild(RDF); // Put the annotation into it. 209 ... // Check return code value. 210 211 success = sbmlObject->setAnnotation(ann); // Set object's annotation. 212 ... // Check return code value. 213 @endcode 214 * @endif@if java 215 @code{.java} 216 int success; // Status code variable. 217 218 XMLNode RDF = createRDFAnnotation(); // Create XML structure. 219 success = RDF.addChild(...content...); // Put some content into it. 220 ... // Check return code value. 221 222 XMLNode ann = createAnnotation(); // Create <annotation>. 223 success = ann.addChild(RDF); // Put the annotation into it. 224 ... // Check return code value. 225 226 success = sbmlObject.setAnnotation(ann); // Set object's annotation. 227 ... // Check return code value. 228 @endcode 229 * @endif@if python 230 @code{.py} 231 RDF = RDFAnnotationParser.createRDFAnnotation() # Create XML structure. 232 success = RDF.addChild(...content...) # Put some content into it. 233 ... # Check return code value. 234 235 annot = RDFAnnotationParser.createAnnotation() # Create <annotation>. 236 success = annot.addChild(RDF) # Put the annotation into it. 237 ... # Check return code value. 238 239 success = sbmlObject.setAnnotation(annot) # Set object's annotation. 240 ... # Check return code value. 241 @endcode 242 * @endif 243 * The SBML specification contains more information about the format of 244 * annotations. We urge readers to consult Section 6 of the SBML 245 * Level 2 (Versions 2–4) and SBML Level 3 specification 246 * documents. 247 * 248 * @return a pointer to an XMLNode for the annotation. 249 * 250 * 251 * @if python @note Because this is a static method on a class, the Python 252 * language interface for libSBML will contain two variants. One will be the 253 * expected, normal static method on the class (i.e., a regular 254 * <em>methodName</em>), and the other will be a standalone top-level 255 * function with the name <em>ClassName_methodName()</em>. This is merely an 256 * artifact of how the language interfaces are created in libSBML. The 257 * methods are functionally identical. @endif 258 * 259 * 260 * 261 * @see @if clike createRDFAnnotation() @else RDFAnnotationParser::createRDFAnnotation() @endif 262 */ public createAnnotation()263 static XMLNode createAnnotation() { 264 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_createAnnotation(); 265 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, true); 266 return ret; 267 } 268 269 270 /** 271 * Creates a blank RDF element suitable for use in SBML annotations. 272 * 273 * The annotation created by this method has namespace declarations for 274 * all the relevant XML namespaces used in RDF annotations and also has 275 * an empty RDF element. The result is the following XML: 276 @verbatim 277 <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' 278 xmlns:dc='http://purl.org/dc/elements/1.1/' 279 xmlns:dcterms='http://purl.org/dc/terms/' 280 xmlns:vCard='http://www.w3.org/2001/vcard-rdf/3.0#' 281 xmlns:bqbiol='http://biomodels.net/biology-qualifiers/' 282 xmlns:bqmodel='http://biomodels.net/model-qualifiers/' > 283 284 </rdf:RDF> 285 @endverbatim 286 * 287 * Note that this does not create the containing SBML 288 * <code><annotation></code> element; the method 289 * @if clike createAnnotation()@else RDFAnnotationParser::createAnnotation()@endif 290 * is available for creating the container. 291 * 292 * @return a pointer to an XMLNode. 293 * 294 * 295 * @if python @note Because this is a static method on a class, the Python 296 * language interface for libSBML will contain two variants. One will be the 297 * expected, normal static method on the class (i.e., a regular 298 * <em>methodName</em>), and the other will be a standalone top-level 299 * function with the name <em>ClassName_methodName()</em>. This is merely an 300 * artifact of how the language interfaces are created in libSBML. The 301 * methods are functionally identical. @endif 302 * 303 * 304 * 305 * @see @if clike createAnnotation() @else RDFAnnotationParser::createAnnotation() @endif 306 */ public createRDFAnnotation(long level, long version)307 static XMLNode createRDFAnnotation(long level, long version) { 308 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_createRDFAnnotation__SWIG_0(level, version); 309 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, true); 310 return ret; 311 } 312 313 314 /** 315 * Creates a blank RDF element suitable for use in SBML annotations. 316 * 317 * The annotation created by this method has namespace declarations for 318 * all the relevant XML namespaces used in RDF annotations and also has 319 * an empty RDF element. The result is the following XML: 320 @verbatim 321 <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' 322 xmlns:dc='http://purl.org/dc/elements/1.1/' 323 xmlns:dcterms='http://purl.org/dc/terms/' 324 xmlns:vCard='http://www.w3.org/2001/vcard-rdf/3.0#' 325 xmlns:bqbiol='http://biomodels.net/biology-qualifiers/' 326 xmlns:bqmodel='http://biomodels.net/model-qualifiers/' > 327 328 </rdf:RDF> 329 @endverbatim 330 * 331 * Note that this does not create the containing SBML 332 * <code><annotation></code> element; the method 333 * @if clike createAnnotation()@else RDFAnnotationParser::createAnnotation()@endif 334 * is available for creating the container. 335 * 336 * @return a pointer to an XMLNode. 337 * 338 * 339 * @if python @note Because this is a static method on a class, the Python 340 * language interface for libSBML will contain two variants. One will be the 341 * expected, normal static method on the class (i.e., a regular 342 * <em>methodName</em>), and the other will be a standalone top-level 343 * function with the name <em>ClassName_methodName()</em>. This is merely an 344 * artifact of how the language interfaces are created in libSBML. The 345 * methods are functionally identical. @endif 346 * 347 * 348 * 349 * @see @if clike createAnnotation() @else RDFAnnotationParser::createAnnotation() @endif 350 */ public createRDFAnnotation(long level)351 static XMLNode createRDFAnnotation(long level) { 352 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_createRDFAnnotation__SWIG_1(level); 353 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, true); 354 return ret; 355 } 356 357 358 /** 359 * Creates a blank RDF element suitable for use in SBML annotations. 360 * 361 * The annotation created by this method has namespace declarations for 362 * all the relevant XML namespaces used in RDF annotations and also has 363 * an empty RDF element. The result is the following XML: 364 @verbatim 365 <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#' 366 xmlns:dc='http://purl.org/dc/elements/1.1/' 367 xmlns:dcterms='http://purl.org/dc/terms/' 368 xmlns:vCard='http://www.w3.org/2001/vcard-rdf/3.0#' 369 xmlns:bqbiol='http://biomodels.net/biology-qualifiers/' 370 xmlns:bqmodel='http://biomodels.net/model-qualifiers/' > 371 372 </rdf:RDF> 373 @endverbatim 374 * 375 * Note that this does not create the containing SBML 376 * <code><annotation></code> element; the method 377 * @if clike createAnnotation()@else RDFAnnotationParser::createAnnotation()@endif 378 * is available for creating the container. 379 * 380 * @return a pointer to an XMLNode. 381 * 382 * 383 * @if python @note Because this is a static method on a class, the Python 384 * language interface for libSBML will contain two variants. One will be the 385 * expected, normal static method on the class (i.e., a regular 386 * <em>methodName</em>), and the other will be a standalone top-level 387 * function with the name <em>ClassName_methodName()</em>. This is merely an 388 * artifact of how the language interfaces are created in libSBML. The 389 * methods are functionally identical. @endif 390 * 391 * 392 * 393 * @see @if clike createAnnotation() @else RDFAnnotationParser::createAnnotation() @endif 394 */ public createRDFAnnotation()395 static XMLNode createRDFAnnotation() { 396 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_createRDFAnnotation__SWIG_2(); 397 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, true); 398 return ret; 399 } 400 401 402 /** 403 * Takes a list of CVTerm objects and creates a the RDF 'Description' 404 * element. 405 * 406 * This essentially takes the given SBML object, reads out the CVTerm 407 * objects attached to it, creates an RDF 'Description' element to hold 408 * the terms, and adds each term with appropriate qualifiers. 409 * 410 * @param obj the SBML object to start from. 411 * 412 * @return the XMLNode tree corresponding to the Description element of 413 * an RDF annotation. 414 * 415 * 416 * @if python @note Because this is a static method on a class, the Python 417 * language interface for libSBML will contain two variants. One will be the 418 * expected, normal static method on the class (i.e., a regular 419 * <em>methodName</em>), and the other will be a standalone top-level 420 * function with the name <em>ClassName_methodName()</em>. This is merely an 421 * artifact of how the language interfaces are created in libSBML. The 422 * methods are functionally identical. @endif 423 * 424 * 425 */ public createCVTerms(SBase obj)426 static XMLNode createCVTerms(SBase obj) { 427 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_createCVTerms(SBase.getCPtr(obj)); 428 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, true); 429 return ret; 430 } 431 432 433 /** 434 * Takes a list of CVTerm objects and creates a complete SBML annotation 435 * around it. 436 * 437 * This essentially takes the given SBML object, reads out the CVTerm 438 * objects attached to it, calls @if clike createRDFAnnotation()@else 439 * RDFAnnotationParser::createRDFAnnotation()@endif to create an RDF 440 * annotation to hold the terms, and finally calls @if clike 441 * createAnnotation()@else 442 * RDFAnnotationParser::createAnnotation()@endif to wrap the result as 443 * an SBML <code><annotation></code> element. 444 * 445 * @param obj the SBML object to start from. 446 * 447 * @return the XMLNode tree corresponding to the annotation. 448 * 449 * 450 * @if python @note Because this is a static method on a class, the Python 451 * language interface for libSBML will contain two variants. One will be the 452 * expected, normal static method on the class (i.e., a regular 453 * <em>methodName</em>), and the other will be a standalone top-level 454 * function with the name <em>ClassName_methodName()</em>. This is merely an 455 * artifact of how the language interfaces are created in libSBML. The 456 * methods are functionally identical. @endif 457 * 458 * 459 */ public parseCVTerms(SBase obj)460 static XMLNode parseCVTerms(SBase obj) { 461 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_parseCVTerms(SBase.getCPtr(obj)); 462 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, true); 463 return ret; 464 } 465 466 467 /** 468 * Reads the model history and cvTerms stored in @p obj and creates the 469 * XML structure for an SBML annotation representing that metadata if 470 * there is a model history stored in @p obj. 471 * 472 * @param obj any SBase object. 473 * 474 * @return the XMLNode corresponding to an annotation containing 475 * MIRIAM-compliant model history and CV term information in RDF format. 476 * 477 * @note If the object does not have a history element stored then 478 * @c null is returned even if CVTerms are present. 479 * 480 * 481 * @if python @note Because this is a static method on a class, the Python 482 * language interface for libSBML will contain two variants. One will be the 483 * expected, normal static method on the class (i.e., a regular 484 * <em>methodName</em>), and the other will be a standalone top-level 485 * function with the name <em>ClassName_methodName()</em>. This is merely an 486 * artifact of how the language interfaces are created in libSBML. The 487 * methods are functionally identical. @endif 488 * 489 * 490 */ public parseModelHistory(SBase obj)491 static XMLNode parseModelHistory(SBase obj) { 492 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_parseModelHistory(SBase.getCPtr(obj)); 493 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, true); 494 return ret; 495 } 496 497 498 /** 499 * Reads the model history stored in @p obj and creates the 500 * XML structure for an SBML annotation representing that history. 501 * 502 * @param obj any SBase object. 503 * 504 * @return the XMLNode corresponding to an annotation containing 505 * MIRIAM-compliant model history information in RDF format. 506 * 507 * 508 * @if python @note Because this is a static method on a class, the Python 509 * language interface for libSBML will contain two variants. One will be the 510 * expected, normal static method on the class (i.e., a regular 511 * <em>methodName</em>), and the other will be a standalone top-level 512 * function with the name <em>ClassName_methodName()</em>. This is merely an 513 * artifact of how the language interfaces are created in libSBML. The 514 * methods are functionally identical. @endif 515 * 516 * 517 */ public parseOnlyModelHistory(SBase obj)518 static XMLNode parseOnlyModelHistory(SBase obj) { 519 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_parseOnlyModelHistory(SBase.getCPtr(obj)); 520 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, false); 521 return ret; 522 } 523 524 525 /** 526 * Deletes any SBML MIRIAM RDF annotation found in the given XMLNode 527 * tree and returns 528 * any remaining annotation content. 529 * 530 * The name of the XMLNode given as parameter @p annotation must be 531 * 'annotation', or else this method returns @c null. The method will 532 * walk down the XML structure looking for elements that are in the 533 * RDF XML namespace, and remove them if they conform to the syntax 534 * of a History or CVTerm element. 535 * 536 * @param annotation the XMLNode tree within which the RDF annotation is 537 * to be found and deleted. 538 * 539 * @return the XMLNode structure that is left after RDF annotations are 540 * deleted. 541 * 542 * 543 * @if python @note Because this is a static method on a class, the Python 544 * language interface for libSBML will contain two variants. One will be the 545 * expected, normal static method on the class (i.e., a regular 546 * <em>methodName</em>), and the other will be a standalone top-level 547 * function with the name <em>ClassName_methodName()</em>. This is merely an 548 * artifact of how the language interfaces are created in libSBML. The 549 * methods are functionally identical. @endif 550 * 551 * 552 */ public deleteRDFAnnotation(XMLNode annotation)553 static XMLNode deleteRDFAnnotation(XMLNode annotation) { 554 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_deleteRDFAnnotation(XMLNode.getCPtr(annotation)); 555 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, true); 556 return ret; 557 } 558 559 560 /** 561 * Deletes any SBML MIRIAM RDF 'History' annotation found in the given 562 * XMLNode tree and returns 563 * any remaining annotation content. 564 * 565 * The name of the XMLNode given as parameter @p annotation must be 566 * 'annotation', or else this method returns @c null. The method will 567 * walk down the XML structure looking for elements that are in the 568 * RDF XML namespace, and remove any that conform to the syntax of a 569 * History element. 570 * 571 * @param annotation the XMLNode tree within which the RDF annotation is 572 * to be found and deleted. 573 * 574 * @return the XMLNode structure that is left after RDF annotations are 575 * deleted. 576 * 577 * 578 * @if python @note Because this is a static method on a class, the Python 579 * language interface for libSBML will contain two variants. One will be the 580 * expected, normal static method on the class (i.e., a regular 581 * <em>methodName</em>), and the other will be a standalone top-level 582 * function with the name <em>ClassName_methodName()</em>. This is merely an 583 * artifact of how the language interfaces are created in libSBML. The 584 * methods are functionally identical. @endif 585 * 586 * 587 */ public deleteRDFHistoryAnnotation(XMLNode annotation)588 static XMLNode deleteRDFHistoryAnnotation(XMLNode annotation) { 589 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_deleteRDFHistoryAnnotation(XMLNode.getCPtr(annotation)); 590 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, false); 591 return ret; 592 } 593 594 595 /** 596 * Deletes any SBML MIRIAM RDF 'CVTerm' annotation found in the given 597 * XMLNode tree and returns 598 * any remaining annotation content. 599 * 600 * The name of the XMLNode given as parameter @p annotation must be 601 * 'annotation', or else this method returns @c null. The method will 602 * walk down the XML structure looking for elements that are in the 603 * RDF XML namespace, and remove any that conform to the syntax of a 604 * CVTerm element. 605 * 606 * @param annotation the XMLNode tree within which the RDF annotation is 607 * to be found and deleted. 608 * 609 * @return the XMLNode structure that is left after RDF annotations are 610 * deleted. 611 * 612 * 613 * @if python @note Because this is a static method on a class, the Python 614 * language interface for libSBML will contain two variants. One will be the 615 * expected, normal static method on the class (i.e., a regular 616 * <em>methodName</em>), and the other will be a standalone top-level 617 * function with the name <em>ClassName_methodName()</em>. This is merely an 618 * artifact of how the language interfaces are created in libSBML. The 619 * methods are functionally identical. @endif 620 * 621 * 622 */ public deleteRDFCVTermAnnotation(XMLNode annotation)623 static XMLNode deleteRDFCVTermAnnotation(XMLNode annotation) { 624 global::System.IntPtr cPtr = libsbmlPINVOKE.RDFAnnotationParser_deleteRDFCVTermAnnotation(XMLNode.getCPtr(annotation)); 625 XMLNode ret = (cPtr == global::System.IntPtr.Zero) ? null : new XMLNode(cPtr, false); 626 return ret; 627 } 628 parseRDFAnnotation(XMLNode annotation, CVTermList CVTerms)629 public static void parseRDFAnnotation(XMLNode annotation, CVTermList CVTerms) { 630 libsbmlPINVOKE.RDFAnnotationParser_parseRDFAnnotation__SWIG_3(XMLNode.getCPtr(annotation), CVTermList.getCPtr(CVTerms)); 631 } 632 parseRDFAnnotation(XMLNode annotation, CVTermList CVTerms, string metaId, XMLInputStream stream)633 public static void parseRDFAnnotation(XMLNode annotation, CVTermList CVTerms, string metaId, XMLInputStream stream) { 634 libsbmlPINVOKE.RDFAnnotationParser_parseRDFAnnotation__SWIG_4(XMLNode.getCPtr(annotation), CVTermList.getCPtr(CVTerms), metaId, XMLInputStream.getCPtr(stream)); 635 } 636 parseRDFAnnotation(XMLNode annotation, CVTermList CVTerms, string metaId)637 public static void parseRDFAnnotation(XMLNode annotation, CVTermList CVTerms, string metaId) { 638 libsbmlPINVOKE.RDFAnnotationParser_parseRDFAnnotation__SWIG_5(XMLNode.getCPtr(annotation), CVTermList.getCPtr(CVTerms), metaId); 639 } 640 RDFAnnotationParser()641 public RDFAnnotationParser() : this(libsbmlPINVOKE.new_RDFAnnotationParser(), true) { 642 } 643 644 } 645 646 } 647