02.mapping.ttl 754 B

1234567891011121314151617181920212223242526272829
  1. @prefix rr: <http://www.w3.org/ns/r2rml#> .
  2. @prefix ex: <http://example.com/ns#> .
  3. <#DeptTableView> rr:sqlQuery """
  4. SELECT DEPTNO,
  5. DNAME,
  6. LOC,
  7. (SELECT COUNT(*) FROM EMP WHERE EMP.DEPTNO=DEPT.DEPTNO) AS STAFF
  8. FROM DEPT
  9. """.
  10. <#TriplesMap2>
  11. rr:logicalTable <#DeptTableView>;
  12. rr:subjectMap [
  13. rr:template "http://data.example.com/department/{DEPTNO}";
  14. rr:class ex:Department;
  15. ];
  16. rr:predicateObjectMap [
  17. rr:predicate ex:name;
  18. rr:objectMap [ rr:column "DNAME" ];
  19. ];
  20. rr:predicateObjectMap [
  21. rr:predicate ex:location;
  22. rr:objectMap [ rr:column "LOC" ];
  23. ];
  24. rr:predicateObjectMap [
  25. rr:predicate ex:staff;
  26. rr:objectMap [ rr:column "STAFF" ];
  27. ].