Hi Damien,

The Turtle writer does not use the base when writing. It could do, and write a @base declaration, but it doesn't.

It does use prefixes, where possible.

        Andy

On 29/12/10 15:11, Damien Cram wrote:
Hi all,

I can't manage to produce Turtle output with a base URI from a Jena model.
The following piece of code...

---
Model model = ModelFactory.createDefaultModel();
model.add(
                 model.getResource("http://mydomain/resource1/";),
                 model.getProperty("http://mydomain/property1";),
                 model.getResource("http://mydomain/resource2/";)
);
model.getWriter("TURTLE").write(model, System.out, "http://mydomain/";);

or just

model.write(System.out, "TURTLE");


---

produces :

---
<http://mydomain/resource1/>
       <http://mydomain/property1>
               <http://mydomain/resource2/>  .
---

while I expected :

---
<resource1/>
    <property1>
        <resource2/>  .
---

Any idea how I could produce the above output ?

Many thanks in advance,

Damien

Reply via email to