RDF java sample of freebase not working

1.3k views Asked by At

https://developers.google.com/freebase/v1/rdf-overview.

The java code gives the following error. Please let me know how to resolve this.

log4j:WARN No appenders could be found for logger (org.apache.http.impl.conn.BasicClientConnectionManager).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
org.apache.jena.riot.RiotException: [line: 190, col: 37] illegal escape sequence value: x (0x78)
    at org.apache.jena.riot.system.ErrorHandlerFactory$ErrorHandlerStd.fatal(ErrorHandlerFactory.java:132)
    at org.apache.jena.riot.lang.LangEngine.raiseException(LangEngine.java:169)
    at org.apache.jena.riot.lang.LangEngine.nextToken(LangEngine.java:116)
    at org.apache.jena.riot.lang.LangTurtleBase.predicateObjectItem(LangTurtleBase.java:299)
    at org.apache.jena.riot.lang.LangTurtleBase.predicateObjectList(LangTurtleBase.java:292)
    at org.apache.jena.riot.lang.LangTurtleBase.triples(LangTurtleBase.java:271)
    at org.apache.jena.riot.lang.LangTurtleBase.triplesSameSubject(LangTurtleBase.java:210)
    at org.apache.jena.riot.lang.LangTurtle.oneTopLevelElement(LangTurtle.java:47)
    at org.apache.jena.riot.lang.LangTurtleBase.runParser(LangTurtleBase.java:110)
    at org.apache.jena.riot.lang.LangBase.parse(LangBase.java:42)
    at org.apache.jena.riot.RDFParserRegistry$ReaderRIOTFactoryImpl$1.read(RDFParserRegistry.java:142)
    at org.apache.jena.riot.RDFDataMgr.process(RDFDataMgr.java:760)
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:258)
    at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:244)
    at org.apache.jena.riot.adapters.RDFReaderRIOT.read(RDFReaderRIOT.java:69)
    at com.hp.hpl.jena.rdf.model.impl.ModelCom.read(ModelCom.java:274)
    at holidayplanner.freebase.sample.RdfSample.main(RdfSample.java:32)
1

There are 1 answers

4
Tom Morris On

Did you look at the data on line 190 of https://www.googleapis.com/freebase/v1/rdf/m/02h40lc ?

ns:common.topic.alias    "Ingl\xeas"@pt;

It's not valid N3. http://www.w3.org/TeamSubmission/n3/#escaping

You'll need to pre-process the data into a valid form if you want RDF parsers to be able to deal with it. (And, of course, you should report the bug to Google as well).