Warning:
This wiki has been archived and is now read-only.
Example of SQL-Query based Approach (Part 3: Query): SPARQL Query and its SQL translation
From RDB2RDF
SPARQL graph-pattern
{ ?x emp:Name ?ename . ?x emp:deptNum ?dno . ?d dept:deptno ?dno . ?d dept:Name ?dname }
Generated SQL query
Note: We have not shown transformation of column values to RDF terms.
WITH DEPT_VW AS ( Select '<xyz.com/dept/' || deptno || '>' AS deptURI , deptno , dname , loc from dept ), EMP_VW AS ( Select '<xyz.com/emp/' || empno || '>' AS empURI , empno , ename , '<xyz.com/emp/job/'|| job || '>' AS jobTypeURI , job , deptno , '<xyz.com/emp/etype/'|| etype || '>' AS empTypeURI , etype , '<xyz.com/graph/'|| job || '/' || etype || '>' AS graphURI from emp ) SELECT T1.DNAME as DNAME,T0.ENAME as ENAME FROM EMP_VW T0, DEPT_VW T1 WHERE T0.DEPTNO = T1.DEPTNO ;