You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Marko Pance <mp...@chemaxon.com> on 2015/08/05 14:28:51 UTC

Convert .ttl turtle format file into .rdf file

Hi... 

I have a .ttl file and I would like to use jena to convert it to an rdf file. Can you please advise on how to do so? Thanks! 

Re: Convert .ttl turtle format file into .rdf file

Posted by "ajs6f@virginia.edu" <aj...@virginia.edu>.
Can you say a little more about these files? How large are they, and what kind of RDF is in them? Also, when you say "an rdf file", to what format are you referring? RDF/XML?

I don't know very much about the workings of 'riot', but there's not too much state involved with reading and writing RDF, although there is some.

---
A. Soroka
The University of Virginia Library

On Aug 5, 2015, at 10:30 AM, Marko Pance <mp...@chemaxon.com> wrote:

> Thanks for your response. I am using the riot utility successfully on smaller file sizes. But for large ones I get a " 
> 
> java.lang.OutOfMemoryError: GC overhead limit exceeded" error message. Is there a way I can increase the heap size allocated to the JVM with a command line option? 
> 
> 
> 
> 
> Best, 
> 
> Marko 
> 
> 
> From: ajs6f@virginia.edu 
> To: users@jena.apache.org 
> Sent: Wednesday, August 5, 2015 2:35:33 PM 
> Subject: Re: Convert .ttl turtle format file into .rdf file 
> 
> You can use the utility 'riot' for this: 
> 
> https://jena.apache.org/documentation/io/#command-line-tools 
> 
> --- 
> A. Soroka 
> The University of Virginia Library 
> 
> On Aug 5, 2015, at 8:28 AM, Marko Pance <mp...@chemaxon.com> wrote: 
> 
>> Hi... 
>> 
>> I have a .ttl file and I would like to use jena to convert it to an rdf file. Can you please advise on how to do so? Thanks! 


Re: Convert .ttl turtle format file into .rdf file

Posted by Andy Seaborne <an...@apache.org>.
On 06/08/15 11:00, Damian Steer wrote:
>
>> On 6 Aug 2015, at 10:13, Marko Pance <mp...@chemaxon.com> wrote:
>>
>> I'm sorry, I don't quite understand your response. Are you saying if I'd like to stream I should try using a format other than rdf/xml? In oder to do so, could I use the command of:
>>
>>
>>
>> bin/riot --out rdfthrift ~/Downloads/chembl_20.0_molecule.ttl > ~/Downloads/chembl_20.0_molecule.rdf
>
> Essentially yes.
>
> My reading of ‘—stream’ is that it is the same as ‘—out’ but with the additional requirement that the format should support streaming.
>
>> What would go in place of "rdfthrift”?
>
> Depends on what you want to do with the result. If you want rdf/xml then you can’t stream (currently). If you want another format, well, you already have turtle of course.
>
> ntriples is a solid format generally.
>
> Damian
>


Yes - that's about it.

--stream guarantees a streaming setup or says "no"
--out will stream if possible but will fall back to non-streaming
--pretty always chooses pretty.

for example, Turtle can be printed subject-block-by-subject-block 
(streaming) or more pretty with embedded bnodes and lists.  Some of the 
pretty forms require looking through the data before starting to print.

RDF/XML, especially the RDF/XML-ABBREV is very much in the latter 
category as well.  It requires looking in the data first for striping, 
for lists and sorting out namespace for properties. Even Jena's Basic 
RDF/XML is non-streaming.

There could be a streaming RDF/XML (per triple or per subject block) but 
it's going to look ugly.  No RDF/XML striping (nested triples like bnode 
objects),  namespace attributes will need to be written on each block.

I agree with Damian - at scale N-Triples, N-Quads are useful. 
(Compressed if necessary.) Everything supports them.

	Andy


Re: Convert .ttl turtle format file into .rdf file

Posted by Damian Steer <d....@bris.ac.uk>.
> On 6 Aug 2015, at 10:13, Marko Pance <mp...@chemaxon.com> wrote:
> 
> I'm sorry, I don't quite understand your response. Are you saying if I'd like to stream I should try using a format other than rdf/xml? In oder to do so, could I use the command of: 
> 
> 
> 
> bin/riot --out rdfthrift ~/Downloads/chembl_20.0_molecule.ttl > ~/Downloads/chembl_20.0_molecule.rdf 

Essentially yes.

My reading of ‘—stream’ is that it is the same as ‘—out’ but with the additional requirement that the format should support streaming.

> What would go in place of "rdfthrift”? 

Depends on what you want to do with the result. If you want rdf/xml then you can’t stream (currently). If you want another format, well, you already have turtle of course.

ntriples is a solid format generally.

Damian

-- 
Damian Steer
Senior Technical Researcher
Research IT
+44 (0) 117 928 7057


Re: Convert .ttl turtle format file into .rdf file

Posted by Marko Pance <mp...@chemaxon.com>.
I'm sorry, I don't quite understand your response. Are you saying if I'd like to stream I should try using a format other than rdf/xml? In oder to do so, could I use the command of: 



bin/riot --out rdfthrift ~/Downloads/chembl_20.0_molecule.ttl > ~/Downloads/chembl_20.0_molecule.rdf 




What would go in place of "rdfthrift"? 


From: "Damian Steer" <d....@bris.ac.uk> 
To: users@jena.apache.org 
Sent: Wednesday, August 5, 2015 5:05:48 PM 
Subject: Re: Convert .ttl turtle format file into .rdf file 

> On 5 Aug 2015, at 15:30, Marko Pance <mp...@chemaxon.com> wrote: 
> 
> Thanks for your response. I am using the riot utility successfully on smaller file sizes. But for large ones I get a " 
> 
> java.lang.OutOfMemoryError: GC overhead limit exceeded" error message. 

I think you’re converting to rdf/xml? That doesn’t stream, so it will take memory. 

You can use —stream <format> to ensure steaming: 

$ bin/riot --stream rdfxml input.rdf 
Language 'RDF/XML' not registered for streaming. 
Streaming languages: 
TriX 
Turtle 
N-Quads 
RDF-THRIFT 
TriG 
N-Triples 
Non-streaming languages: 
RDF/JSON 
JSON-LD 
RDF/XML 

> Is there a way I can increase the heap size allocated to the JVM with a command line option? 

$ export JVM_ARGS=-Xmx1G # or whatever you want 
$ riot …. 

Damian 

-- 
Damian Steer 
Senior Technical Researcher 
Research IT 
+44 (0) 117 928 7057 

Re: Convert .ttl turtle format file into .rdf file

Posted by Damian Steer <d....@bris.ac.uk>.
> On 5 Aug 2015, at 15:30, Marko Pance <mp...@chemaxon.com> wrote:
> 
> Thanks for your response. I am using the riot utility successfully on smaller file sizes. But for large ones I get a " 
> 
> java.lang.OutOfMemoryError: GC overhead limit exceeded" error message.

I think you’re converting to rdf/xml? That doesn’t stream, so it will take memory.

You can use —stream <format> to ensure steaming:

$ bin/riot --stream rdfxml input.rdf
Language 'RDF/XML' not registered for streaming.
Streaming languages:
   TriX
   Turtle
   N-Quads
   RDF-THRIFT
   TriG
   N-Triples
Non-streaming languages:
   RDF/JSON
   JSON-LD
   RDF/XML

> Is there a way I can increase the heap size allocated to the JVM with a command line option? 

$ export JVM_ARGS=-Xmx1G # or whatever you want
$ riot ….

Damian

-- 
Damian Steer
Senior Technical Researcher
Research IT
+44 (0) 117 928 7057


Re: Convert .ttl turtle format file into .rdf file

Posted by Marko Pance <mp...@chemaxon.com>.
Thanks for your response. I am using the riot utility successfully on smaller file sizes. But for large ones I get a " 

java.lang.OutOfMemoryError: GC overhead limit exceeded" error message. Is there a way I can increase the heap size allocated to the JVM with a command line option? 




Best, 

Marko 


From: ajs6f@virginia.edu 
To: users@jena.apache.org 
Sent: Wednesday, August 5, 2015 2:35:33 PM 
Subject: Re: Convert .ttl turtle format file into .rdf file 

You can use the utility 'riot' for this: 

https://jena.apache.org/documentation/io/#command-line-tools 

--- 
A. Soroka 
The University of Virginia Library 

On Aug 5, 2015, at 8:28 AM, Marko Pance <mp...@chemaxon.com> wrote: 

> Hi... 
> 
> I have a .ttl file and I would like to use jena to convert it to an rdf file. Can you please advise on how to do so? Thanks! 

Re: Convert .ttl turtle format file into .rdf file

Posted by "ajs6f@virginia.edu" <aj...@virginia.edu>.
You can use the utility 'riot' for this:

https://jena.apache.org/documentation/io/#command-line-tools

---
A. Soroka
The University of Virginia Library

On Aug 5, 2015, at 8:28 AM, Marko Pance <mp...@chemaxon.com> wrote:

> Hi... 
> 
> I have a .ttl file and I would like to use jena to convert it to an rdf file. Can you please advise on how to do so? Thanks!