Package org.sbml.jsbml

Examples of org.sbml.jsbml.CVTerm


   *
   * @see org.sbml.jsbml.util.Filter#accepts(java.lang.Object)
   */
  public boolean accepts(Object o) {
    if (o instanceof CVTerm) {
      CVTerm cvt = (CVTerm) o;
      if (qualifier != null) {
        if (cvt.isBiologicalQualifier()
            && (cvt.getBiologicalQualifierType() == qualifier)) {
          return pattern != null ? cvt.filterResources(pattern)
              .size() > 0 : true;
        } else if (cvt.isModelQualifier()
            && cvt.getModelQualifierType() == qualifier) {
          return pattern != null ? cvt.filterResources(pattern)
              .size() > 0 : true;
        }
      } else if (pattern != null) {
        return cvt.filterResources(pattern).size() > 0;
      }
    } else if (o instanceof SBase) {
      SBase sbase = (SBase) o;
      if (qualifier != null) {
        if (pattern != null) {
View Full Code Here


    Compartment c = model.createCompartment("c");
    c.setSize(4.3);
    c.setSBOTerm(SBO.getPhysicalCompartment());

    Species s1 = model.createSpecies("s1", c);
    s1.addCVTerm(new CVTerm(CVTerm.Type.BIOLOGICAL_QUALIFIER,
        Qualifier.BQB_IS, "urn:miriam:kegg.compound:C12345"));
    s1.setValue(23.7);
    model.removeSpecies(s1);

    try {
View Full Code Here

    Species s1 = model.createSpecies("s1", model.createCompartment("c1"));
    s1.setMetaId("meta_" + s1.getId());
    // Not necessary anymore.
    // s1.getAnnotation().addRDFAnnotationNamespace("bqbiol", "",
    // "http://biomodels.net/biology-qualifiers/");
    s1.addCVTerm(new CVTerm(CVTerm.Type.BIOLOGICAL_QUALIFIER,
        CVTerm.Qualifier.BQB_HAS_PART, "urn:miriam:obo.chebi:CHEBI:15422"));
    System.out.println("==================================");
    new SBMLWriter().write(doc, System.out);
    new JTreeOfSBML(doc);
  }
View Full Code Here

      // This parser can parse only model Miriam qualifiers. This element should not have attributes or namespace declarations.
      // Creates a new CVTerm and
      // sets the qualifierType and modelQualifierType of this CVTerm. Then, adds the
      // initialised CVTerm to annotation.
      if (modelQualifierMap.containsKey(elementName) && !hasNamespaces && !hasAttributes) {
        CVTerm cvTerm = new CVTerm();
        cvTerm.setQualifierType(Type.MODEL_QUALIFIER);
        cvTerm.setModelQualifierType(modelQualifierMap.get(elementName));
       
        annotation.addCVTerm(cvTerm);
        return cvTerm;
      }
      else {
View Full Code Here

  }

  @Test
  public void test_CVTerm_addResource()
  {
    CVTerm term = new  CVTerm(); // TODO: difference to document => CVTerm term = new  CVTerm(CVTerm.Type.MODEL_QUALIFIER); constructor does not exist
    term.setQualifierType(CVTerm.Type.MODEL_QUALIFIER);   
    String resource =  "GO6666";
    assertTrue( term != null );
    assertTrue( term.getQualifierType() == CVTerm.Type.MODEL_QUALIFIER ); // TODO: difference to document ==> CVTerm.Type.MODEL_QUALIFIER
    term.addResource(resource);
    List<String> xa = term.getResources(); // TODO: difference to document ==> term.getResources(); does not return XMLAttributes but a List<String>
    assertTrue( xa.size() == 1 );
    // assertTrue(xa.getName(0).equals( "rdf:resource"));
    assertTrue(xa.get(0).equals( "GO6666"));
    term = null;
  }
View Full Code Here

    term = null;
  }

  @Test public void test_CVTerm_create()
  {
    CVTerm term = new  CVTerm();
    term.setQualifierType(CVTerm.Type.MODEL_QUALIFIER)
    assertTrue( term != null );
    assertTrue( term.getQualifierType() == CVTerm.Type.MODEL_QUALIFIER );
    term = null;
  }
View Full Code Here

  }
  */

  @Test public void test_CVTerm_getResources()
  {
    CVTerm term = new  CVTerm();
    term.setQualifierType(CVTerm.Type.MODEL_QUALIFIER);
    String resource =  "GO6666";
    String resource1 =  "OtherURI";
    long number;
    term.addResource(resource);
    term.addResource(resource1);
    number = term.getResourceCount();
    assertTrue( number == 2 );
    assertTrue(term.getResourceURI(0).equals( "GO6666"));
    assertTrue(term.getResourceURI(1).equals( "OtherURI"));
    term = null;
  }
View Full Code Here

    term = null;
  }

  @Test public void test_CVTerm_set_get()
  {
    CVTerm term = new  CVTerm();
    term.setQualifierType(CVTerm.Type.MODEL_QUALIFIER);
    assertTrue( term != null );
    assertTrue( term.getQualifierType() == CVTerm.Type.MODEL_QUALIFIER );
    term.setModelQualifierType(CVTerm.Qualifier.BQM_IS); // TODO: difference to document ==> libsbml.BQM_IS become
    assertTrue( term != null );
    assertTrue( term.getQualifierType() == CVTerm.Type.MODEL_QUALIFIER );
    assertTrue( term.getModelQualifierType() == CVTerm.Qualifier.BQM_IS );
    term.setQualifierType(CVTerm.Type.BIOLOGICAL_QUALIFIER);
    term.setBiologicalQualifierType(CVTerm.Qualifier.BQB_IS);
    assertTrue( term.getQualifierType() == CVTerm.Type.BIOLOGICAL_QUALIFIER );
    assertTrue( term.getBiologicalQualifierType() == CVTerm.Qualifier.BQB_IS );
    term = null;
  }
View Full Code Here

      // sets the qualifierType and biologicalQualifierType of this
      // CVTerm. Then, adds the
      // initialized CVTerm to annotation.
      if (biologicalQualifierMap.containsKey(elementName)
          && !hasAttributes && !hasNamespaces) {
        CVTerm cvTerm = new CVTerm();
        cvTerm.setQualifierType(Type.BIOLOGICAL_QUALIFIER);
        cvTerm.setBiologicalQualifierType(biologicalQualifierMap
            .get(elementName));

        annotation.addCVTerm(cvTerm);
        return cvTerm;
      } else {
View Full Code Here

    // 'li' subelement of the 'Bag' subelement of the 'Miriam-Qualifier' node.
    // When this parser is parsing the rdf annotation, some rdf attributes can appear. Try to
    // read them.
    else if (contextObject instanceof CVTerm && previousElements.containsKey("CVTerm")) {
      if (previousElements.get("CVTerm").equals("li")) {
        CVTerm cvterm = (CVTerm) contextObject;
        isReadAttribute = cvterm.readAttribute(elementName, attributeName, prefix, value);
      }
    }
   
    if (!isReadAttribute) {
      logger.warn("RDFAnnotationParser : processAttribute : found an unknown attribute '" +
View Full Code Here

TOP

Related Classes of org.sbml.jsbml.CVTerm

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.