How can I use Sesame RDFXMLParser in JRuby?

I am not very good at Java and JRuby, but I need to parse RDF data using Sesame RDFXMLParser in JRuby and my python-minded brain just doesn't want to penetrate it. I have problems translating a Java example into JRuby. At first I don’t know how to define RDFHandler so that it makes sense. I also don't understand why parsing methods need a Reader and a URI, as I only want to parse the local file.

I really appreciate the sample code in JRuby. Many thanks!

+3
source share
1 answer

I cannot help you with a specific part of JRuby of your question, but as for your perplexity in how to call the method parse(): if you only want to parse the local file, you usually do this by simply creating an object java.io.FileInputstreamfor your file and providing it to the parser.

+1
source

Source: https://habr.com/ru/post/1709839/


All Articles