Skip to content
This repository has been archived by the owner on Feb 5, 2020. It is now read-only.

Unhandled 'error' event #43

Closed
akuckartz opened this issue Oct 20, 2017 · 5 comments
Closed

Unhandled 'error' event #43

akuckartz opened this issue Oct 20, 2017 · 5 comments

Comments

@akuckartz
Copy link

Any suggestion what might be going wrong here? I am executing

$ ldf-client http://localhost:5000/dbpedia2015 "SELECT * { ?s ?p <http://dbpedia.org/resource/Belgium>. ?s ?p ?o } LIMIT 10"

and the result is:

[[Fri Oct 20 2017 21:28:38 GMT+0200 (CEST)] WARNING ReorderingGraphPatternIterator Unexpected "<http://commons.dbpedia.org/resource/File:2009_v\\u0113l\\u0113\\u0161anas_Jelgava.png>," on line 38.
[Fri Oct 20 2017 21:28:38 GMT+0200 (CEST)] WARNING ReorderingGraphPatternIterator Unexpected "<http://commons.dbpedia.org/resource/File:2009_v\\u0113l\\u0113\\u0161anas_Jelgava.png>," on line 38.
]
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: Unexpected "<http://dbpedia.org/resource/Citro\\u00EBn_Traction_Avant>" on line 36.
    at Object._syntaxError (/usr/local/lib/node_modules/ldf-client/node_modules/n3/lib/N3Lexer.js:360:12)
    at reportSyntaxError (/usr/local/lib/node_modules/ldf-client/node_modules/n3/lib/N3Lexer.js:327:54)
    at Object._tokenizeToEnd (/usr/local/lib/node_modules/ldf-client/node_modules/n3/lib/N3Lexer.js:313:18)
    at TrigFragmentIterator._parseData (/usr/local/lib/node_modules/ldf-client/node_modules/n3/lib/N3Lexer.js:395:16)
    at TrigFragmentIterator.TurtleFragmentIterator._transform (/usr/local/lib/node_modules/ldf-client/lib/triple-pattern-fragments/TurtleFragmentIterator.js:47:8)
    at readAndTransform (/usr/local/lib/node_modules/ldf-client/node_modules/asynciterator/asynciterator.js:959:12)
    at TrigFragmentIterator.TransformIterator._read (/usr/local/lib/node_modules/ldf-client/node_modules/asynciterator/asynciterator.js:945:3)
    at TrigFragmentIterator.BufferedIterator._fillBuffer (/usr/local/lib/node_modules/ldf-client/node_modules/asynciterator/asynciterator.js:768:10)
    at Immediate.fillBufferAsyncCallback (/usr/local/lib/node_modules/ldf-client/node_modules/asynciterator/asynciterator.js:800:8)
    at runCallback (timers.js:674:20)
@mielvds
Copy link
Contributor

mielvds commented Oct 20, 2017

The uri http://dbpedia.org/resource/Citro\\u00EBn_Traction_Avant is invalid. The error is because the server allows for invalid uris in its datasource, but the client doesn't. Fix your data in your datasource (probably HDT?) and everything will be fine

@RubenVerborgh shouldn't N3.js prevent you from serializing invalid URIs, since it doesn't parse them?

@RubenVerborgh
Copy link
Member

@akuckartz My bet is that a) this interface is using an HDT backend b) with an invalid HDT file that was generated without specifying -f turtle. The default parser of HDT was broken (and has since been removed).

@mielvds The problem is that the HDT module passes invalid IRIs to the writer. The N3.js parser, which would detect this, is never involved on the server (only on the client).

@akuckartz
Copy link
Author

akuckartz commented Oct 20, 2017

Thanks a lot for the quick replies!

So this HDT file I mentioned in LinkedDataFragments/Server.js#60 (comment) likely is broken: http://gaia.infor.uva.es/hdt/dbpedia2015.hdt.gz

@akuckartz
Copy link
Author

I seem to have stumbled upon errors in the HDT file resulting from these issues (when they still existed): rdfhdt/hdt-cpp#12 and rdfhdt/hdt-cpp#91

I think I should ask the maintainer of http://gaia.infor.uva.es/hdt/ to recreate the file.

@rubensworks
Copy link
Member

This project has now been deprecated in favor of Comunica, where this should not be a problem anymore. If it is, feel free to open a new issue there.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants