File tree 3 files changed +29
-1
lines changed
3 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -432,10 +432,18 @@ START_TEST(test_FbcExtension_create_and_write_L3V1V3)
432
432
// check annotations on several types
433
433
FbcSBasePlugin* sbaseplugin = dynamic_cast <FbcSBasePlugin*>(compartment->getPlugin (" fbc" ));
434
434
435
+ auto * term = new CVTerm ();
436
+ term->setQualifierType (BIOLOGICAL_QUALIFIER);
437
+ term->setBiologicalQualifierType (BQB_IS);
438
+ term->addResource (" MyResourceThatWillBeWrittenAndRead" );
439
+
435
440
KeyValuePair * kvp = sbaseplugin->createKeyValuePair ();
436
441
kvp->setKey (" key" );
437
442
kvp->setUri (" my_annotation" );
438
443
kvp->setValue (" comp-value" );
444
+ kvp->setMetaId (" metaid_kvp" );
445
+
446
+ kvp->addCVTerm (term);
439
447
440
448
FbcSBasePlugin* sbaseplugin1 = dynamic_cast <FbcSBasePlugin*>(species->getPlugin (" fbc" ));
441
449
@@ -471,14 +479,17 @@ START_TEST(test_FbcExtension_create_and_write_L3V1V3)
471
479
string s1 = writeSBMLToStdString (document);
472
480
473
481
// cout << s1 << endl;
482
+ fail_unless (s1.find (" MyResourceThatWillBeWrittenAndRead" ) != string::npos);
474
483
475
484
char *filename = safe_strcat (TestDataDirectory, " fbc_example2_v3.xml" );
476
485
SBMLDocument *document1 = readSBMLFromFile (filename);
477
486
string s2 = writeSBMLToStdString (document1);
487
+ fail_unless (s2.find (" MyResourceThatWillBeWrittenAndRead" ) != string::npos);
478
488
479
489
// cout << endl << s2 << endl;
480
490
fail_unless (s1 == s2);
481
491
492
+
482
493
delete sbmlns;
483
494
delete document;
484
495
delete document1;
Original file line number Diff line number Diff line change 10
10
<compartment id =" comp" spatialDimensions =" 3" size =" 1" constant =" true" >
11
11
<annotation >
12
12
<listOfKeyValuePairs xmlns =" http://sbml.org/fbc/keyvaluepair" >
13
- <keyValuePair key =" key" value =" comp-value" uri =" my_annotation" />
13
+ <keyValuePair key =" key" value =" comp-value" uri =" my_annotation" >
14
+ <annotation >
15
+ <rdf : RDF xmlns : rdf =" http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns : dcterms =" http://purl.org/dc/terms/" xmlns : vCard =" http://www.w3.org/2001/vcard-rdf/3.0#" xmlns : vCard4 =" http://www.w3.org/2006/vcard/ns#" xmlns : bqbiol =" http://biomodels.net/biology-qualifiers/" xmlns : bqmodel =" http://biomodels.net/model-qualifiers/" >
16
+ <rdf : Description rdf : about =" #metaid_kvp" >
17
+ <bqbiol : is >
18
+ <rdf : Bag >
19
+ <rdf : li rdf : resource =" MyResourceThatWillBeWrittenAndRead" />
20
+ </rdf : Bag >
21
+ </bqbiol : is >
22
+ </rdf : Description >
23
+ </rdf : RDF >
24
+ </annotation >
25
+ </keyValuePair >
14
26
</listOfKeyValuePairs >
15
27
</annotation >
16
28
</compartment >
Original file line number Diff line number Diff line change @@ -1144,6 +1144,11 @@ KeyValuePair::toXML() const
1144
1144
XMLToken token = XMLToken (triple, att, xmlns);
1145
1145
XMLNode node (token);
1146
1146
1147
+ if (mNotes ) node.addChild (*this ->mNotes );
1148
+ const_cast <KeyValuePair *> (this )->syncAnnotation ();
1149
+ if (mAnnotation ) node.addChild (*this ->mAnnotation );
1150
+
1151
+
1147
1152
return node;
1148
1153
}
1149
1154
You can’t perform that action at this time.
0 commit comments