N3.js icon indicating copy to clipboard operation
N3.js copied to clipboard

Notation3: Cannot parse Resource Paths

Open tpluscode opened this issue 1 year ago • 4 comments

I use eye to process rules which use shorthand resource paths.

For example,

"Some message"^log:trace .

This would be equivalent to

[] log:trace "Some message" .

n3.js fails with error message Expected entity but got . on line 1.

tpluscode avatar Mar 10 '25 13:03 tpluscode

Update: looks like resource paths are not supported at all?

tpluscode avatar Mar 10 '25 14:03 tpluscode

Please see requested sanity check in #509

jeswr avatar Mar 10 '25 14:03 jeswr

If anyone is looking to pick this up - I'm fairly sure paths are supported but buggy on some cases such as lists. There was work some work done to fix this in https://github.com/rdfjs/N3.js/pull/341, specifically https://github.com/rdfjs/N3.js/commit/be1bcd92059f02b4b9e03421be783844a178eb96

jeswr avatar Mar 12 '25 23:03 jeswr

paths are supported but buggy on some cases such as lists.

Yeah, I seem to recall that currently N3Parser has paths working fine for IRIs/prefixed names, but - as you say - they're not currently implemented after lists... and also not after literals. (I have recently ported some of the N3.js code, so some of it is still fairly fresh in my memory)

This might be due to Notation3 spec changes since the original implementation of N3Parser's N3 support? Although I seem to recall previous specs were somewhat inexact in places, so it's difficult to be certain. It may just have been overlooked.

jimsmart avatar Mar 16 '25 17:03 jimsmart