setBiologicalQualifierType() public méthode

public setBiologicalQualifierType ( int type ) : int
type int
Résultat int
 public void test_SBase_addCVTerms()
 {
     CVTerm cv = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv.setBiologicalQualifierType(libsbml.BQB_ENCODES);
       cv.addResource( "foo");
       int i = S.addCVTerm(cv);
       assertTrue( i == libsbml.LIBSBML_UNEXPECTED_ATTRIBUTE );
       assertTrue( S.getNumCVTerms() == 0 );
       S.setMetaId( "_id");
       i = S.addCVTerm(cv);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( S.getNumCVTerms() == 1 );
       assertTrue( S.getCVTerms() != null );
       i = S.addCVTerm(null);
       assertTrue( i == libsbml.LIBSBML_OPERATION_FAILED );
       assertTrue( S.getNumCVTerms() == 1 );
       assertTrue( S.getCVTerms() != null );
       CVTerm cv2 = new  CVTerm(libsbml.MODEL_QUALIFIER);
       i = S.addCVTerm(cv2);
       assertTrue( i == libsbml.LIBSBML_INVALID_OBJECT );
       assertTrue( S.getNumCVTerms() == 1 );
       assertTrue( S.getCVTerms() != null );
       cv = null;
       cv2 = null;
 }
 public void test_Validation_CVTerm2()
 {
     CVTerm cv = new CVTerm();
       assertTrue( cv != null );
       assertEquals( false, (cv.hasRequiredAttributes()) );
       cv.setQualifierType(libsbml.BIOLOGICAL_QUALIFIER);
       assertEquals( false, (cv.hasRequiredAttributes()) );
       cv.setBiologicalQualifierType(libsbml.BQB_IS);
       assertEquals( false, (cv.hasRequiredAttributes()) );
       cv.addResource("ggg");
       assertEquals( true, (cv.hasRequiredAttributes()) );
       cv = null;
 }
Exemple #3
0
 public void test_SBase_addCVTerms()
 {
     CVTerm cv = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv.setBiologicalQualifierType(libsbml.BQB_ENCODES);
       cv.addResource( "foo");
       S.setMetaId( "sbase1");
       S.addCVTerm(cv);
       assertTrue( S.getNumCVTerms() == 1 );
       assertTrue( S.getCVTerms() != null );
       XMLAttributes res = S.getCVTerm(0).getResources();
       assertTrue((  "foo" == res.getValue(0) ));
       CVTerm cv1 = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv1.setBiologicalQualifierType(libsbml.BQB_IS);
       cv1.addResource( "bar");
       S.addCVTerm(cv1);
       assertTrue( S.getNumCVTerms() == 2 );
       CVTerm cv2 = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv2.setBiologicalQualifierType(libsbml.BQB_IS);
       cv2.addResource( "bar1");
       S.addCVTerm(cv2);
       assertTrue( S.getNumCVTerms() == 2 );
       res = S.getCVTerm(1).getResources();
       assertTrue( res.getLength() == 2 );
       assertTrue((  "bar" == res.getValue(0) ));
       assertTrue((  "bar1" == res.getValue(1) ));
       CVTerm cv4 = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv4.setBiologicalQualifierType(libsbml.BQB_IS);
       cv4.addResource( "bar1");
       S.addCVTerm(cv4);
       assertTrue( S.getNumCVTerms() == 2 );
       res = S.getCVTerm(1).getResources();
       assertTrue( res.getLength() == 2 );
       assertTrue((  "bar" == res.getValue(0) ));
       assertTrue((  "bar1" == res.getValue(1) ));
       CVTerm cv5 = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv5.setBiologicalQualifierType(libsbml.BQB_HAS_PART);
       cv5.addResource( "bar1");
       S.addCVTerm(cv5);
       assertTrue( S.getNumCVTerms() == 2 );
       res = S.getCVTerm(1).getResources();
       assertTrue( res.getLength() == 2 );
       assertTrue((  "bar" == res.getValue(0) ));
       assertTrue((  "bar1" == res.getValue(1) ));
       cv = null;
       cv2 = null;
       cv1 = null;
       cv4 = null;
 }
Exemple #4
0
 public void test_SBase_unsetCVTerms()
 {
     CVTerm cv = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv.setBiologicalQualifierType(libsbml.BQB_ENCODES);
       cv.addResource( "foo");
       S.setMetaId( "sbase1");
       S.addCVTerm(cv);
       CVTerm cv1 = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv1.setBiologicalQualifierType(libsbml.BQB_IS);
       cv1.addResource( "bar");
       S.addCVTerm(cv1);
       CVTerm cv2 = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv2.setBiologicalQualifierType(libsbml.BQB_IS);
       cv2.addResource( "bar1");
       S.addCVTerm(cv2);
       CVTerm cv4 = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv4.setBiologicalQualifierType(libsbml.BQB_IS);
       cv4.addResource( "bar1");
       S.addCVTerm(cv4);
       assertTrue( S.getNumCVTerms() == 2 );
       S.unsetCVTerms();
       assertTrue( S.getNumCVTerms() == 0 );
       assertTrue( S.getCVTerms() == null );
       cv = null;
       cv2 = null;
       cv1 = null;
       cv4 = null;
 }
Exemple #5
0
 public void test_SBase_unsetAnnotationWithCVTerms()
 {
     CVTerm cv;
       string annt = "<annotation>\n" +
     "  <test:test xmlns:test=\"http://test.org/test\">this is a test node</test:test>\n" +
     "</annotation>";
       string annt_with_cvterm = "<annotation>\n" +
     "  <test:test xmlns:test=\"http://test.org/test\">this is a test node</test:test>\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=\"#_000001\">\n" +
     "      <bqbiol:is>\n" +
     "        <rdf:Bag>\n" +
     "          <rdf:li rdf:resource=\"http://www.geneontology.org/#GO:0005895\"/>\n" +
     "        </rdf:Bag>\n" +
     "      </bqbiol:is>\n" +
     "    </rdf:Description>\n" +
     "  </rdf:RDF>\n" +
     "</annotation>";
       S.setAnnotation(annt);
       assertTrue( S.isSetAnnotation() == true );
       assertTrue(( annt == S.getAnnotationString() ));
       S.unsetAnnotation();
       assertTrue( S.isSetAnnotation() == false );
       assertTrue( S.getAnnotation() == null );
       S.setAnnotation(annt);
       S.setMetaId( "_000001");
       cv = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv.setBiologicalQualifierType(libsbml.BQB_IS);
       cv.addResource( "http://www.geneontology.org/#GO:0005895");
       S.addCVTerm(cv);
       assertTrue( S.isSetAnnotation() == true );
       assertTrue(( annt_with_cvterm == S.getAnnotationString() ));
       S.unsetAnnotation();
       assertTrue( S.isSetAnnotation() == false );
       assertTrue( S.getAnnotation() == null );
       cv = null;
 }
Exemple #6
0
 public void test_SBase_getQualifiersFromResources()
 {
     CVTerm cv = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv.setBiologicalQualifierType(libsbml.BQB_ENCODES);
       cv.addResource( "foo");
       S.setMetaId( "sbase1");
       S.addCVTerm(cv);
       assertTrue( S.getResourceBiologicalQualifier( "foo") == libsbml.BQB_ENCODES );
       CVTerm cv1 = new  CVTerm(libsbml.MODEL_QUALIFIER);
       cv1.setModelQualifierType(libsbml.BQM_IS);
       cv1.addResource( "bar");
       S.addCVTerm(cv1);
       assertTrue( S.getResourceModelQualifier( "bar") == libsbml.BQM_IS );
       cv = null;
       cv1 = null;
 }
Exemple #7
0
 public void test_SBase_CVTerms()
 {
     CVTerm cv = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       cv.setBiologicalQualifierType(libsbml.BQB_IS);
       cv.addResource( "foo");
       assertTrue( S.getNumCVTerms() == 0 );
       assertTrue( S.getCVTerms() == null );
       S.setMetaId( "_id");
       S.addCVTerm(cv);
       assertTrue( S.getNumCVTerms() == 1 );
       assertTrue( S.getCVTerms() != null );
       assertTrue( S.getCVTerm(0) != cv );
       cv = null;
 }
 public void test_RDFAnnotation2_modelWithHistoryAndCVTerms()
 {
     ModelHistory h = new ModelHistory();
       ModelCreator c = new ModelCreator();
       c.setFamilyName("Keating");
       c.setGivenName("Sarah");
       h.addCreator(c);
       Date d = new Date(2008,11,17,18,37,0,0,0,0);
       h.setCreatedDate(d);
       h.setModifiedDate(d);
       m2.unsetModelHistory();
       m2.setModelHistory(h);
       CVTerm cv = new CVTerm();
       cv.setQualifierType(libsbml.BIOLOGICAL_QUALIFIER);
       cv.setBiologicalQualifierType(libsbml.BQB_IS_VERSION_OF);
       cv.addResource("http://www.geneontology.org/#GO:0005892");
       m2.addCVTerm(cv);
       XMLNode ann = RDFAnnotationParser.parseModelHistory(m2);
       string expected = "<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=\"#_000001\">\n" +
     "      <dc:creator rdf:parseType=\"Resource\">\n" +
     "        <rdf:Bag>\n" +
     "          <rdf:li rdf:parseType=\"Resource\">\n" +
     "            <vCard:N rdf:parseType=\"Resource\">\n" +
     "              <vCard:Family>Keating</vCard:Family>\n" +
     "              <vCard:Given>Sarah</vCard:Given>\n" +
     "            </vCard:N>\n" +
     "          </rdf:li>\n" +
     "        </rdf:Bag>\n" +
     "      </dc:creator>\n" +
     "      <dcterms:created rdf:parseType=\"Resource\">\n" +
     "        <dcterms:W3CDTF>2008-11-17T18:37:00Z</dcterms:W3CDTF>\n" +
     "      </dcterms:created>\n" +
     "      <dcterms:modified rdf:parseType=\"Resource\">\n" +
     "        <dcterms:W3CDTF>2008-11-17T18:37:00Z</dcterms:W3CDTF>\n" +
     "      </dcterms:modified>\n" +
     "      <bqbiol:isVersionOf>\n" +
     "        <rdf:Bag>\n" +
     "          <rdf:li rdf:resource=\"http://www.geneontology.org/#GO:0005892\"/>\n" +
     "        </rdf:Bag>\n" +
     "      </bqbiol:isVersionOf>\n" +
     "    </rdf:Description>\n" +
     "  </rdf:RDF>\n" +
     "</annotation>";
       if (ann != null);
       {
     assertEquals( true, equals(expected,ann.toXMLString()) );
       }
       {
       }
 }
Exemple #9
0
 public void test_CVTerm_set_get()
 {
     CVTerm term = new  CVTerm(libsbml.MODEL_QUALIFIER);
       assertTrue( term != null );
       assertTrue( term.getQualifierType() == libsbml.MODEL_QUALIFIER );
       term.setModelQualifierType(libsbml.BQM_IS);
       assertTrue( term != null );
       assertTrue( term.getQualifierType() == libsbml.MODEL_QUALIFIER );
       assertTrue( term.getModelQualifierType() == libsbml.BQM_IS );
       term.setQualifierType(libsbml.BIOLOGICAL_QUALIFIER);
       term.setBiologicalQualifierType(libsbml.BQB_IS);
       assertTrue( term.getQualifierType() == libsbml.BIOLOGICAL_QUALIFIER );
       assertTrue( term.getBiologicalQualifierType() == libsbml.BQB_IS );
       term = null;
 }
 public void test_CVTerm_setBiolQualifierType()
 {
     CVTerm term = new  CVTerm(libsbml.BIOLOGICAL_QUALIFIER);
       assertTrue( term != null );
       assertTrue( term.getQualifierType() == libsbml.BIOLOGICAL_QUALIFIER );
       assertTrue( term.getModelQualifierType() == libsbml.BQM_UNKNOWN );
       assertTrue( term.getBiologicalQualifierType() == libsbml.BQB_UNKNOWN );
       int i = term.setBiologicalQualifierType(libsbml.BQB_IS);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( term.getQualifierType() == libsbml.BIOLOGICAL_QUALIFIER );
       assertTrue( term.getBiologicalQualifierType() == libsbml.BQB_IS );
       assertTrue( term.getModelQualifierType() == libsbml.BQM_UNKNOWN );
       i = term.setQualifierType(libsbml.MODEL_QUALIFIER);
       assertTrue( i == libsbml.LIBSBML_OPERATION_SUCCESS );
       assertTrue( term.getQualifierType() == libsbml.MODEL_QUALIFIER );
       assertTrue( term.getModelQualifierType() == libsbml.BQM_UNKNOWN );
       assertTrue( term.getBiologicalQualifierType() == libsbml.BQB_UNKNOWN );
       i = term.setBiologicalQualifierType(libsbml.BQB_IS);
       assertTrue( i == libsbml.LIBSBML_INVALID_ATTRIBUTE_VALUE );
       assertTrue( term.getQualifierType() == libsbml.MODEL_QUALIFIER );
       assertTrue( term.getModelQualifierType() == libsbml.BQM_UNKNOWN );
       assertTrue( term.getBiologicalQualifierType() == libsbml.BQB_UNKNOWN );
       term = null;
 }