untitled

(ff) #1
10.3 Exercises 259

parsing styles can help simplify the program, but all of them have disadvan-
tages. A better approach that has become very popular is to use the XML
Transformation Language that is introduced in the next chapter.

Summary


  • Transformation from XML to XML using Perl can be done using any of
    the parsing styles.

  • None of the styles are completely satisfactory when the transformation
    task is complicated.


10.3 Exercises


In the following exercises, write a Perl program that determines the specified
information. The solutions to these exercises are available online at the book
websiteontobio.org. Additional exercises are also available at this site.


  1. Using the health study database in section 1.1, find all interviews in the
    year 2000 for which the study subject had a BMI greater than 30. Print the
    information for each such interview using tab-delimited fields. Compare
    your answer with your solution to exercise 10.1.

  2. Perform the same task as in exercise 10.1, but using a database in XML
    format as in section 1.2. Write your program first by using patterns to
    extract the information, and then by using the XML::Parser module.

  3. Generalize exercise 10.2 to extract interviews for any year and any mini-
    mum BMI value. Write your program as a Perl procedure which has two
    parameters.

  4. Given a BioML document as in figure 1.3, find all literature references
    for the insulin gene. Compare your answer with your solution to exer-
    cise 10.2.

  5. As in exercise 10.3, find all PubMed citations dealing with the therapeu-
    tic use of glutethimide. For each citation print one line containing the
    MedlineID, the title, and the date of publication in tab-delimited format.

Free download pdf