kg-construct / rml-core

RML-Core: Main features for RDF generation with RML
https://w3id.org/rml/core/spec
Creative Commons Attribution 4.0 International
12 stars 8 forks source link

OM, SM, and GM may have no reference, template, or constant #111

Open chrdebru opened 6 months ago

chrdebru commented 6 months ago

https://github.com/chrdebru/rml-core/blob/missing-test/shapes/expression_map.ttl

Implements the following:

    # Exactly one rml:template, one rml:constant, one rml:reference,
    # one rml:returnMap, or one rml:functionExecution is required.

We, however, allow no such thing for subject maps and object maps (and arguably graph maps) as well. The iterations are then used to generate blank nodes. Should we remove the mincount?

DylanVanAssche commented 6 months ago

This construct you mention is to enforce that any of these options is picked (so minCount == 1) and also that you don't put multiple of these options (maxCount == 1).

allow no such thing for subject maps and object maps (and arguably graph maps)

I cannot follow here. Each of these maps must have exactly one of these options right? A subject map must have a template/constant/reference/... right? You can enforce it more strict in the specific maps though if needed.

DylanVanAssche commented 6 months ago

Rethinking this issue: is this when you have rml:termType rml:BlankNode without a template? If that's the only 'exception' to the rule, we should maybe define this restriction:

IF termType == BlankNode
  minCount = 0
ELSE
  minCount = 1

?

chrdebru commented 6 months ago

Yes, but what if no rml:termType is provided? I'm also thinking about the Gather Maps, and it is difficult (impossible?) to "overwrite" shapes in SHACL. My approach is more: if no rml:template, rml:reference, and rml:constant, then the rml:termType is assumed to be rml:BlankNode. This rule would work with predicate maps as well as the inferred term type blank node violates the rml:termType rr:IRI constraint.

DylanVanAssche commented 6 months ago

Yes, but what if no rml:termType is provided?

There should be a default which should be used. For SubjectMaps this is IRI. It will be a 'fun' job to actually check this in SHACL shapes...

and it is difficult (impossible?) to "overwrite" shapes in SHACL.

I'm not sure how you can overwrite things I'm afraid... It is purely an AND/OR/XOR story AFAIK. Correct me if I'm wrong.

chrdebru commented 6 months ago

I would argue that the default when no constant, template, or reference is provided should be blank nodes. That's the only thing that you can generate based on the iteration. Defaults can be "inferred" once you have one of them.

dachafra commented 2 months ago

This depends on the final decision of #52