nkons / r2rml-parser

R2RML Parser is an award-winning tool that can export relational database contents as RDF graphs, based on an R2RML mapping document.
Apache License 2.0
68 stars 21 forks source link

Support for rr:predicateMap? #31

Open jensscheerlinck opened 5 years ago

jensscheerlinck commented 5 years ago

When trying to use a rr:predicateMap with a rr:column or rr:template value, the parsers produces no results.

Example:

rr:predicateObjectMap [
        rr:predicateMap [ rr:column 'TestColumn' ];
        rr:objectMap [
            rr:parentTriplesMap map:RechtsbronDocument; 
            rr:joinCondition [
                rr:child 'ChildColumn';
                rr:parent 'ParentColumn';
            ]
        ]
    ].

I only get the desired triples when using rr:predicateMap [ rr:constant ex:test ] or rr:predicate ex:test

nkons commented 5 years ago

Hi,

Thanks for reporting this.

In a rr:predicateMap, only an rr:constant is implemented. rr:column and rr:template are not implemented. To implement these would mean parsing them inside the loop in [1], in which only rr:constant is currently parser. A possible workaround would be creating one rr:predicateObjectMap per value in the TestColumn. Since these values are meant to be properties, I would assume their number is manageable?

  1. https://github.com/nkons/r2rml-parser/blob/master/src/main/java/gr/seab/r2rml/beans/Parser.java#L290
jensscheerlinck commented 5 years ago

Hi,

Thanks for the response.

Unfortunately we have some 30 different values in the 'TestColumn'. Currently we have indeed split these up into 30 different maps. Which has a big impact on performance.

Creating different rr:predicateObjectMap elements would also be a possibility. However, we also tried this out before and the result was a very sparse matrix that made overall performance even worse.

mmopitz commented 5 years ago

Hi there. I was just wondering if you plan to support this feature in the near future? I'm currently running with the workaround mentioned above, but it would greatly simplify my mapping file if I could just use rr:templates in predicate position ;-)