CS345 Assignment #5

Due Monday, May 17, 1999

Problem Set

  1. (30 pts.) Consider the global predicates in an integrated information system about books.

    Suppose the following five views are provided:

    Express each of the following queries in terms of the global predicates, and find all minimal solutions for each query.

    What is the price for the book "Hamlet" at the bookstore Borders?

    Which bookstores sell books written by author Edgar Allan Poe?

    Who are the publishers for the books sold by bookstore Barnes and Noble?

  2. (30 pts.) Suppose that the views from Problem 1 have the following binding patterns:

    Find all minimal solutions (in terms of the adorned views) to each of the following queries:

    What is the copyright date for the book "The Catcher in the Rye"?

    Where (location) can one find copies of the book "Crime and Punishment"?

    At which bookstores, and for what price, can one find copies of the book "The Sun Also Rises"?

  3. (20 pts.) Redo the class example on finding all the maternal ancestors for an individual X:

    but with the following altered views:

    Use the Duschka/Genesereth method to find all possible answers to the query obtainable from the given views.

  4. (20 pts.) Consider the following example:

    red(X,Y) and green(X,Y) are global predicates. They represent colored arcs, and for both, X is the starting node and Y is the ending node.

    There are the following two source views:

    "v1^ff" means that the v1 is the view, with bindings f and f, and similarly for v2^fb.

    Write a Datalog program that uses the views as EDB predicates, in such a way that the views can be queried with their proper binding patterns. Your program must find as many nodes as it can, from which a green arc can eventually be reached (there exists some path starting at that node which contains a green arc). For example, if we have green(1,2), red(2,3), red(3,4), green(4,5), and green(5,6) then the answer should contain nodes 1, 2, 3, and 4. Note that even though there is a green arc (5,6) reachable from node 5, there is no way to determine that fact from the views, so 5 will not be in the result of your program.