Registration | 
User Disconnected      
DBOWL: A Scalable OWL-DL Reasoner
querying

An ECQ query is re-written before it is sent to the database for evaluation. Each class or property name is substituted by the name of its corresponding view. This ensures the completeness of the results with respect to the implemented box reasonings. After that, the ECQ is translated to SQL using a specific algorithm. This algorithm produces a translation from an ECQ query to an efficient SQL query, so that users can perform complex SQL queries using a simply logical language. Currently, we are implementing a SPARQL query engine for DBOWL.

ECQ Queries implementation

This translation is carried out following three steps:

1. For each variable in the query, the names of the views (views of classes and properties) in the query body which use that variable, and the logical operators (AND or OR) which related these view names, are determined. These associations are used to create an initial SQL query that contains the SELECT fields to determine which columns have to be requested, the FROM fields to determine which views have to be used in the query, the WHERE necessary clauses to determine which view columns have to be associated, and the ORDER BY field to determine how to order the result.

2. For each constant, the constant restriction clauses that have to be added to the WHERE clauses for the correct translation of the query are determined.

3.  Finally, for each condition (ALL, >=, <=, =) the condition restriction clauses that have to be added to the WHERE clauses to obtain the final SQL query, are also determined.

The next detailed example shows the complexity of the queries generated by this algorithm.

ECQ Queries implementation example

The ECQ query :

ans(?x,?y) <- fullprofessor(?x) or assistantprofessor(?x) and worksfor(?x,%University%) and >=3 teacherof(?x,?y) and ALL course(?y)

Is processed step by step obtaining:

1 - Variables association

•  After associated ?x :

SELECT DISTINCT U1.URL FROM URI_INDEX U1,WORKSFOR_1_P W1,TEACHEROF_1_P T1,COURSE_1_C C1 WHERE U1.ID=W1.SUBJECT AND W1.SUBJECT=T1.SUBJECT AND (W1.SUBJECT IN (SELECT URL FROM FULLPROFESSOR_1_C ) OR W1.SUBJECT IN (SELECT URL FROM ASSISTANTPROFESSOR_1_C ) ) ORDER BY U1.URL;

•  After associated ?y :

SELECT DISTINCT U1.URL,U2.url FROM URI_INDEX U1, URI_INDEX U2 , WORKSFOR_1_P W1,TEACHEROF_1_P T1,COURSE_1_C C1 WHERE U2.ID=T1.OBJECT AND URL1.ID=W1.SUBJECT AND W1.SUBJECT=T1.SUBJECT AND (W1.SUBJECT IN (SELECT URL FROM FULLPROFESSOR_1_C ) OR W1.SUBJECT IN (SELECT URL FROM ASSISTANTPROFESSOR_1_C ) ) AND t1.OBJECT=C1.ID ORDER BY U1.URL;

2 - Constant restrictions determination

•  After determine the constant restriction '%University0%' :

SELECT DISTINCT U1.URL,U2.URL FROM URI_INDEX U1,URI_INDEX U2, WORKSFOR_1_P W1,TEACHEROF_1_P T1,COURSE_1_C C1 WHERE U2.ID=T1.OBJECT AND URL1.ID=W1.SUBJECT AND W1.SUBJECT=T1.SUBJECT AND (W1.SUBJECT IN (SELECT URL FROM FULLPROFESSOR_1_C ) OR W1.SUBJECT IN (SELECT URL FROM ASSISTANTPROFESSOR_1_C ) ) AND T1.OBJECT=C1.ID AND W1.OBJECT IN (SELECT UA.ID FROM URI_INDEX UA,WORKSFOR_1_P W1A WHERE UA.id=W1A.OBJECT AND UA.URL LIKE '%University%') ORDER BY U1.URL;

3 - Condition restrictions determination

•  After determine the condition restriction '>=3':

SELECT DISTINCT U1.URL,U2.URL FROM URI_INDEX U1,URI_INDEX U2, WORKSFOR_1_P W1,TEACHEROF_1_P T1,COURSE_1_C C1 WHERE U2.ID=T1.OBJECT AND URL1.ID=W1.SUBJECT AND W1.SUBJECT=T1.SUBJECT AND (W1.SUBJECT IN (SELECT URL FROM FULLPROFESSOR_1_C ) OR W1.SUBJECT IN (SELECT URL FROM ASSISTANTPROFESSOR_1_C ) ) AND T1.OBJECT=C1.ID AND W1.OBJECT IN (SELECT UA.ID FROM URI_INDEX UA,WORKSFOR_1_P W1A WHERE UA.id=W1A.OBJECT AND UA.URL LIKE '%University%') AND T1.SUBJECT IN (SELECT SUBJECT FROM TEACHEROF_1_P GROUP BY SUBJECT HAVING COUNT(DISTINCT OBJECT)>=3 ) ORDER BY U1.URL;

•  After determine the condition restriction 'ALL':

SELECT DISTINCT U1.URL,U2.URL FROM URI_INDEX U1,URI_INDEX U2, WORKSFOR_1_P W1,TEACHEROF_1_P T1,COURSE_1_C C1 WHERE U2.ID=T1.OBJECT AND URL1.ID=W1.SUBJECT AND W1.SUBJECT=T1.SUBJECT AND (W1.SUBJECT IN (SELECT URL FROM FULLPROFESSOR_1_C ) OR W1.SUBJECT IN (SELECT URL FROM ASSISTANTPROFESSOR_1_C ) ) AND T1.OBJECT=C1.ID AND W1.OBJECT IN (SELECT UA.ID FROM URI_INDEX UA,WORKSFOR_1_P W1A WHERE UA.id=W1A.OBJECT AND UA.URL LIKE '%University%') AND T1.SUBJECT IN (SELECT SUBJECT FROM TEACHEROF_1_P GROUP BY SUBJECT HAVING COUNT(DISTINCT OBJECT)>=3 ) AND T1.OBJECT=C1.URL AND T1.SUBJECT IN (SELECT T1A.SUBJECT FROM TEACHEROF_1_P T1A GROUP BY T1A.SUBJECT HAVING COUNT(DISTINCT OBJECT)=(SELECT COUNT(DISTINCT OBJECT) FROM TEACHEROF_1_P WHERE SUBJECT=T1A.SUBJECT AND OBJECT IN (SELECT URL FROM COURSE_1_C) GROUP BY SUBJECT ) ) ORDER BY U1.URL;

Introduction | Overview | Demo | People |  Contact information