Thanks Holger.

I think a solution could be to have 2 sets of arguments: template-local (by 
default), and inheritable (defined so explicitly), or "tunneled". 
Subclasses would not see the local arguments of superclasses, and it would 
be an error to redefine tunneled arguments with a different contract.

This is the idea behind tunnel parameters in XSLT 
2.0: https://www.w3.org/TR/xslt20/#tunnel-params

On Monday, August 29, 2016 at 2:51:42 AM UTC+2, Holger Knublauch wrote:
>
> Hi Martynas,
>
> as you have found out, this scenario is not supported by SPIN. Multiple 
> declarations of the same predicate lead to undefined behavior. I am not 
> particularly keen to touch this area of code, because it is so widely used 
> and I don't want to risk regression bugs or performance degradation at this 
> stage. Given that this doesn't appear to be a common scenario, your 
> work-around is to not declare the argument twice, for example by having an 
> abstract superclass for both templates, where only the subclasses declare 
> :property.
>
> Holger
>
>
> On 29/08/2016 2:06, Martynas Jusevicius wrote:
>
> 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.java
>
> But 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
> -- 
> You received this message because you are subscribed to the Google Group 
> "TopBraid Suite Users", the topics of which include the TopBraid Suite 
> family of products and its base technologies such as SPARQLMotion, SPARQL 
> Web Pages and SPIN.
> To post to this group, send email to [email protected] 
> <javascript:>
> --- 
> You received this message because you are subscribed to the Google Groups 
> "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
You received this message because you are subscribed to the Google Group 
"TopBraid Suite Users", the topics of which include the TopBraid Suite family 
of products and its base technologies such as SPARQLMotion, SPARQL Web Pages 
and SPIN.
To post to this group, send email to [email protected]
--- 
You received this message because you are subscribed to the Google Groups 
"TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to