0

i'm trying to understand how to load firstly, and then read into RDF file in N-Turtle format. I'm using Jena Java APIs (https://jena.apache.org/index.html).

I'm trying with this Java code:

Model model = ModelFactory.createDefaultModel(); 
FileInputStream inputStream = null;
try {
    inputStream = new FileInputStream("path_in_my_pc");
    } catch (FileNotFoundException e) {} 

I have to research a word into the RDF file, and print the results that match.

I was thinking to save the RDF N-Turtle into a string, and then, using some String method to find what I need. Is there other method to do this?

It would be also useful understand how to iterate all the RDF file and print the entire document.

Thank you for the help.

Jackie
  • 15
  • 5

1 Answers1

0

There's no format called N-Turtle. There are N3, Turtle, and N-Triples. N3 and Turtle are more or less interchangeable (they're not actually the same, but most of the time, when people say N3, they actually mean Turtle). For reading from Turtle, the answer to

should work for you. For N-Triples,

can work. Also have a look at

Community
  • 1
  • 1
Joshua Taylor
  • 84,998
  • 9
  • 154
  • 353