I'm on SPIN API 1.3.1 = Jena 2.11.0.

There is no other way of serializing Rules to String though? It would make
sense for toString() to do this, but for now I guess I'll need to work
around this with my own printer.
On Fri 18 Sep 2015 at 09:58 Dave Reynolds <dave.e.reyno...@gmail.com> wrote:

> Hi Martynas,
>
> On 17/09/15 23:37, Martynas Jusevičius wrote:
> > Hit send too soon!
> >
> > When the list is serialized back to String again, I get
> >
> > [[ inheritance: (?template rdf:type http://graphity.org/gp#Template)
> > (?template ?p ?o) (?p rdf:type owl:AnnotationProperty) (?p
> > rdfs:isDefinedBy http://graphity.org/gp#) (?subClass rdfs:subClassOf
> > ?template) noValue(?subClass ?p) -> (?subClass ?p ?o) ]]
> >
> > Notice the missing < > brackets on URIs. Reparsing the string gives an
> > exception:
> >
> > com.hp.hpl.jena.reasoner.rulesys.Rule$ParserException: Malformed rule
> > At 'http://graphity.org/gp# ) ( ?subClass rdfs:subClassOf ?template )
> > noValue ( ?subClass ?p ) -> ( ?subClass ?p ?o ) ] ] '
> >
> > Can you confirm this is a bug? I need to roundtrip Rules from Strings
> > to objects and back.
>
> There's no guarantee that Rule.toString will round trip, it's just there
> for debugging, that's why the javadoc says "Printable string describing
> the rule".
>
> However, it ought to be easy to put <> round the absolute URIs and if
> that's enough to give you round tripping then great.
>
> Can't do this myself at present - I don't have a working built of Jena3,
> still on Jena2. Are you on Jena2 or Jena3?
>
> Dave
>

Reply via email to