I think, in general what is throwing me is that the Argument template
can be "instantiated" and used as the subject of a constraint, and thus
the instantiated argument should (in my mind) be an ASK (or specialized
CONSTRUCT) query, not merely contain an ASK query.
The comment for spin:constraint says:
"The values of this property are "axioms" expressed as CONSTRUCT or ASK
queries where the variable"
So, anytime I see a spin:constraint property, I would expect it to point
directly to either a sp:Ask or (the specialized) sp:Construct query, or
a subclass thereof. e.g. the example in the SPIN Modeling Vocabulary
doc:
ex:Parent
a rdfs:Class ;
rdfs:label "Parent"^^xsd:string ;
rdfs:subClassOf ex:Person ;
spin:constraint
[ a sp:Ask ;
rdfs:comment "must be at least 18 years old"^^xsd:string
;
sp:where ([ sp:object sp:_age ;
sp:predicate ex:age ;
sp:subject spin:_this
] [ a sp:Filter ;
sp:expression
[ a sp:lt ;
sp:arg1 sp:_age ;
sp:arg2 18
]
])
].
However (for an example where this is not the case) the anonymous,
instantiated Argument that is specified as a spin:constraint in the
sml:ImportTextFile class is not of class sp:Ask, it merely "contains" an
instance of an sp:Ask via its spin:body property.
So, I'm thinking your run-time environment must know to look for either
possibility to find the Ask query that it needs to execute in order to
determine if the current model violates any specified constraints. This
also leads to the somewhat confusing concept of the object of a
spin:constraint property possibly causing "default value" triples to be
constructed, since Arguments not only contain sp:Ask objects but also
the concept of setting default values (e.g. the sm:outputVaiable
argument of the sml:ImportTextFile class which specifies the default
value of "text", and that I'm assuming would be executed by the runtime
environment when needed because of the ConstructDefaultValues attached
to spin:Modules via the spin:constructor property)
Or perhaps I'm still not grasping something here?
Jeff
________________________________
From: Holger Knublauch [mailto:[email protected]]
Sent: Wednesday, January 07, 2009 2:54 PM
To: [email protected]
Subject: Re: ConstructDefaultValues (was: Re: [tbc-users] Re: SPIN
ExamplesandVideos posted)
Seems to say spl:Argument or spl:Attribute can be attached as a
spin:constraint, and I don't think either of them are either ASK or
CONSTRUCT queries. Perhaps I'm getting lost in the meta levels?
Both spl:Argument and spl:Attribute are SPIN templates that wrap ASK
queries. So substitute the template with the actual body query and you
can see that they can be used as constraints. For example, spl:Attribute
checks the cardinality of the property at the subject, and its value
type (range).
> Is there an example where a default value is set in any of your
example ontologies so I can see where ConstructDefaultValues would come
into play?
Yes, SPARQLMotion - the class sm:Module has that constructor attached to
it because the various SM module types use spl:Argument to declare their
properties.
Holger
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TopBraid Composer Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/topbraid-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---