Importing rdf/xml in Apache Jena: Lower case preferred exception
java, jena, rdf
Solution
The problem is that it's expecting a URI, not a file name. It's treating C:... as an (unknown) URI scheme 'C'.
Try the following instead:
Path input = Paths.get("C:\Users\Admin\Documents", "foaf.rdf");
Model model = ModelFactory.createDefaultModel() ;
model.read(input.toUri().toString(), "RDF/XML") ;
Problem
I'm trying to import an RDF/XML file with Apache Jena using the following code from the tutorial: ``` Path input = Paths.get("C:\Users\Admin\Documents"); Model model = ModelFactory.createDefaultModel() ; model.read(input+File.separator+"foaf.rdf", "RDF/XML") ; ``` The file being imported is here. When I run the test code, the following exception is returned: ``` Exception in thread "main" org.apache.jena.riot.RiotException: <C:\Users\Admin\Documents\foaf.rdf> Code: 11/LOWERCASE_PREFERRED in SCHEME: lowercase is preferred in this component ``` The message is really useful and self-explanatory! However, do you have a solution to this problem?