本文整理汇总了C#中libsbmlcs.Model.setMetaId方法的典型用法代码示例。如果您正苦于以下问题:C# Model.setMetaId方法的具体用法?C# Model.setMetaId怎么用?C# Model.setMetaId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类libsbmlcs.Model
的用法示例。
在下文中一共展示了Model.setMetaId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: test_internal_consistency_check_99904_model
public void test_internal_consistency_check_99904_model()
{
SBMLDocument d = new SBMLDocument(2,4);
long errors;
d.setLevelAndVersion(1,2,false);
Model m = new Model(2,4);
Compartment c = m.createCompartment();
c.setId("cc");
m.setMetaId("mmm");
d.setModel(m);
errors = d.checkInternalConsistency();
assertTrue( errors == 1 );
assertTrue( d.getError(0).getErrorId() == 20201 );
d = null;
}
示例2: test_RDFAnnotation_parseCVTerms
public void test_RDFAnnotation_parseCVTerms()
{
XMLNode node = RDFAnnotationParser.parseCVTerms(m.getCompartment(0));
assertTrue( node.getNumChildren() == 1 );
XMLNode rdf = node.getChild(0);
assertTrue(( "RDF" == rdf.getName() ));
assertTrue(( "rdf" == rdf.getPrefix() ));
assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == rdf.getURI() ));
assertTrue( rdf.getNumChildren() == 1 );
XMLNode desc = rdf.getChild(0);
assertTrue(( "Description" == desc.getName() ));
assertTrue(( "rdf" == desc.getPrefix() ));
assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == desc.getURI() ));
assertTrue( desc.getNumChildren() == 1 );
XMLNode is1 = desc.getChild(0);
assertTrue(( "is" == is1.getName() ));
assertTrue(( "bqbiol" == is1.getPrefix() ));
assertTrue( is1.getNumChildren() == 1 );
XMLNode Bag = is1.getChild(0);
assertTrue(( "Bag" == Bag.getName() ));
assertTrue(( "rdf" == Bag.getPrefix() ));
assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == Bag.getURI() ));
assertTrue( Bag.getNumChildren() == 4 );
XMLNode li = Bag.getChild(0);
assertTrue(( "li" == li.getName() ));
assertTrue(( "rdf" == li.getPrefix() ));
assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li.getURI() ));
assertTrue( li.getNumChildren() == 0 );
XMLNode li1 = Bag.getChild(1);
assertTrue(( "li" == li1.getName() ));
assertTrue(( "rdf" == li1.getPrefix() ));
assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li1.getURI() ));
assertTrue( li1.getNumChildren() == 0 );
XMLNode li2 = Bag.getChild(2);
assertTrue(( "li" == li2.getName() ));
assertTrue(( "rdf" == li2.getPrefix() ));
assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li2.getURI() ));
assertTrue( li2.getNumChildren() == 0 );
XMLNode li3 = Bag.getChild(3);
assertTrue(( "li" == li3.getName() ));
assertTrue(( "rdf" == li3.getPrefix() ));
assertTrue(( "http://www.w3.org/1999/02/22-rdf-syntax-ns#" == li3.getURI() ));
assertTrue( li3.getNumChildren() == 0 );
node = null;
XMLNode node1 = RDFAnnotationParser.parseCVTerms(null);
assertTrue( node1 == null );
node1 = RDFAnnotationParser.createCVTerms(null);
assertTrue( node1 == null );
node1 = RDFAnnotationParser.parseCVTerms(m.getCompartment(2));
assertTrue( node1 == null );
node1 = RDFAnnotationParser.createCVTerms(m.getCompartment(2));
assertTrue( node1 == null );
node1 = RDFAnnotationParser.parseCVTerms(m);
assertTrue( node1 == null );
node1 = RDFAnnotationParser.createCVTerms(m);
assertTrue( node1 == null );
Compartment c = new Compartment(3,1);
c.setMetaId("_002");
node1 = RDFAnnotationParser.parseCVTerms(c);
assertTrue( node1 == null );
node1 = RDFAnnotationParser.createCVTerms(c);
assertTrue( node1 == null );
CVTerm cv = new CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
cv.setBiologicalQualifierType(23);
cv.addResource("http://myres");
c.addCVTerm(cv);
node1 = RDFAnnotationParser.createCVTerms(c);
assertTrue( node1 == null );
c = null;
Model m1 = new Model(3,1);
m1.setMetaId("_002");
cv = new CVTerm(libsbml.MODEL_QUALIFIER);
cv.setModelQualifierType(23);
cv.addResource("http://myres");
m1.addCVTerm(cv);
node1 = RDFAnnotationParser.createCVTerms(m1);
assertTrue( node1 == null );
}
示例3: test_SyncAnnotation_stringChangesMetaid1
public void test_SyncAnnotation_stringChangesMetaid1()
{
Model c = new Model(2, 3);
c.setMetaId("_000005");
c.setId("A");
string addedAnn =
" <annotation>\n" +
" <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:vCard=\"http://www.w3.org/2001/vcard-rdf/3.0#\" xmlns:bqbiol=\"http://biomodels.net/biology-qualifiers/\" xmlns:bqmodel=\"http://biomodels.net/model-qualifiers/\">\n" +
" <rdf:Description rdf:about=\"#_000003\">\n" +
" <dc:creator>\n" +
" <rdf:Bag>\n" +
" <rdf:li rdf:parseType=\"Resource\">\n" +
" <vCard:N rdf:parseType=\"Resource\">\n" +
" <vCard:Family>Le Novere</vCard:Family>\n" +
" <vCard:Given>Nicolas</vCard:Given>\n" +
" </vCard:N>\n" +
" <vCard:EMAIL>[email protected]</vCard:EMAIL>\n" +
" <vCard:ORG rdf:parseType=\"Resource\">\n" +
" <vCard:Orgname>EMBL-EBI</vCard:Orgname>\n" +
" </vCard:ORG>\n" +
" </rdf:li>\n" +
" </rdf:Bag>\n" +
" </dc:creator>\n" +
" <dcterms:created rdf:parseType=\"Resource\">\n" +
" <dcterms:W3CDTF>2005-02-02T14:56:11Z</dcterms:W3CDTF>\n" +
" </dcterms:created>\n" +
" <dcterms:modified rdf:parseType=\"Resource\">\n" +
" <dcterms:W3CDTF>2006-05-30T10:46:02Z</dcterms:W3CDTF>\n" +
" </dcterms:modified>\n" +
" <bqbiol:is>\n" +
" <rdf:Bag>\n" +
" <rdf:li rdf:resource=\"http://www.geneontology.org/#GO:0007274\"/>\n" +
" </rdf:Bag>\n" +
" </bqbiol:is>\n" +
" </rdf:Description>\n" +
" </rdf:RDF>\n" +
" </annotation>";
c.setAnnotation(addedAnn);
string expected =
"<model metaid=\"_000005\" id=\"A\">\n" +
" <annotation>\n" +
" <rdf:RDF xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:dcterms=\"http://purl.org/dc/terms/\" xmlns:vCard=\"http://www.w3.org/2001/vcard-rdf/3.0#\" xmlns:bqbiol=\"http://biomodels.net/biology-qualifiers/\" xmlns:bqmodel=\"http://biomodels.net/model-qualifiers/\">\n" +
" <rdf:Description rdf:about=\"#_000005\">\n" +
" <dc:creator rdf:parseType=\"Resource\">\n" +
" <rdf:Bag>\n" +
" <rdf:li rdf:parseType=\"Resource\">\n" +
" <vCard:N rdf:parseType=\"Resource\">\n" +
" <vCard:Family>Le Novere</vCard:Family>\n" +
" <vCard:Given>Nicolas</vCard:Given>\n" +
" </vCard:N>\n" +
" <vCard:EMAIL>[email protected]</vCard:EMAIL>\n" +
" <vCard:ORG>\n" +
" <vCard:Orgname>EMBL-EBI</vCard:Orgname>\n" +
" </vCard:ORG>\n" +
" </rdf:li>\n" +
" </rdf:Bag>\n" +
" </dc:creator>\n" +
" <dcterms:created rdf:parseType=\"Resource\">\n" +
" <dcterms:W3CDTF>2005-02-02T14:56:11Z</dcterms:W3CDTF>\n" +
" </dcterms:created>\n" +
" <dcterms:modified rdf:parseType=\"Resource\">\n" +
" <dcterms:W3CDTF>2006-05-30T10:46:02Z</dcterms:W3CDTF>\n" +
" </dcterms:modified>\n" +
" <bqbiol:is>\n" +
" <rdf:Bag>\n" +
" <rdf:li rdf:resource=\"http://www.geneontology.org/#GO:0007274\"/>\n" +
" </rdf:Bag>\n" +
" </bqbiol:is>\n" +
" </rdf:Description>\n" +
" </rdf:RDF>\n" +
" </annotation>\n" +
"</model>";
assertEquals(true, equals(expected, c.toSBML()));
}