On Apr 16, 2009, at 12:52 PM, PJ wrote:

>
> Hello,
>        I am trying to use SPIN in my work related to SPARQL re-
> writing.I have a couple of newbie questions with respect to SPIN.
>
> 1. How do I go back from RDF Representation to SPARQL Text
> Representation
>
> I looked at the the example SPINParsingExample which allows me to go
> from SPARQL Text Representation to RDF Representation.After modifying
> the RDF Representation I want to serialize it back to SPARQL Text
> Representation.
>
> Can someone please provide an outline of doing it?

If you have a Query object, just call its toString() method, which in  
turn calls print(PrintContext). The PrintContext can be supplied with  
additional options, such as whether you want to include prefix  
declarations.

>
>
>
> 2. If I have to alter the RDF representation of query,how do I achieve
> that using SPIN? or do I use Jena functions to alter it by adding lets
> says another triple constraint and a  query variable?

Yes, if you want to modify the SPIN RDF triples, you need to operate  
on generic Jena level, e.g. using Resource.addProperty.

Hope that helps
Holger


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TopBraid Composer Users" group.
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-composer-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to