Dear Holger, Topbraid devs,
I will understand if you don't have time to answer this question.
Given a Jena model holding a set of spin queries. How do I get back a valid
sparql query.
My current approaches are
OntModel ontModel = //Has the triples containing a SPIN model.
Map<CommandWrapper, Map<String, RDFNode>> initialTemplateBindings = new
HashMap<CommandWrapper, Map<String, RDFNode>>();
Map<Resource, List<CommandWrapper>> cls2Query =
SPINQueryFinder.getClass2QueryMap(
ontModel,ontModel, SPIN.command, true,
initialTemplateBindings, false);
for (final Map.Entry<Resource, List<CommandWrapper>> en :
cls2Query.entrySet())
for (final CommandWrapper wr : en.getValue())
{
final Command com = wr.getSPINCommand();
SPINFactory.asQuery(wr.getSource()).toString();
//Or this method
ARQFactory.get()
.createQuery(rule.getOntologyModel(),
com.toString()).toString());
}
This gives back a SPARQL query. The only problem is that it contains things
like sp:regex instead of REGEX etc...
The converter function at http://spinservices.org/spinrdfconverter.html does
this. Which suggests that this is possible I just haven't found the right API
calls.
If this is outside of the open SPINAPI that's ok.
Regards and thanks for your time,
Jerven
--
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