Package org.sbml.jsbml

Examples of org.sbml.jsbml.History


    }
  }

  @Test
  public void test_Model_setgetModelHistory() {
    History history = new History();
    Creator mc = new Creator();
    Date date = Calendar.getInstance().getTime();
    mc.setFamilyName("Keating");
    mc.setGivenName("Sarah");
    mc.setEmail("sbml-team@caltech.edu");
    mc.setOrganisation("UH");
    history.addCreator(mc);
    history.setCreatedDate(date);
    history.setModifiedDate(date);
    assertTrue(M.isSetHistory() == false);
    M.setHistory(history);
    assertTrue(M.isSetHistory() == true);
    Creator newMC = history.getCreator(0);
    assertTrue(newMC != null);
    assertTrue(newMC.getFamilyName().equals("Keating"));
    assertTrue(newMC.getGivenName().equals("Sarah"));
    assertTrue(newMC.getEmail().equals("sbml-team@caltech.edu"));
    assertTrue(newMC.getOrganisation().equals("UH"));
View Full Code Here


    // A CreatorParser can only modify a contextObject which is an Annotation instance.
    // The namespace of this parser should be associated with the creator subnode of an annotation.
    // Creates a ModelHistory instance and set the modelHistory of annotation.
    if (elementName.equals("creator") && (contextObject instanceof Annotation)) {
      Annotation annotation = (Annotation) contextObject;
      History modelHistory = new History();
      annotation.setHistory(modelHistory);

      return modelHistory;
    }
    else {
View Full Code Here

    if (elementName != null) {

      // A DatesParser can only modify a contextObject which is a
      // ModelHistory instance.
      if (contextObject instanceof History) {
        History modelHistory = (History) contextObject;
        DateProcessor dateProcessor = new DateProcessor();

        // The date to parse is the text of a 'W3CDTF' element.
        // However, the date will be parsed only if the syntax of this
        // node and the previous
        // node respects the SBML specifications.
        if (elementName.equals("W3CDTF") && hasReadW3CDTF) {

          // If the previous node was a 'created' element and
          // respected the SBML specifications,
          // a new Date will be created and set to the text value of
          // this node.
          // Sets the created Date of modelHistory.
          if (hasReadCreated && previousElement.equals("created")) {
            String stringDate = dateProcessor.formatToW3CDTF(characters);
           
            try {
              Date createdDate = DateParser.parse(stringDate);
              modelHistory.setCreatedDate(createdDate);

              logger.debug("processCharactersOf: getIsoDateNoMillis " + DateParser.getIsoDateNoMillis(createdDate));
             
            } catch (InvalidDateException e) {
              logger.warn("Cannot read the following date properly: " + stringDate);
              if (logger.isDebugEnabled()) {
                e.printStackTrace();
              }
            }
           
          }
          // If the previous node was a 'modified' element and
          // respected the SBML specifications,
          // a new Date will be created and set to the text value of
          // this node.
          // Sets the modified Date and adds the new Date to the
          // listOfModifications of modelHistory.
          else if (previousElement.equals("modified")) {
            String stringDate = dateProcessor.formatToW3CDTF(characters);

            try {
              Date modifiedDate = DateParser.parse(stringDate);
              modelHistory.setModifiedDate(modifiedDate);
            } catch (InvalidDateException e) {
              logger.warn("Cannot read the following date properly: " + stringDate);
              if (logger.isDebugEnabled()) {
                e.printStackTrace();
              }
View Full Code Here

    // contextObject which is an Annotation instance.
    if (contextObject instanceof Annotation) {
      Annotation annotation = (Annotation) contextObject;

      if (!annotation.isSetHistory()) {
        annotation.setHistory(new History());
      }
     
      if (annotation.isSetHistory()) {
        History history = annotation.getHistory();

        // If the localName of the node is 'created' and if it has not
        // been read yet,
        // the previousElement of this parser is set to 'created' and
        // hasReadCreated is set
View Full Code Here

    }
    // A RDFAnnotationParser can modify a contextObject which is an ModelHistory instance.
    // When this parser is parsing the model history, some rdf attributes can appear. Try to
    // read them.
    else if (contextObject instanceof History) {
      History modelHistory = (History) contextObject;
      isReadAttribute = modelHistory.readAttribute(elementName, attributeName, prefix, value);
    }
    // A RDFAnnotationParser can modify a contextObject which is an ModelCreator instance.
    // If the contextObject is a ModelCreator instance, the rdf attributes should appear in the
    // 'li' subelement of the 'Bag' subelement of the 'creator' node.
    // When this parser is parsing the model history, some rdf attributes can appear. Try to
View Full Code Here

              logger.warn("Syntax error in your RDF annotation");
            }
          }
          // A RDFAnnotation can modify a contextObject which is a ModelHistory instance.
          else if (contextObject instanceof History) {
            History modelHistory = (History) contextObject;
            // we should be into a 'creator' node and the first element should be a Bag element.
            if (elementName.equals("Bag")) {
              this.previousElements.put("creator", "Bag");
            }
            // After the 'Bag' node of the 'creator' element, it should be a 'li' node.
            // If the SBML specifications are respected, a new ModelCreator will be created
            // and added to the listOfCreators of modelHistory. In this case, it will return the new ModelCreator instance.
            else if (elementName.equals("li") && previousElements.containsKey("creator")) {
              if (previousElements.get("creator").equals("Bag")) {
                this.previousElements.put("creator", "li");
                Creator modelCreator = new Creator();
                modelHistory.addCreator(modelCreator)
                return modelCreator;
              }
              else {
                logger.warn("Syntax error in your RDF annotation");
              }
View Full Code Here

    doc.addTreeNodeChangeListener(new SimpleTreeNodeChangeListener());
    Model model = doc.createModel("test_model");
   
    Creator c = new Creator("Hans", "Wurst",
      "Institute for Interesting Biology", "ovidiu.radulescu@univ-rennes1.fr");
    History h = new History();
    h.addCreator(c);
    model.setHistory(h);
//    model.appendNotes("This is a very interesting model.");
    model.appendNotes("<body xmlns=\"http://www.w3.org/1999/xhtml\"><h1>Model of &#8220;Apoptosis&#8221; in &#8220;Homo sapiens (human)&#8221;</h1>Apoptosis is a genetically controlled mechanisms of cell death involved in the regulation of tissue homeostasis. The 2 major pathways of apoptosis are the extrinsic (Fas and other TNFR superfamily members and ligands) and the intrinsic (mitochondria-associated) pathways, both of which are found in the cytoplasm. The extrinsic pathway is triggered by death receptor engagement, which initiates a signaling cascade mediated by caspase-8 activation. Caspase-8 both feeds directly into caspase-3 activation and stimulates the release of cytochrome c by the mitochondria. Caspase-3 activation leads to the degradation of cellular proteins necessary to maintain cell survival and integrity. The intrinsic pathway occurs when various apoptotic stimuli trigger the release of cytochrome c from the mitochondria (independently of caspase-8 activation). Cytochrome c interacts with Apaf-1 and caspase-9 to promote the activation of caspase-3. Recent studies point to the ER as a third subcellular compartment implicated in apoptotic execution. Alterations in Ca2+ homeostasis and accumulation of misfolded proteins in the ER cause ER stress. Prolonged ER stress can result in the activation of BAD and/or caspase-12, and execute apoptosis.<br/><a href=\"http://www.genome.jp/kegg/pathway/hsa/hsa04210.png\"><img src=\"http://www.genome.jp/kegg/pathway/hsa/hsa04210.png\" alt=\"http://www.genome.jp/kegg-bin/show_pathway?hsa04210\"/></a><br/><a href=\"http://www.genome.jp/kegg-bin/show_pathway?hsa04210\">Original Entry</a><br/><div align=\"right\"></div><br/></body>");
   
    Parameter k1 = model.createParameter("k1");
View Full Code Here

    term.setQualifierType(Type.MODEL_QUALIFIER);
    term.setModelQualifierType(Qualifier.BQM_IS);
    term.addResource("urn:miriam:kegg.pathway:hsa00010");
    m.addCVTerm(term);

    History history = new History();
    Creator creator = new Creator();
    creator.setFamilyName("Dr\u00e4ger");
    creator.setGivenName("Andreas");
    creator.setEmail("andreas.draeger@uni-tuebingen.de");
    creator.setOrganization("Universit\u00e4t T\u00fcbingen");
    history.addCreator(creator);
    history.setCreatedDate(Calendar.getInstance().getTime());
    history.addModifiedDate(Calendar.getInstance().getTime());
    m.setHistory(history);

    m
        .setNotes("<body>A senseless test model with a senseless notes element.</body>");
View Full Code Here

    }
  }

  @Test
  public void test_Model_setgetModelHistory() {
    History history = new History();
    Creator mc = new Creator();
    Date date = Calendar.getInstance().getTime();
    mc.setFamilyName("Keating");
    mc.setGivenName("Sarah");
    mc.setEmail("sbml-team@caltech.edu");
    mc.setOrganisation("UH");
    history.addCreator(mc);
    history.setCreatedDate(date);
    history.setModifiedDate(date);
    assertTrue(M.isSetHistory() == false);
    M.setHistory(history);
    assertTrue(M.isSetHistory() == true);
    Creator newMC = history.getCreator(0);
    assertTrue(newMC != null);
    assertTrue(newMC.getFamilyName().equals("Keating"));
    assertTrue(newMC.getGivenName().equals("Sarah"));
    assertTrue(newMC.getEmail().equals("sbml-team@caltech.edu"));
    assertTrue(newMC.getOrganisation().equals("UH"));
View Full Code Here

    if (elementName != null) {

      // A DatesParser can only modify a contextObject which is a
      // ModelHistory instance.
      if (contextObject instanceof History) {
        History modelHistory = (History) contextObject;
        DateProcessor dateProcessor = new DateProcessor();

        // The date to parse is the text of a 'W3CDTF' element.
        // However, the date will be parsed only if the syntax of this
        // node and the previous
        // node respects the SBML specifications.
        if (elementName.equals("W3CDTF") && hasReadW3CDTF) {

          // If the previous node was a 'created' element and
          // respected the SBML specifications,
          // a new Date will be created and set to the text value of
          // this node.
          // Sets the created Date of modelHistory.
          if (hasReadCreated && previousElement.equals("created")) {
            String stringDate = dateProcessor.formatToW3CDTF(characters);
           
            try {
              Date createdDate = DateParser.parse(stringDate);
              modelHistory.setCreatedDate(createdDate);

              logger.debug("processCharactersOf : getIsoDateNoMillis " + DateParser.getIsoDateNoMillis(createdDate));
             
            } catch (InvalidDateException e) {
              logger.warn("Cannot read the following date properly :" + stringDate);
              if (logger.isDebugEnabled()) {
                e.printStackTrace();
              }
            }
           
          }
          // If the previous node was a 'modified' element and
          // respected the SBML specifications,
          // a new Date will be created and set to the text value of
          // this node.
          // Sets the modified Date and adds the new Date to the
          // listOfModifications of modelHistory.
          else if (previousElement.equals("modified")) {
            String stringDate = dateProcessor.formatToW3CDTF(characters);

            try {
              Date modifiedDate = DateParser.parse(stringDate);
              modelHistory.setModifiedDate(modifiedDate);
            } catch (InvalidDateException e) {
              logger.warn("Cannot read the following date properly :" + stringDate);
              if (logger.isDebugEnabled()) {
                e.printStackTrace();
              }
View Full Code Here

TOP

Related Classes of org.sbml.jsbml.History

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.