University Database - Daplex queries constructed using this interface can be sent to a P/FDM database at the University of Aberdeen via a CGI program.
FDM interface to RATMAP - Daplex queries constructed using this interface can be translated to SQL and then sent to a relational database for execution.
ensemblFDM - a functional data model implementation of the Ensembl schema. A web-based interface can be used to build up Daplex queries, and the SQL query that would be sent to an Ensembl server is displayed.
The P/FDM executable is in /users/mdstud/kemp/bin/pfdm
To start P/FDM, just type the name of this file at the UNIX prompt.
To read the schema file for the University database into P/FDM, use the predicate daplex/1, e.g.:
| ?- daplex('/users/mdstud/kemp/pfdm/unidb/unidb.sch').
To load data into P/FDM, use the predicate pfdm_load/1, e.g.
| ?- pfdm_load('/users/mdstud/kemp/pfdm/unidb/unidb.loa').
To compile the file of example Daplex queries, type:
| ?- daplex('unidb.d').
Daplex queries are translated into Prolog for execution. To run one of the programs, type its name (e.g. p1.). You can view the generated Prolog code using listing/1 (e.g. listing(p1).). Examine the code generated for several programs, including p6.
Daplex queries can be typed directly. Use daplex/0 to get the Daplex prompt, e.g.
| ?- daplex. |: for each t in teacher |: print(forename(t), surname(t));
Type another semi-colon to return to the Prolog prompt.
If you want to see the intermediate comprehensions, you can turn on/off diagnostic output with the following instructions:
| ?- compiler_debug(on). | ?- compiler_debug(off).
When you have finished using P/FDM you can exit from the Prolog environment by typing:
| ?- halt.Further information can be found in the P/FDM User's Manual.
The files for the university database are in /users/mdstud/kemp/pfdm/unidb
Look at the Prolog code generated for queries like p5 and p6. Look at the intermediate comprehensions for these queries.
The files for the antibody database examples are in /users/mdstud/kemp/pfdm/antibody
The internal form of the rewrite rules can be seen by typing:
| ?- listing(krr).
The files for the "ship example" are in /users/mdstud/kemp/pfdm/ship
Look at the intermediate comprehensions and see how the query is transformed.
Create a schema for some other database e.g. related to data that you work with in your research. Add some data you your database. Write some queries and rewrite rules for this database, and demonstrate that the rewrite rule is applied successfully (or prepare "bug reports"!).
Implement a simple compiler for a subset of Daplex.
for each s in student print(forename(s), surname(s), faculty(s));You should assume that the user will use valid class names and attribute names in their queries, so don't bother checking these. But you should check that the same variable is used throughout.
for each p in person such that forename(p) = "Peter" print(surname(p));and
for each p in project such that duration(p) = 3 print(title(p), funding_body(p));