scify / jedai-ui

UI for JedAI Toolkit
http://jedai.scify.org
Apache License 2.0
16 stars 5 forks source link

Groundtruth reader can't read from directory with empty spaces #6

Closed GabrielePisciotta closed 6 years ago

GabrielePisciotta commented 6 years ago

The groundtruth reader doesn't handle the exception below raised by Jena. It occurs when you try to read a file in a directory with spaces in the name (es: /gabriele/ t e s t/)

Caused by: org.apache.jena.riot.RiotException: <file:///media/gabriele/dataset/t e s t/refalign.rdf> Code: 17/WHITESPACE in PATH: A single whitespace character. These match no grammar rules of URIs/IRIs. These characters are permitted in RDF URI References, XML system identifiers, and XML Schema anyURIs.
    at org.apache.jena.riot.system.IRIResolver.exceptions(IRIResolver.java:374)
    at org.apache.jena.riot.system.IRIResolver.resolve(IRIResolver.java:331)
    at org.apache.jena.riot.system.IRIResolver$IRIResolverSync.resolve(IRIResolver.java:492)
    at org.apache.jena.riot.system.IRIResolver.resolveIRI(IRIResolver.java:254)
    at org.apache.jena.riot.system.IRIResolver.resolveString(IRIResolver.java:233)
    at org.apache.jena.riot.SysRIOT.chooseBaseIRI(SysRIOT.java:89)
    at org.apache.jena.riot.lang.RiotParsers.baseURI_RDFXML(RiotParsers.java:133)
    at org.apache.jena.riot.lang.RiotParsers.createParserRDFXML(RiotParsers.java:111)
    at org.apache.jena.riot.lang.RiotParsers.createParser(RiotParsers.java:61)
    at org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:174)
    at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:861)
    at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:667)
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:212)
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:105)
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:96)
    at org.apache.jena.riot.RDFDataMgr.loadModel(RDFDataMgr.java:325)
    at org.scify.jedai.datareader.groundtruthreader.GtRDFReader.performReading(GtRDFReader.java:219)
    at org.scify.jedai.datareader.groundtruthreader.GtRDFReader.getDuplicatePairs(GtRDFReader.java:92)
    at org.scify.jedai.datareader.groundtruthreader.AbstractGtReader.getDuplicatePairs(AbstractGtReader.java:58)
    at org.scify.jedai.gui.utilities.DataReader.getGroundTruth(DataReader.java:171)
    at org.scify.jedai.gui.controllers.steps.DataReadingController.exploreGroundTruth(DataReadingController.java:289)
    ... 58 more
leots commented 6 years ago

Hi Gabriele, I made it catch the exception and show its message in a popup. I couldn't reproduce the exact same error, but I was also getting a RiotException on Windows, just with a different message than yours, so it should catch both.

Thanks for reporting this!