Thanks! On Thu, Apr 16, 2009 at 4:06 PM, Holger Knublauch <[email protected]>wrote:
> > > 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 > > > > > -- Prateek Jain Research Assistant, Kno.e.sis Center Wright State University Fairborn,Ohio 45435 http://knoesis.wright.edu/students/prateek/ Groucho Marx <http://www.brainyquote.com/quotes/authors/g/groucho_marx.html> - "A child of five would understand this. Send someone to fetch a child of five." --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
