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
>>
"C:\Program Files\Java\jdk-13\bin\java.exe" --add-modules 
javafx.base,javafx.graphics --add-reads javafx.base=ALL-UNNAMED --add-reads 
javafx.graphics=ALL-UNNAMED "-javaagent:C:\Program Files\JetBrains\IntelliJ 
IDEA Community Edition 193.4778.7\lib\idea_rt.jar=51975:C:\Program 
Files\JetBrains\IntelliJ IDEA Community Edition 193.4778.7\bin" 
-Dfile.encoding=UTF-8 -p 
C:\Users\chiva\.m2\repository\org\openjfx\javafx-base\13.0.1\javafx-base-13.0.1-win.jar;C:\Users\chiva\.m2\repository\org\openjfx\javafx-graphics\13.0.1\javafx-graphics-13.0.1-win.jar;C:\Users\chiva\IdeaProjects\testMaven\target\classes;C:\Users\chiva\.m2\repository\org\openjfx\javafx-controls\13.0.1\javafx-controls-13.0.1.jar;C:\Users\chiva\.m2\repository\org\openjfx\javafx-controls\13.0.1\javafx-controls-13.0.1-win.jar;C:\Users\chiva\.m2\repository\org\openjfx\javafx-graphics\13.0.1\javafx-graphics-13.0.1.jar;C:\Users\chiva\.m2\repository\org\openjfx\javafx-base\13.0.1\javafx-base-13.0.1.jar;C:\Users\chiva\.m2\repository\org\openjfx\javafx-fxml\13.0.1\javafx-fxml-13.0.1.jar;C:\Users\chiva\.m2\repository\org\openjfx\javafx-fxml\13.0.1\javafx-fxml-13.0.1-win.jar;C:\Users\chiva\.m2\repository\org\openjfx\javafx-web\13.0.1\javafx-web-13.0.1.jar;C:\Users\chiva\.m2\repository\org\openjfx\javafx-web\13.0.1\javafx-web-13.0.1-win.jar;C:\Users\chiva\.m2\repository\org\openjfx\javafx-media\13.0.1\javafx-media-13.0.1.jar;C:\Users\chiva\.m2\repository\org\openjfx\javafx-media\13.0.1\javafx-media-13.0.1-win.jar;C:\Users\chiva\.m2\repository\org\openjfx\javafx-swing\13.0.1\javafx-swing-13.0.1.jar;C:\Users\chiva\.m2\repository\org\openjfx\javafx-swing\13.0.1\javafx-swing-13.0.1-win.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-shacl\3.13.1\jena-shacl-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-tdb\3.13.1\jena-tdb-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-tdb2\3.13.1\jena-tdb2-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-dboe-storage\3.13.1\jena-dboe-storage-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-dboe-trans-data\3.13.1\jena-dboe-trans-data-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-dboe-transaction\3.13.1\jena-dboe-transaction-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-dboe-base\3.13.1\jena-dboe-base-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-dboe-index\3.13.1\jena-dboe-index-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-rdfconnection\3.13.1\jena-rdfconnection-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-csv\3.9.0\jena-csv-3.9.0.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-arq\3.13.1\jena-arq-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-shaded-guava\3.13.1\jena-shaded-guava-3.13.1.jar;C:\Users\chiva\.m2\repository\com\github\jsonld-java\jsonld-java\0.12.5\jsonld-java-0.12.5.jar;C:\Users\chiva\.m2\repository\commons-io\commons-io\2.6\commons-io-2.6.jar;C:\Users\chiva\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.10\jackson-core-2.9.10.jar;C:\Users\chiva\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.10\jackson-databind-2.9.10.jar;C:\Users\chiva\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.10\jackson-annotations-2.9.10.jar;C:\Users\chiva\.m2\repository\org\apache\httpcomponents\httpclient-cache\4.5.10\httpclient-cache-4.5.10.jar;C:\Users\chiva\.m2\repository\org\apache\thrift\libthrift\0.12.0\libthrift-0.12.0.jar;C:\Users\chiva\.m2\repository\org\apache\commons\commons-lang3\3.9\commons-lang3-3.9.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-cmds\3.13.1\jena-cmds-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-core\3.13.1\jena-core-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-iri\3.13.1\jena-iri-3.13.1.jar;C:\Users\chiva\.m2\repository\commons-cli\commons-cli\1.4\commons-cli-1.4.jar;C:\Users\chiva\.m2\repository\commons-codec\commons-codec\1.13\commons-codec-1.13.jar;C:\Users\chiva\.m2\repository\org\apache\jena\jena-base\3.13.1\jena-base-3.13.1.jar;C:\Users\chiva\.m2\repository\org\apache\commons\commons-csv\1.7\commons-csv-1.7.jar;C:\Users\chiva\.m2\repository\org\apache\commons\commons-compress\1.19\commons-compress-1.19.jar;C:\Users\chiva\.m2\repository\com\github\andrewoma\dexx\collection\0.7\collection-0.7.jar;C:\Users\chiva\.m2\repository\org\slf4j\slf4j-api\2.0.0-alpha1\slf4j-api-2.0.0-alpha1.jar;C:\Users\chiva\.m2\repository\org\slf4j\slf4j-nop\2.0.0-alpha1\slf4j-nop-2.0.0-alpha1.jar
 -m testMaven/application.mainApp
C:\Users\chiva\Downloads\test.rdf
Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException
        at 
javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1787)
        at 
javafx.fxml/javafx.fxml.FXMLLoader$ControllerMethodEventHandler.handle(FXMLLoader.java:1670)
        at 
javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
        at 
javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
        at 
javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at 
javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at 
javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at 
javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at 
javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at 
javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at 
javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at 
javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at 
javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at 
javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
        at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
        at javafx.graphics/javafx.scene.Node.fireEvent(Node.java:8890)
        at javafx.controls/javafx.scene.control.Button.fire(Button.java:203)
        at 
javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:206)
        at 
javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274)
        at 
javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218)
        at 
javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80)
        at 
javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238)
        at 
javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
        at 
javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59)
        at 
javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
        at 
javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at 
javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at 
javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at 
javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56)
        at 
javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
        at 
javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
        at 
javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54)
        at javafx.base/javafx.event.Event.fireEvent(Event.java:198)
        at 
javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3862)
        at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1849)
        at 
javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2590)
        at 
javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:409)
        at 
javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:299)
        at 
java.base/java.security.AccessController.doPrivileged(AccessController.java:391)
        at 
javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:447)
        at 
javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:412)
        at 
javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:446)
        at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556)
        at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942)
        at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native 
Method)
        at 
javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
        at java.base/java.lang.Thread.run(Thread.java:830)
Caused by: java.lang.reflect.InvocationTargetException
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at com.sun.javafx.reflect.Trampoline.invoke(MethodUtil.java:76)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:567)
        at 
javafx.base/com.sun.javafx.reflect.MethodUtil.invoke(MethodUtil.java:273)
        at 
javafx.fxml/com.sun.javafx.fxml.MethodHelper.invoke(MethodHelper.java:83)
        at 
javafx.fxml/javafx.fxml.FXMLLoader$MethodHandler.invoke(FXMLLoader.java:1782)
        ... 46 more
Caused by: java.lang.ExceptionInInitializerError
        at 
testMaven/application.guiController.actionButton(guiController.java:29)
        ... 58 more
Caused by: java.nio.file.InvalidPathException: Illegal char <:> at index 4: 
file:location-mapping.rdf
        at 
java.base/sun.nio.fs.WindowsPathParser.normalize(WindowsPathParser.java:182)
        at 
java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:153)
        at 
java.base/sun.nio.fs.WindowsPathParser.parse(WindowsPathParser.java:77)
        at java.base/sun.nio.fs.WindowsPath.parse(WindowsPath.java:92)
        at 
java.base/sun.nio.fs.WindowsFileSystem.getPath(WindowsFileSystem.java:229)
        at 
java.base/jdk.internal.module.Resources.toSafeFilePath(Resources.java:143)
        at java.base/jdk.internal.module.Resources.toFilePath(Resources.java:97)
        at 
java.base/jdk.internal.module.ModuleReferences$ExplodedModuleReader.find(ModuleReferences.java:382)
        at 
java.base/jdk.internal.loader.BuiltinClassLoader$2.run(BuiltinClassLoader.java:430)
        at 
java.base/jdk.internal.loader.BuiltinClassLoader$2.run(BuiltinClassLoader.java:425)
        at 
java.base/java.security.AccessController.doPrivileged(AccessController.java:554)
        at 
java.base/jdk.internal.loader.BuiltinClassLoader.findMiscResource(BuiltinClassLoader.java:424)
        at 
java.base/jdk.internal.loader.BuiltinClassLoader.findResource(BuiltinClassLoader.java:311)
        at java.base/java.lang.ClassLoader.getResource(ClassLoader.java:1400)
        at 
java.base/java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1736)
        at 
[email protected]/org.apache.jena.util.LocatorClassLoader.open(LocatorClassLoader.java:63)
        at 
[email protected]/org.apache.jena.util.FileManager.openNoMapOrNull(FileManager.java:523)
        at 
[email protected]/org.apache.jena.util.FileManager.openNoMap(FileManager.java:506)
        at 
[email protected]/org.apache.jena.util.LocationMapper.initFromPath(LocationMapper.java:141)
        at 
[email protected]/org.apache.jena.util.LocationMapper.get(LocationMapper.java:70)
        at 
[email protected]/org.apache.jena.util.FileManager.makeGlobal(FileManager.java:130)
        at 
[email protected]/org.apache.jena.util.FileManager.get(FileManager.java:96)
        at 
[email protected]/org.apache.jena.riot.system.IO_JenaReaders.wireIntoJena(IO_JenaReaders.java:40)
        at 
[email protected]/org.apache.jena.riot.IO_Jena.wireIntoJena(IO_Jena.java:34)
        at 
[email protected]/org.apache.jena.riot.RIOT.init(RIOT.java:79)
        at 
[email protected]/org.apache.jena.riot.system.InitRIOT.start(InitRIOT.java:29)
        at 
[email protected]/org.apache.jena.sys.JenaSystem.lambda$init$2(JenaSystem.java:117)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1507)
        at 
[email protected]/org.apache.jena.sys.JenaSystem.forEach(JenaSystem.java:192)
        at 
[email protected]/org.apache.jena.sys.JenaSystem.forEach(JenaSystem.java:169)
        at 
[email protected]/org.apache.jena.sys.JenaSystem.init(JenaSystem.java:115)
        at 
[email protected]/org.apache.jena.rdf.model.ModelFactory.<clinit>(ModelFactory.java:49)
        ... 59 more

Reply via email to