User Tools

Site Tools


magik-demo:user:query_approximation:generalization

This is an old revision of the document!


A PCRE internal error occured. This might be caused by a faulty plugin

====== Generalization ====== After the elaboration MAGIK, will answer if the query given by the user, is complete or not with respect to schema constraints and TC-statements. If it is not complete, MAGIK will try to generate the generalized and specialized query. In this page it is explained how works the generalization algorithm. {{ :magik-demo:user:query_approximation:generalization.png?nolink&650 |}} This schema illustrates all the steps that the generalization algorithm does. In order to be more comprehensive, we will use and example (MUSIC COMPILATION). Given the follow schema about music compilation: <code sql> Compilation(idComp,name,year,label,year) TrackContained(idComp,idTrack) Track(idTrack,title,timing,idAuthor) Author(idAuthor,surname,name,birthdate) </code> Suppose we have this query: <code sql> SELECT Author.name FROM Compilation,TrackContained,Track,Author WHERE Compilation.idComp = TrackContained.idComp AND TrackContained.idTrack = Track.idTrack AND Track.idAuthor = Author.idAuthor AND Compilation.name = "I love rock and roll" </code> and we have this table completeness statements: <code sql> TC1 = TrackContained(idComp,idTrack) WHERE Track(idTrack,title,timing,idAuthor) TC2 = Track(idTrack,title,timing,idAuthor) WHERE Author(idAuthor,surname,name,birthdate) TC3 = Author(idAuthor,surname,name,birthdate) </code> Running MAGIK on this query and given database schema and TC-statements, we get that this query is <fc red>NOT COMPLETE</fc> At this point the generalization algorithm enter in action.\\ The idea is at each iteration remove all the incomplete atoms. The algorithm will stop if there is no other atoms that are incomplete (we said that it reaches a **fixed point**).

magik-demo/user/query_approximation/generalization.1374583017.txt.gz · Last modified: 2017/07/06 15:24 (external edit)