zazuko / xrm

A friendly language for mappings to RDF
MIT License
1 stars 0 forks source link

Support for R2RML views (conditional mappings) #29

Closed mchlrch closed 4 years ago

mchlrch commented 5 years ago

Supporting R2RML views would help in dealing with conditional mappings, cases where the mapping rules depend on conditions in the source data (eg. if a flag is set or not, etc.)

see also https://zulip.zazuko.com/#narrow/stream/37-bfh-ext/topic/hello/near/41930

Would be interesting to try rr:sqlQuery in SD virtual graphs

mchlrch commented 4 years ago

DSL:

logical-source foobar {
  source query "SELECT * FROM foobar"
  ...
}

Generated R2RML:

rr:logicalTable [ rr:sqlQuery """SELECT * FROM foobar""" ];

Generated RML:

rml:logicalSource [
    rml:query """SELECT * FROM foobar""" ;
    rml:referenceFormulation rr:SQL2008
];

For the RML output, I'm not sure if the output is correct that way. rml:query is mentioned in a sample but not in the spec.

mchlrch commented 4 years ago

(for reference purposes) "Conditional creation of property in R2RML" https://stackoverflow.com/questions/35895851/conditional-creation-of-property-in-r2rml