Gerrit; By default the SPIN engine iterates until there are no new
triples constructed.  In your case, each time you call
smf:buildUniqueURI(), a new uri is created by the {?mp a sc:MediaPath}
triple pattern in the CONSTRUCT statement.  There are two potential
solutions to the problem:
 1) Set the TopSPIN engine to single-pass in Configure Inferencing
 2) use smf:buildURI with a known pattern, such as
smf:buildURI("sc:mediapath{?x1}_to_{?x2}")

Some background may also be helpful.  SPIN rules are defined in a
class definition an applied to all members of a class (including
subClassOf entailments).  Therefore, any SPIN rule without reference
to ?this is suspect because the scope of the query is misaligned with
how it is being applied.  That's not to say that SPIN rules can't have
a wider scope than the member it is being applied to, but that this
should be seen as a rare case.

I suspect you want to look at all resources in your model for the
connectedTo property.  If that's the case, a better SPIN rule would be
to define the following in owl:Thing:

CONSTRUCT {
    ?mp a sc:MediaPath .
    ?x3 sc:hasMediaPath ?mp .
    ?mp bonding:mediaSourceSO ?x2 .
    ?mp bonding:mediaOriginator ?x1 .
}
WHERE {
    ?this sc:connectedTo ?x3 .
    LET (?mp := smf:buildUniqueURI("sc:mediapath")) .
}

The only real difference is replacing ?x1 with ?this.  But this makes
the semantic of your rule clearer.  You want to apply the rule all
entailed instances of owl:Thing.

-- Scott

On Apr 7, 9:02 am, Gerrit <[email protected]> wrote:
> Is it possible to insert new instances using SPIN rules? The following
> seems to work in the Query Editor:
>
> CONSTRUCT {
>     ?mp a sc:MediaPath .
>     ?x3 sc:hasMediaPath ?mp .
>     ?mp bonding:mediaSourceSO ?x2 .
>     ?mp bonding:mediaOriginator ?x1 .}
>
> WHERE {
>     ?x1 sc:connectedTo ?x3 .
> LET (?mp := smf:buildUniqueURI("sc:mediapath")) .
>
> }
>
> But adding it as a SPIN ruie seems to have either no effect, or causes
> TopSPIN to continue iterating.
>
> Regards,
> Gerrit

-- 
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include TopBraid Composer,
TopBraid Live, TopBraid Ensemble, SPARQLMotion and SPIN.
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-users?hl=en

Reply via email to