|Did you know ...||Search Documentation:|
|Pack sql_compiler -- prolog/sql_compiler.pl|
This module rewrites prolog goals as SQL goals. It assumes the details of the schema are given using the following predicates:
problem with existentials being in the projection
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)"
== blip-sql -debug sql_compiler -u seqfeature_sqlmap_chado_exposed_ids -u genome_bridge_from_seqfeature -r rdb/flybase prolog-to-sql "
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 modules is an extension of version 1.1 (Dec 21st 1992) of the Prolog to SQL compiler written by Christoph Draxler of the Univeristy of Munich.
It was modified by Chris Mungall to be compatible with SWI-Prolog and extended to support:
MySQL specific column types SELECT DISTINCT query rewriting for optimization additional comparison operators
Permission has been granted by the original author to distribute this software using the same license as SWI-Prolog.
RELEASE INFORMATION Current version is v. 1.1 of Dec. 21st 1992. Version 1.0 Sept. 3 1992 CJM mods 2005
Head <- Body
The following predicates are exported, but not or incorrectly documented.