James; SPIN rules are executed in a forward-chaining process, meaning the rules will be executed until no new triples are created.  If you create a bnode in the rule, then you have basically created an infinite loop because each bnode will be seen as a unique subject.

One approach is to BIND a subject with  spif:generateUUID() to get a unique URI for the CONSTRUCT clause.  The other is to set the max iteration count for the rule (see spin:rulePropertyMaxIterationCount).

-- Scott
 

On 4/23/2014, 9:24 AM, James Howison wrote:
Hi all,

I'm trying to use SPIN (which I'm quite impressed by, love to reuse my SPARQL knowledge); I've had some success but run into a situation in which the rule runs for a long time then results in Java out of heap space. 

The SPARQL query that I'm using executes quickly directly, but not when run via SPIN.  I'm trying to understand why.

The code and data are on github:


The relevant code running the rules is:

The relevant SPIN rule is:

bioj:selection a rdfs:Class ;
spin:rule [ rdf:type sp:Construct ;
sp:text """
# Moves all codes directly onto DirectSelection, even if they originated
# on a reference.
CONSTRUCT {
?this ca:isTargetOf [ ca:appliesCode ?coding ] .
}
WHERE {
?this bioj:has_reference ?ref .
?ref ca:isTargetOf [ ca:appliesCo de ?coding ] .
}"""
] ;

This should get things working locally for anyone kind enough to take a look for me, dependencies via Maven.

You'll have to edit the path variable at:


cd softcite/code
mvn -Dtest=AppTest#testSPINoutput test  (or mvn test)

I've tried it with spin:thisUnbound "true"^^xsd:boolean ; as well, but no cigar.  Is there something recursive going on here that I can control?

Thanks,
James


--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages 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
---
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.



--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages 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
---
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