I forgot one thing (see below)...
On Jul 5, 2010, at 8:29 PM, Holger Knublauch wrote:
> Hi Guil,
>
> On Jul 5, 2010, at 8:17 PM, Guilherme Scomparim wrote:
>
>> Hi People,
>>
>> I am creating a Metamodel as one single model and I am importing this
>> metamodel to design another model.
>>
>> In order to do this I need to create classes and restrictions in the
>> model based on the imported metamodel that contain the rule below.
>>
>> CONSTRUCT {
>> ?Class a owl:Class .
>> ?Class rdfs:subClassOf pmda:StateClass .
>> ?Class owl:equivalentClass _:b0 .
>> _:b0 a owl:Restriction .
>> _:b0 owl:onProperty ?cProperty .
>> _:b0 ?cFunc ?cValue .
>> }
>> WHERE {
>> ?Crit a pmda:StateCriterion .
>> ?Class pmda:hasCriterion ?Crit .
>> ?Crit pmda:criterionProperty ?cProperty .
>> ?Crit pmda:criterionOperator ?cOpe .
>> ?cOpe pmda:operatorFunction ?cFunc .
>> ?Crit pmda:criterionValue ?cValue .
>> }
>>
>> The classes creation are working perfectly, however when I create a
>> restriction via a SPIN Rule and I hit the inference button the
>> application executes thousands of iterations and it seams to enter in
>> a loop because I always stoped before it ends.
>>
>> When this happen my inference configuration is TopSPIN (incremental,
>> iteratively) and then Jena Built in Reasoner
>>
>> If I set up for TopSPIN (non-incremental, single-pass) and then Jena
>> Built in Reasoner it doesn’t work, however if I add another TopSPIN
>> engine configuring the inferences to be TopSPIN (non-incremental,
>> single-pass) then TopSPIN (non-incremental, single-pass) again and
>> then Jena Built in Reasoner. In this way it works but it creates two
>> restrictions for each time I run the inference.
>>
>> My questions are:
>>
>> Does TBC support the creation of restrictions via Rule? In case of
>> yes, what am I doing wrong?
>
> Yes it's fine to create any such RDF structure with SPIN. TopSPIN will
> iterate as long as new triples have been created in one iteration, leading to
> potential endless loops. Blank nodes in a CONSTRUCT head are always new, and
> thus lead to new triples. So you either need to limit to one iteration (as
> you have found out), or you could check whether the restriction pattern is
> already present in the WHERE clause - and only add a new restriction if it
> isn't already there.
>
> If you have a complex set up in which you want to combine multiple steps, you
> could use SPARQLMotion and split your rules into multiple categories (e.g.
> my:mappingRule rdfs:subPropertyOf spin:rule...) In SPARQLMotion you can
> specify which rule predicate to run at each stage.
Instead of (or in addition to) SPARQLMotion, you may also want to have a look
at the little known properties spin:nextRuleProperty and
spin:rulePropertyMaxIterationCount described here
http://www.spinrdf.org/spin.html#spin-rules
If you group those rules together that shall only be executed once, then you
can make them values of my:mappingRule and set
spin:rulePropertyMaxIterationCount to 1 for that property. Then use
spin:nextRuleProperty to tell the engine in which order to run those groups of
rules.
Holger
--
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