factsmission/psps

better handling of parsing errors

retog opened this issue · 0 comments

retog commented

When a file fails to parse, one gets something like:

4/15/2018 4:56:18 PMLoading RDF data from factsmission/psps.factsmission.org
4/15/2018 4:56:28 PM263709000 [jersey-server-managed-async-executor-4] ERROR org.apache.jena.riot - [line: 7, col: 14] Undefined prefix: s
4/15/2018 4:56:28 PMorg.apache.jena.riot.RiotException: [line: 7, col: 14] Undefined prefix: s
4/15/2018 4:56:28 PM	at org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:144)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.system.ParserProfileStd.expandPrefixedName(ParserProfileStd.java:245)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.system.ParserProfileStd.create(ParserProfileStd.java:184)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangTurtleBase.tokenAsNode(LangTurtleBase.java:498)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangTurtleBase.node(LangTurtleBase.java:343)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangTurtleBase.triplesNode(LangTurtleBase.java:368)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangTurtleBase.objectList(LangTurtleBase.java:351)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangTurtleBase.predicateObjectItem(LangTurtleBase.java:288)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangTurtleBase.predicateObjectList(LangTurtleBase.java:281)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangTurtleBase.triplesBlankNode(LangTurtleBase.java:422)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangTurtleBase.triplesBlankNode(LangTurtleBase.java:416)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangTurtleBase.triplesNodeCompound(LangTurtleBase.java:404)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(LangTurtleBase.java:201)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(LangTurtle.java:46)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtleBase.java:91)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:41)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.RDFParserRegistry$ReaderRIOTLang.read(RDFParserRegistry.java:199)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.RDFParser.read(RDFParser.java:298)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.RDFParser.parseNotUri(RDFParser.java:288)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.RDFParser.parse(RDFParser.java:237)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.RDFParserBuilder.parse(RDFParserBuilder.java:417)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.RDFDataMgr.parseFromInputStream(RDFDataMgr.java:870)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:268)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:254)
4/15/2018 4:56:28 PM	at org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:69)
4/15/2018 4:56:28 PM	at org.apache.jena.rdf.model.impl.ModelCom.read(ModelCom.java:305)
4/15/2018 4:56:28 PM	at org.apache.clerezza.rdf.jena.parser.JenaParserProvider.parse(JenaParserProvider.java:61)
4/15/2018 4:56:28 PM	at org.apache.clerezza.rdf.core.serializedform.Parser.parse(Parser.java:240)
4/15/2018 4:56:28 PM	at org.apache.clerezza.rdf.core.serializedform.Parser.parse(Parser.java:211)
4/15/2018 4:56:28 PM	at com.factsmission.psps.GetRepoGraph.loadStuffToGraph(GetRepoGraph.java:208)
4/15/2018 4:56:28 PM	at com.factsmission.psps.GetRepoGraph.processFile(GetRepoGraph.java:169)

It should at least tell the offending file.