> 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}")
Just for the sake of completeness (in the archive), there also is
3) Create a sub-property of spin:rule and set its spin:rulePropertyMaxIterationCount to 1.
Then move those rules that should not iterate under your new property.
The advantage of this solution over 1) is that it is independent of the TopSPIN settings, which may only be local to your machine (and stored in the .tbc files). The disadvantage is that setting this up is a bit of more work.
Holger
You can specify the order of rules in SPIN as well. The cleanest way is to define different sub-properties of spin:rule, and then link them together using spin:nextRuleProperty. For example, define my:prepRule and my:postRule and use them to group your rules that depend on each other. Otherwise, SPIN will use the "alphabetical" ordering of rules, and you can specify this by putting comments such as # Rule1 above the CONSTRUCT clauses. But the latter option is rather fragile, even if it's tempting for quick hacks.
Holger
no, the smf functions are currently native to TopBraid. We have factored out most of them into another stand-alone library for 3.5, and we yet need to decide on how this will be available to customers (i.e. it may be commercial for some users at least). That extended Java library also contains functions such as smf:parseDate, and all those functions have been moved into a separate namespace called http://spinrdf.org/spif# to clarify that they will work independently of TopBraid (Composer or Live).
In the case of buildURI, you have the option of using fn:concat in your own function, but even then you may need to wait for 3.5 which has better SPARQL 1.1 support - I am not sure whether the function IRI that turns strings into URI resources was already in 3.4. Also, to emulate buildURI you will need to do string functions that escape special characters.
As usual you seem to catch us at the bleeding edge, just in time for the next release :)
Regards,
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
> topbrai...@googlegroups.com
> To unsubscribe from this group, send email to
> topbraid-user...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/topbraid-users?hl=en
> The following seems to work:
>
> LET (?mp := IRI(fn:concat("http://sofia.gotdns.com/ontologies/
> SemanticConnections.owl#mediaPath_", afn:localname(?this), "_to_",
> afn:localname(?x2)))) .
>
> with both SPIN API 1.1.2 and TBC FE 3.4 (but not in the SPARQL Tab)
That's good. What happens when you run this in the SPARQL tab?
Holger
the final release of the SPIN API will likely be synchronized with 3.5, in a couple of weeks. This is because I would like to benefit from the fact that we are doing a full QA on the TopBraid product line for 3.5, and this may also reveal bugs in the SPIN API. But I'll send you a link to a beta snapshot in a private email (any other beta testers may contact me as well).
As promised elsewhere, I have prepared a new example that demonstrates how to do OWL RL inferencing with the open source API. This also demonstrates optimized access to the rules so that only the domain model is queried - not the OWL RL model itself. The online versions of the OWL RL namespace now no longer rely on any native SMF function, so they will work with bare Jena.
Regards,
Holger