Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect parsing of a list containing a Notation3 graph term #357

Open
phochste opened this issue Jun 19, 2023 · 1 comment
Open

Incorrect parsing of a list containing a Notation3 graph term #357

phochste opened this issue Jun 19, 2023 · 1 comment

Comments

@phochste
Copy link

phochste commented Jun 19, 2023

The current 1.16.4 N3 parser doesn't handle lists containing Notation3 graph terms well:

This Notation3 document:

@prefix : <urn:example:> .

:s a ({ :a :b :c}) .

is parsed as:

Quad {
  id: '',
  _subject: NamedNode { id: 'urn:example:a' },
  _predicate: NamedNode { id: 'urn:example:b' },
  _object: NamedNode { id: 'urn:example:c' },
  _graph: BlankNode { id: '_:n3-0' }
}
Quad {
  id: '',
  _subject: NamedNode { id: 'urn:example:s' },
  _predicate: NamedNode { id: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' },
  _object: NamedNode { id: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil' },
  _graph: DefaultGraph { id: '' }
}
@phochste
Copy link
Author

phochste commented Jun 22, 2023

One of the problems is that starting a new formula escapes the correct initialization of the list at this line https://github.com/rdfjs/N3.js/blob/main/src/N3Parser.js#L475 and thus never sees the lines 481 to 509 which are required for this initialization.

One other problem is that I don't see any logic to turn the blank node of the graph term into a list item.

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

No branches or pull requests

1 participant