180 likes | 288 Views
Some Query Languages Peculiarities. A Concept-Based Query Language Not Using Proper Relation Names. Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru). General Query Expression Structure. A Concept-Based Query Language Not Using Proper Relation Names. Parameters.
E N D
Some Query Languages Peculiarities A Concept-Based Query Language Not Using Proper Relation Names Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
General Query Expression Structure A Concept-Based Query Language Not Using Proper Relation Names Parameters Non-Leaf Operation Parameters Parameters Leaf Operation Non-Leaf Operation Parameters Leaf Operation Relation Relation Relation Entity Entity Entity Entity Entity Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
Concept Association Identification A Concept-Based Query Language Not Using Proper Relation Names Non-Leaf Operation SCQL Leaf Operation Non-Leaf Operation Leaf Operation SCM Association Association Association Identification Concept Concept Concept Concept Concept Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
Running Example: ER and Relational Models SkillType Skill Project SkillType_ID <pi> VA30 <M> Level N <M> Project_ID <pi> VA30 <M> Person Employee Task Person_ID <pi> N <M> Task_ID <pi> N <M> Age N <M> Phone VA80 Skill SkillType PersonProjectRel Project SkillType_ID VARCHAR2(30) <pk,fk1> SkillType_ID VARCHAR2(30) <pk> Project_ID VARCHAR2(30) <pk,fk1> Project_ID VARCHAR2(30) <pk> Person_ID NUMBER <pk,fk2> Person_ID NUMBER <pk,fk2> Level NUMBER Person Employee PersonTaskRel Task Person_ID NUMBER <pk> Person_ID NUMBER <pk,fk> Person_ID NUMBER <pk,fk1> Task_ID NUMBER <pk> Age NUMBER Task_ID NUMBER <pk,fk2> Project_ID VARCHAR2(30) <fk> Phone VARCHAR2(80) A Concept-Based Query Language Not Using Proper Relation Names Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
Running Example: SCM Model A Concept-Based Query Language Not Using Proper Relation Names Age Project Person Skill Level Skill Type Task Employee Phone Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
Referencing Associations Using Domain Concepts A Concept-Based Query Language Not Using Proper Relation Names Project The connectivity fact is only used SCQL: (Project, Task) SQL: SELECT Project_ID, Task_ID FROM Task Task Person Skill Level Skill Type SCQL: (Person, Skill Level, Skill Type) SQL: SELECT Person_ID, SkillType_ID, Level FROM Skill Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
SCQL Composition A Concept-Based Query Language Not Using Proper Relation Names Project Person Task SCQL General Composition: ((Project, Task), (Task, Person)) SCQL Path Composition: (ProjectTaskPerson) SCQL Star Composition: (Task[Project, Person,…]) SQL: SELECT t.Project_ID, t.Task_ID, ptr.Person_ID FROM Task t, PersonTaskRel ptr WHERE t.Task_ID = ptr.Task_ID Equivalent Notations Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
Role Concept A Concept-Based Query Language Not Using Proper Relation Names Project Person Task SCQL: (Project(Task’s)TaskPersonProject(Person’s)) SQL: SELECT t.Project_ID, t.Task_ID, ppr.Person_ID, ppr.Project_ID FROM Task t, PersonTaskRel ptr, PersonProjectRel ppr WHERE t.Task_ID = ptr.Task_ID AND ptr.Person_ID = ppr.Person_ID SCQL: (ProjectTaskPersonProject) SQL: SELECT t.Project_ID, t.Task_ID, ppr.Person_ID FROM Task t, PersonTaskRel ptr, PersonProjectRel ppr WHERE t.Task_ID = ptr.Task_ID AND ptr.Person_ID = ppr.Person_ID AND t.Project_ID = ppr.Project_ID Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
Association Closure Mechanism A Concept-Based Query Language Not Using Proper Relation Names Age Project Closure Person Task Employee Phone Closure is a predefined association composition Equivalent Notations SCQL, using the closure: (Employee, Phone) SCQL, not using a closure: (EmployeePersonPhone) SQL: SELECT e.Person_ID, p.Phone FROM Employee e, Person p WHERE e.Person_ID = p.Person_ID Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
Expression Execution Context A Concept-Based Query Language Not Using Proper Relation Names Project Closure 1: Closure 2: Closure 3: 1 Person 2 3 Task Employee Context Context 2 3 1 1 SCQL: (Employee, Project) SQL: SELECT e.Person_ID, t.Project_ID FROM Employee e, Task t, PersonTaskRel ptr WHERE e.Person_ID = ptr.Person_ID AND ptr.Task_ID = t.Task_ID SCQL: (Employee, Project) SQL: SELECT e.Person_ID, ppr.Project_ID FROM Employee e, PersonProjectRel ppr WHERE e.Person_ID = ppr.Person_ID Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
SCQL Logical Selection A Concept-Based Query Language Not Using Proper Relation Names Age Person Task SCQL: (TaskPersonAge<30) SCQL: ((TaskPersonAge), (Age<30)) SQL: SELECT ptr.Task_ID, ptr.Person_ID, p.Age FROM Person p, PersonTaskRel ptr WHERE p.Person_ID = ptr.Person_ID AND p.Age < 30 Equivalent Notations Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
SCQL Outer Composition A Concept-Based Query Language Not Using Proper Relation Names Age Person Task SCQL: ((PersonAge<30), (PersonTask)+) SCQL: ((PersonAge), (Age<30), (PersonTask)+) SQL: SELECT ptr.Task_ID, ptr.Person_ID, p.Age FROM Person p, PersonTaskRel ptr WHERE p.Person_ID = ptr.Person_ID(+) AND p.Age < 30 Equivalent Notations Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
SCQL Association Selection A Concept-Based Query Language Not Using Proper Relation Names Context Age Closure Person Employee Phone SCQL: (Employee, Phone) SQL: SELECT e.Person_ID, p.Phone FROM Employee e, Person p WHERE e.Person_ID = p.Person_ID SCQL: (Person, Phone) SQL: SELECT p.Person_ID, p.Phone FROM Person p Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
SCQL Minus and Union A Concept-Based Query Language Not Using Proper Relation Names Person Skill Level Skill Type Phone SCQL: (Person, Phone) minus (Skill Level=“Experienced”, Skill Type, Person) SQL: SELECT Person_ID, Phone FROM Person MINUS SELECT p.Person_ID, p.Phone FROM Person p, Skill s WHERE p.Person_ID = s.Person_ID AND s.Level = 1 /*Experienced*/ Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
SCQL Transformation A Concept-Based Query Language Not Using Proper Relation Names Context Age Project Closure Person SCQL: (ProjectPersonAge).(Project, AVG(Age)) SCQL: SELECT Project, AVG(Age) FROM (ProjectPersonAge) SCQL: (Project, AVG(Age)) SQL: SELECT p.Person_ID, AVG(p.Age) FROM PersonProjectRel ppr, Person p WHERE ppr.Person_ID = p.Person_ID GROUP BY ppr.Project_ID Equivalent Notations Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
SCQL Expression Structure A Concept-Based Query Language Not Using Proper Relation Names Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
SCQL Peculiarities A Concept-Based Query Language Not Using Proper Relation Names Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)
SCM-Based Client/Server Technology A Concept-Based Query Language Not Using Proper Relation Names Oracle, MSSQL, MySQL,… Implementation at http://scm.lipetsk.ru Multiuser, Concurrent Client Client SCQL SQL 1 3 SCM Server Client RDBMS SCM Data Data 6 5 Relational Data SCM-RM MappingKnowledge 2 4 SCM KB DataFiles Hierarchy of XML documents Vladimir Ovchinnikov, PhD (ovch@lipetsk.ru, http://scm.lipetsk.ru)