There is no API for that, because once the ARQ Query object has been
created, the original string (as entered by the user) is gone. But
creating such queries is quite easy - simply create the two triples
through the normal Jena API calls, or use the code below and add
spinQuery.addProperty(SP.text, string);
HTH
Holger
On 9/12/2016 17:13, Nguyen Mau Quoc Hoan wrote:
Hi Holger,
Thanks for your quick reply. You're correct, using the sp:text might
be the solution. However, when I use SPIN API to convert SPARQL query
to SPIN query, it seems there is no sp:text. I followed the SPIN example:
|
QueryarqQuery =ARQFactory.get().createQuery(model,query);
ARQ2SPIN arq2SPIN =newARQ2SPIN(model);
SelectspinQuery =(Select)arq2SPIN.createQuery(arqQuery,null);
|
Can you please point me to which API I should use to add the sp:text ?
Thanks,
Hoan
On Friday, December 9, 2016 at 12:44:51 AM UTC, Holger Knublauch wrote:
Hi,
if I understand your question correctly, your main issue is the
ease of converting from SPIN RDF triples back to an executable
SPARQL string? The easiest way to do that might be to store your
queries using sp:text. Search for sp:text in
http://spinrdf.org/sp.html for examples:
[ a sp:Ask ;
sp:text """
# must be at least 18 years old
ASK WHERE {
?this my:age ?age .
FILTER (?age < 18) .
}"""
]
This way, you don't need another SPIN converter and can retrieve
the SPARQL strings with a simple query.
Does this help?
Holger
On 9/12/2016 5:52, [email protected] <javascript:> wrote:
Hi all,
I'm a new user of SPIN. I'm able to convert the SPARQL query into
SPIN syntax. The SPIN query will then be stored in the external
triple storage (Jena TDB, Virtuoso,...) so I can do some analytic
later on. However, it leads to the problem when I'm trying to
convert back from SPIN query to SPARQL. My assumption is that, in
order to convert back SPIN query to SPARQL, I might need to
retrieve all the SPIN triples and save into a jena model. Then, I
will be able to convert back to original SPARQL. My question is,
how I can write the SPARQL query to get back all the SPIN triples
from the external triple storage, or is there any sufficient way
to do that?
Thanks a million
--
You received this message because you are subscribed to the
Google Group "TopBraid Suite Users", the topics of which include
the TopBraid Suite family of products and its base technologies
such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
<javascript:>
---
You received this message because you are subscribed to the
Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to [email protected] <javascript:>.
For more options, visit https://groups.google.com/d/optout
<https://groups.google.com/d/optout>.
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include the TopBraid
Suite family of products and its base technologies such as
SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
You received this message because you are subscribed to the Google
Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Group "TopBraid
Suite Users", the topics of which include the TopBraid Suite family of products and
its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
You received this message because you are subscribed to the Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.