Skip to content

Using R2RML Mapping

Josef Hardi edited this page Jan 18, 2015 · 1 revision

See the comparison using Semantika native TERMAL/XML syntax

@prefix : <http://obidea.com/ex/ontology/work/>
@prefix rr: <http://www.w3.org/ns/r2rml#>

<TriplesMap1>
   rr:logicalTable [ rr:tableName "employees" ];
   rr:subjectMap [
      rr:template "http://obidea.com/ex/ontology/work/employee/{emp_no}/"
   ];
   rr:predicateObjectMap [
      rr:predicate :firstName;
      rr:objectMap [ rr:column "first_name" ]
   ];
   rr:predicateObjectMap [
      rr:predicate :lastName;
      rr:objectMap [ rr:column "last_name" ]
   ];
   rr:predicateObjectMap [
      rr:predicate :hireDate;
      rr:objectMap [ rr:column "hire_date" ]
   ].

<TriplesMap2>
   rr:logicalTable [ rr:sqlQuery """
      SELECT dept_manager.emp_no as employeeID
      FROM dept_manager
      JOIN titles on dept_manager.emp_no = titles.emp_no
      """ ];
   rr:subjectMap [
      rr:class :Manaager;
      rr:template "http://obidea.com/ex/ontology/work/employee/{employeeID}/"
   ].

<TriplesMap3>
   rr:logicalTable [ rr:tableName "dept_emp" ];
   rr:subjectMap [
      rr:template "http://obidea.com/ex/ontology/work/employee/{emp_no}/"
   ];
   rr:predicateObjectMap [
      rr:predicate :WorksIn;
      rr:objectMap [ rr:template "http://obidea.com/ex/ontology/work/department/{dept_no}/" ]
   ].

Essentially, you can write an R2RML mapping document and Semantika will be able to recognize the syntax and construct the proper objects to run the system. Please consult to R2RML specification for more details on the subject.

Known Limitation

  • The system does not support referencing object map, i.e., using properties as rr:parentTriplesMap, rr:joinCondition, rr:child and rr:parent.

Clone this wiki locally