Hello Andy, all, Adding -DLocationMap= In the "Edit custom VM options" in Intelij didn't help. I was actually not sure if this is the right place
However I was trying some other things and I found a good post here: https://www.oipapio.com/question-8593703 So adding import org.apache.jena.util.LocationMapper; and calling LocationMapper.setGlobalLocationMapper(new LocationMapper()); did the trick. Perhaps https://issues.apache.org/jira/browse/JENA-1775 could be updated Best regards -----Original Message----- From: Andy Seaborne <[email protected]> Sent: Tuesday, October 29, 2019 11:52 AM To: [email protected] Subject: Re: java.nio.file.InvalidPathException: Illegal char <:> at index 4: file:location-mapping.rdf file:location-mapping.rdf is a Jena system file. It's also an area of the code that has not changed for quite some time. I notice this is running Java13 on Windows. The project does run the core test suite on Java13 although on Linux. I would not be surprised if the rules for naming are tighten up in Java13. The error is from the Windows specific JRE code. From looking at the code: Setting the default places to look for the lcoation mapping file is controlled by system property "DLocationMap" (or "http://jena.hpl.hp.com/2004/08/LocationMap"). This might work: setting the java system property to the empty string. -DLocationMap= (or anything legal and not existing). sorry - I'm not in a position to recreate the setup just at the moment ... no Windows machine setup. If it works, please let us know. Andy On 29/10/2019 10:07, Dr. Chavdar Ivanov wrote: > I attached it in a text file > > -----Original Message----- > From: Lorenz Buehmann <[email protected]> > Sent: Tuesday, October 29, 2019 10:55 AM > To: [email protected] > Subject: Re: java.nio.file.InvalidPathException: Illegal char <:> at > index 4: file:location-mapping.rdf > > Seeing the whole stacktrace would be helpful > > On 29.10.19 10:35, Dr. Chavdar Ivanov wrote: >> Hello >> Thanks. I tried and I am getting the same problem In fact my file is >> stored here: C:\Users\chiva\Downloads\test.rdf and the output in the >> console of System.out.println(selectedFile); is >> C:\Users\chiva\Downloads\test.rdf >> >> Even if I do like this RDFDataMgr.read(model, new >> FileInputStream("C:\\Users\\chiva\\Downloads\\test.rdf" ), >> Lang.RDFXML); >> >> I still get: >> Caused by: java.nio.file.InvalidPathException: Illegal char <:> at >> index 4: file:location-mapping.rdf >> >> -----Original Message----- >> From: Lorenz Buehmann <[email protected]> >> Sent: Tuesday, October 29, 2019 10:23 AM >> To: [email protected] >> Subject: Re: java.nio.file.InvalidPathException: Illegal char <:> at >> index 4: file:location-mapping.rdf >> >> file:location-mapping.rdf is not a valid path in Java. Try Model model = >> ModelFactory.createDefaultModel(); RDFDataMgr.read(model, new >> FileInputStream(selectedFile), Lang.RDFXML); maybe this works. Or use the >> absolute path of the file object. >> >>> Hi >>> >>> I am trying to import rdf schema file (RDF/XML) but when I use this >>> code below I am getting the a lots of messages and I see this >>> java.nio.file.InvalidPathException: Illegal char <:> at index 4: >>> file:location-mapping.rdf >>> >>> I wonder if I need some specific setup or do I need to create >>> location-mapping.rdf? >>> >>> FileChooser filechooser = new FileChooser(); >>> filechooser.getExtensionFilters().addAll(new >>> FileChooser.ExtensionFilter("RDF files", "*.rdf")); File >>> selectedFile = filechooser.showOpenDialog(null); if (selectedFile != null) { >>> System.out.println(selectedFile); >>> Model model = >>> FileManager.get().loadModel(selectedFile.toString()); >>> >>> >>> In general what I would like to achieve is to be able to read rdf schema >>> file and also at later stage to read rdf xml instance data based on the >>> schema. >>> I tried to use RDFDataMgr and RDFParser to do the read, but I am kind of >>> hitting to the same “java.nio.file.InvalidPathException: Illegal char <:> >>> at index 4: file:location-mapping.rdf” which leads me to think that I am >>> missing something from the basic setup. I was looking at a lot of examples, >>> but somehow could not get oriented so far. >>> >>> Regards >>> Chavdar >>>
