Example(Bad). I have 3 classes ABC A and B have a spin rule to
generate there label
C generates its label out of A's and B's Label.
So when I run i get a version of C's label with A and B having no
label
and version with A and B having a label.
Although both are correct, i really only care about the longer C
label. So either i say run these rules first somehow. Or I filter
out the shorter of 2 labels when their are 2. But then I would
probably hit a infinite loop.
I can do this with sparql motion but I'm trying to avoid it.
I know the inference engine loops over until there are no new triples.
Thanks for any help. you can provide
This may do what you need. Are you saying that in the end you want
labels for A, B, and C. Or just C? If it's just C, then you can take
your rules for generating labels for A and B an place them in SPIN
functions. Then just create a rule for C that would look something
like:
CONSTRUCT
{ ?this rdfs:label ?label
}
WHERE
{ LET (?alabel := :getLabelForA())
LET (?blabel := :getLabelForB())
LET (?label := smf:buildString("{?alabel}--{?blabel}"))
}
or, in more compact form:
LET (?label := smf:buildString("{?1}--{?
2}", :getLabelForA(), :getLabelForB()))
<I know the inference engine loops over until there are no new
triples.>
You can set the engine to run a single pass only in Configure
Inferencing.
-- Scott
--
You received this message because you are subscribed to the Google Groups "TopBraid Composer Users" group.
To post to this group, send email to topbraid-co...@googlegroups.com.
To unsubscribe from this group, send email to topbraid-composer...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/topbraid-composer-users?hl=en.
Rules would then be defined in spin:rs1 and spin:rs2 for class
definitions.
-- Scott
On Feb 22, 7:11 am, Tim Darr <tdarr.u...@gmail.com> wrote:
> What is the scope of the rule sequencing? Is it the class to which the rule
> is attached, or is it global?
>
> For example, if I have two unrelated classes A and B, and two rules ruleA
> (attached to class A) and ruleB (attached to class B) and specify that ruleB
> is the nextRuleProperty of ruleA, will ruleA always precede ruleB?
>
> I have implemented something like this and it appears that the sequencing is
> not working as expected ...
>
> On Fri, Feb 19, 2010 at 4:37 PM, Scott Henninger <shennin...@topquadrant.com
> > topbraid-composer...@googlegroups.com<topbraid-composer-users%2Bunsu...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/topbraid-composer-users?hl=en.
>
> --
> Tim Darr
To unsubscribe from this group, send email to topbraid-composer...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/topbraid-composer-users?hl=en.
I figured out how to do it but your not going to like it :)
DELETE {
?this :hasPreSQL ?result
}
WHERE {
LET (?query :=fn:concat("SELECT ?finalSQL WHERE{ :",smf:generateLabel(?
this)," :hasFinalSQL ?finalSQL .}")) .
LET (?query2 :=fn:concat("SELECT ?finalsql
WHERE{ :",smf:generateLabel(?this)," :hasFinalSQL ?finalsql LET (?
count :=fn:string-length(?finalsql)) . }ORDER BY ?count LIMIT 1")).
LET (?result := smf:if(smf:countResults(?
query)>=2,:ConCatResultSet("",?query2,""))) .
}
ConCatResultSet is just used to run the query and return "?finalsql"
so if there is only 1 hasFinalSQL, it returns null which removes
nothing, else it removes the shorter of the 2.
The only issue I have now is where to put this to run.
As far as I know if I put in on a class as a spin rule It has to have
a CONSTRUCT, so The only solution I can think of is, wrapping it up as
a sparql motion script. and calling if from a construct.
Any ideas?
Thanks, that was a learning experience.
INSERT and DELETE are applied directly to the model's asserted graph.
This is a different mechanism than used in inference engines, which
are monotonic - facts cannot be retracted.
A SPARQL MODIFY query can be applied either in the SPARQL view or a
SPARQLMotion script.
-- Scott
when I bring up 'spin:rule' class, they do not show up as instances of
that class.
They are all constructs