RubenVerborgh / SPARQL.js

A parser for the SPARQL query language in JavaScript
Other
342 stars 66 forks source link

URI schemes containing digits cause parse error #176

Closed balhoff closed 1 month ago

balhoff commented 1 month ago

I have some RDF data autoconverted from a Neo4j database. It creates URIs using a neo4j:// scheme like this:

<neo4j://graph.individuals#n4ind:389638>  <neo4j://graph.schema#knows>  <neo4j://graph.individuals#145613> .

Using this data with Comunica throws an error in SPARQL query parsing:

Cannot resolve relative IRI neo4j://graph.individuals#105029 because no base IRI was set.

It looks like this is caused by the regex here: https://github.com/RubenVerborgh/SPARQL.js/blob/ebde86c4bbc52ee1356f10f9c539a30441c8af1d/lib/sparql.jison#L60

which only allows letters. I haven't found anything that says a scheme can't contain a digit, and Wikipedia also mentions s3:// as a commonly used scheme.