This module rewrites prolog goals as SQL goals. It assumes the details of the schema are given using the following predicates:
genomic/genome_sqlmap_enscore.proontol/ontol_sqlmap_go.pro
TODOproblem with existentials being in the projection
works:
blip-sql -debug sql_compiler -u seqfeature_sqlmap_chado_exposed_ids -u genome_bridge_from_seqfeature -r rdb/flybase prolog-to-sql -proj T "feature(G),seqfeature_db:feature_relationship(G,T,Type,Rank)"
misses join:
blip-sql -debug sql_compiler -u seqfeature_sqlmap_chado_exposed_ids -u genome_bridge_from_seqfeature -r rdb/flybase prolog-to-sql "feature(G),seqfeature_db:feature_relationship(G,T,Type,Rank)"
PostgreSQL8.4 allows WITH RECURSIVE; e.g.
tree(?ID,?Parent) struct(ID,Parent) :- struct(ID,Parent). struct(ID,A) :- struct(ID,Parent),struct(Parent,A).
should translate to:
WITH RECURSIVE struct AS ( SELECT t.* FROM tree t WHERE id = 890 UNION ALL SELECT t.* FROM tree t, struct s WHERE t.id = s.parent_id ) SELECT * FROM struct;
This Prolog to SQL compiler may be distributed free of charge provided that it is not used in commercial applications without written consent of the author, and that the copyright notice remains unchanged.
I would like to keep in my hands the further development and distribution of the compiler. This does not mean that I don't want other people to suggest or even implement improvements - quite on the contrary: I greatly appreciate contributions and if they make sense to me I will incorporate them into the compiler (with due credits given!).
For further development of the compiler, address your requests, comments and criticism to the author:
A report describing the implementation is available upon request from the author.
RELEASE INFORMATION Current version is v. 1.1 of Dec. 21st 1992. Version 1.0 Sept. 3 1992 CJM mods 2005
Example: load_schema_defs(bio('sql_schema/schema_enscore44'))
The following predicates are exported, but not or incorrectly documented.