Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
对于以下代码:
Model m2=ModelFactory.createDefaultModel(); m2.read("Untitled.xml");
我得到错误:Exception in thread "main" com.hp.hpl.jena.shared.JenaException: java.net.MalformedURLException: no protocol: Untitled.xml
Exception in thread "main" com.hp.hpl.jena.shared.JenaException: java.net.MalformedURLException: no protocol: Untitled.xml
有人可以帮我吗?
它需要一个网址,请尝试m2.read(new File("Untitled.xml").toURL().toString());
m2.read(new File("Untitled.xml").toURL().toString());