sparql - Why did TopBraid Composer FE re-group my multiple OR conditions in a SPIN rule filter? -
i'm using topbraid composer free edition (tbc fe) version 5.1.3. i'm building spin rules / construct queries. part of query has filter statement multiple or'd conditions. enter tbc fe follows:
filter ( (?orgstring = substr("af x"^^xsd:string, 1, 4)) || (?orgstring = substr("j x"^^xsd:string, 1, 4)) || (?orgstring = substr("ar x"^^xsd:string, 1, 4)) || (?orgstring = substr("n x"^^xsd:string, 1, 4)) || (?orgstring = substr("ns x"^^xsd:string, 1, 4)) || (?orgstring = substr("mc x"^^xsd:string, 1, 4)) ) .
but, when save spin rule in tbc fe, regroups or'd conditions set of binary or's:
filter ( (((((?orgstring = substr("af x"^^xsd:string, 1, 4)) || (?orgstring = substr("j x"^^xsd:string, 1, 4))) || (?orgstring = substr("ar x"^^xsd:string, 1, 4))) || (?orgstring = substr("n x"^^xsd:string, 1, 4))) || (?orgstring = substr("ns x"^^xsd:string, 1, 4))) || (?orgstring = substr("mc x"^^xsd:string, 1, 4)) ) .
my question is: why regrouping? i've used other sparql editors , end points did not regrouping. contend makes code harder read (cost), i'm wondering benefit is?
also, if regrouping not necessary, there way turn off in tbc fe?
thanks.
ps: yes, know taking substring of literal string seems stupid. i'm doing avoid bug in sesame trims literal strings when load rdf file save tbd fe sesame. bug has been reported , being addressed. when it's fixed, i'll upgrade sesame version , remove these ugly substrings.
it's way jena print queries, not aspect of tbc fe. binary operator left associative parser creates expression tree (( e1 op e2 ) op e3 ) , printed that. simple , safe; printing expressions not take precedence account.
an alternative way write filter
?orgstring in ( substr("af x", 1, 4), substr("j x", 1, 4), ...)
in case help.
Comments
Post a Comment