Hi,
I’m trying to use a virtual graph import from a SQLServer with parent-child relationships. I have one 1 table that describes the parents which should all be subjects with some predicate-object maps. Another table with the children which also have to be added as subjects with some singular predicate-object maps and one with a parentTriplesMap to the parent.
The join is made succesfully and I get a triple for every parent-child relationship. However, the child predicate-object maps are also added as many times as there are parent-child relationships.
From an SQL perspective, this is actually normal behavior (a 1 to many join will be forced to a matrix and replicate the 1 to match the many). However, for triples this shouldn’t have to be and is actually counter-intuative, why would I ever want to have the same exact triple in my graph multiple times?
Is this something that I can configure in Stardog or the R2RML format (sorry, not used SMS yet, if that provides a solution I will definitely switch).
Example data:
Parent = sample container. Child = sample. A sample can be present in multiple containers. A container can only contain a single sample.
Parent works fine, only the correct triples are loaded
Child
predicateObjectMap --> samplename
predicateObjectMap --> samplebarcode
predicateObjectMap --> hasOwner --> Parent
If the sample is present in 5 containers, the samplename and samplebarcode triple are also replicated 5 times in the graph.
I know I can simply a totally seperate <#TriplesMap> based on the same table which will add the parent child relationships and only add samplename and samplebarcode in the current <#TriplesMap> but according to the way I understand the R2RML syntax, this shouldn’t be required.
Hope anyone can help.
Kr, Tim