morph-kgc / morph-kgc

Powerful RDF Knowledge Graph Generation with RML Mappings
https://morph-kgc.readthedocs.io
Apache License 2.0
189 stars 34 forks source link

Direct relation not working #64

Closed ramcaat closed 2 years ago

ramcaat commented 2 years ago

win 2.1.1, we tried to do a direct relation mapping and we got the error

2022-05-06 19:16:13.011;INFO;1 mapping rules retrieved. 2022-05-06 19:16:13.021;DEBUG;All predicate maps are constant-valued, invariant subset is not enforced. 2022-05-06 19:16:13.028;DEBUG;All graph maps are constant-valued, invariant subset is not enforced. 2022-05-06 19:16:13.036;INFO;Mapping partition with 1 groups generated. 2022-05-06 19:16:13.038;INFO;Maximum number of rules within mapping group: 1.

What is this mean? No triples are generated. 1.6.0 works fine and we were able to get triples

example

rml:referenceFormulation ql:JSONPath .

<#LocationMapping> rml:logicalSource <#Mapping>; a rr:TripleMap; rr:subjectMap [ rr:template "http://example/{column1}"; ];

rr:predicateObjectMap [
    rr:predicate sw:manages;
    rr:objectMap [
        rr:template "http://example/{column2}"
    ];
];

.

arenas-guerrero-julian commented 2 years ago

Hi @ramcaat ,

It is not possible to reproduce the issue with the example you provided. It looks like a very basic predicate object map.

Please send more concrete data and mappings.

ramcaat commented 2 years ago

Below is the sample json

[ { "ValueA": "1234567", "ValueC": "1234567", "ValueB:ValueA": "7654321", "ValueB:ValueC": "7654321", "ValueB:ValueD": "9876543", "ValueB:ValueE": "9876543" }, { "ValueA": "1234567", "ValueC": "1234567", "ValueB:ValueA": "4534567", "ValueB:ValueC": "4534567", "ValueB:ValueD": "9876543", "ValueB:ValueE": "9876543" }, { "ValueA": "1234567", "ValueC": "1234567", "ValueB:ValueA": "8764567", "ValueB:ValueC": "8764567", "ValueB:ValueD": "9876543", "ValueB:ValueE": "9876543" }, { "ValueA": "1234567", "ValueC": "1234567", "ValueB:ValueA": "6578976", "ValueB:ValueC": "6578976", "ValueB:ValueD": "9876543", "ValueB:ValueE": "9876543" }, { "ValueA": "1234567", "ValueC": "1234567", "ValueB:ValueA": "7654987", "ValueB:ValueC": "7654987", "ValueB:ValueD": "9876543", "ValueB:ValueE": "9876543" }, { "ValueA": "1234567", "ValueC": "1234567", "ValueB:ValueA": "9846789", "ValueB:ValueC": "9846789", "ValueB:ValueD": "9876543", "ValueB:ValueE": "9876543" }, { "ValueA": "1234567", "ValueC": "1234567", "ValueB:ValueA": "1256743", "ValueB:ValueC": "1256743", "ValueB:ValueD": "9876543", "ValueB:ValueE": "9876543" }, { "ValueA": "1234567", "ValueC": "1234567", "ValueB:ValueA": "7687678", "ValueB:ValueC": "7687678", "ValueB:ValueD": "9876543", "ValueB:ValueE": "9876543" } ]

RML - simple mapping doesnt work in 2.1.1 and works in 1.6.0

<#Main> rml:iterator "$.*"; rml:referenceFormulation ql:JSONPath .

<#Mapping> rml:logicalSource <#Main>; a rr:TripleMap; rr:subjectMap [ rr:template "http://example/{ValueA}"; ];

rr:predicateObjectMap [ rr:predicate ex:manages; rr:objectMap [ rr:template "http://example/{ValueB:ValueA}" ]; ];

.

ramcaat commented 2 years ago

Also found the same warning comes in 1.6.0 but it generates triples as opposed to 2.1.1 where it doesnt

arenas-guerrero-julian commented 2 years ago

Hi @ramcaat ,

The problem is in your mapping, you are missing a s in a rr:TripleMap;. The reason it was working in v1.6.0 is that only a type of triples map was possible. From v2.0.0 we support RML-star, which introduces rml:NonAssertedTriplesMap.

ramcaat commented 2 years ago

Oh thanks. Didn't even notice it. Will test it