Semantic Layer course
Data + Knowledge 40 min AccuracyConsistencyExplainability

The virtual knowledge graph

Your 52,400 loans never leave Postgres

Section 1

The awkward question after Module 7

Next section
Section 2

Two ways to have a graph

Next section
Section 3

R2RML, the mapping language

Next section
Section 4

When the table does not cooperate

Next section
Section 5

SPARQL in, SQL out

Next section
Section 6

More than one source

Next section
Section 7

Who is allowed to see which rows

Hands on

Query Postgres as a graph

40 min

Load Meridian's loan tables into Postgres, write the R2RML mapping, start Ontop as a SPARQL endpoint over it, then run the same SPARQL query from Module 4 and get the same answer with no data having moved.

make lab-up            # once, starts Postgres + Fuseki + Ontop
make lab lab08-ontop-vkg

Full instructions, starter files and the solution are in labs/modules/lab08-ontop-vkg/README.md. The lab checks its own work, so you will know if it passed.

Check yourself

Quiz

7 questions, pass mark 70%. Answers are explained either way, so a wrong guess is not wasted.

1 Which two of Meridian's data assets should be materialized rather than left virtual? (pick two)

Select all that apply.

2 In an R2RML mapping, what does rr:template on a subject map produce?
3 You need loan:L-1042 mrb:borrower cust:C-1001 built from the cust_ref foreign key. Which R2RML construct does it?
4 A SPARQL query has four triple patterns on the same ?loan variable, all mapping to loan_master. Ontop emits SQL with one reference to loan_master. Which optimization did that?
5 Why does the guidance warn that auto-generated R2RML mappings are only a draft?
6 Which enforcement strategy avoids keeping a second copy of the access policy in sync with the first?
7 A JWT reaching the endpoint has sub set to a human analyst and act set to a loan Q&A agent. Why does the act claim matter?