0

i have written this code for reading and rdf file online. but it doesn't work

final String uri = "http://data.linkedmdb.org/page/film/1437";
final Model model = ModelFactory.createDefaultModel();
model.read(uri);
model.write(System.out);

Any help please?

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

2 Answers2

2

Your URI does not point to a RDF resource, it's a HTML web page. Try to use http://data.linkedmdb.org/data/film/1437 instead.

loopasam
  • 3,027
  • 2
  • 21
  • 22
0

I am not finding any error in the above code try with some other URI if that is working then the problem is with the URI try with the URI: http://www.ivan-herman.net/foaf.rdf this is one of the random URI I found on-line working try with it. Or may be you are not explicitly specifying the rdf filename may be that.

Vinod
  • 61
  • 3