Hey,
I have a somewhat artificial use case where both a class and its superclass each have an spl:Argument with the same predicate, but different spl:defaultValue, and possibly other properties:
:Template a spin:Template ;
spin:constraint [ a spl:Argument ;
spl:predicate :property ;
spl:valueType xsd:long ;
spl:defaultValue 111
] .
:SubTemplate a spin:Template ;
rdfs:subClassOf :Template ;
spin:constraint [ a spl:Argument ;
spl:predicate :property ;
spl:valueType xsd:long ;
spl:defaultValue 999
# spl:optional true
] .
When [ a :SubTemplate ] is instantiated, what will be its :property value (assuming it comes from spl:defaultValue)?
I would think the subclass argument has precedence, but looking at the ModuleImpl code, it seems that a List<Argument> is collected from the class and all its superclasses, ignoring inheritance:
https://github.com/TopQuadrant/shacl/blob/master/src/main/java/org/topbraid/spin/model/impl/ModuleImpl.javaBut maybe the inheritance/precedence is handled somewhere else?
Also, would it be illegal for the subclass to define the argument as spl:optional if the superclass does not do so? Wouldn't that break the template contract? I guess the same applies to redefinition of spl:valueType etc.
Thanks,
Martynas
atomgraph.com