简体   繁体   English

使用JENA在线阅读rdf文件

[英]read rdf file online using JENA

i have written this code for reading and rdf file online. 我已经在线编写了这个用于阅读和rdf文件的代码。 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? 有什么帮助吗?

Your URI does not point to a RDF resource, it's a HTML web page. 您的URI不指向RDF资源,它是一个HTML网页。 Try to use http://data.linkedmdb.org/data/film/1437 instead. 请尝试使用http://data.linkedmdb.org/data/film/1437

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. 我没有在上面的代码中发现任何错误尝试使用其他一些URI,如果它工作,那么问题是使用URI尝试使用URI: http//www.ivan-herman.net/foaf.rdf这是其中之一我发现在线工作的随机URI尝试使用它。 Or may be you are not explicitly specifying the rdf filename may be that. 或者可能是你没有明确指定rdf文件名可能是那个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM