linkeddata / rdflib.js

Linked Data API for JavaScript
http://linkeddata.github.io/rdflib.js/doc/
Other
562 stars 142 forks source link

Can't store N3 triple with subject formula because of incompatible isSubject #567

Open RubenVerborgh opened 1 year ago

RubenVerborgh commented 1 year ago

The document at https://drive.verborgh.org/tmp/2022/cha-58-direct.n3 causes problems when read/written in a Solid Pod via Mashlib, with the following error:

Outline.expand: Unable to fetch <https://drive.verborgh.org/tmp/2022/cha-58-direct.n3>: Failed to load  <https://drive.verborgh.org/tmp/2022/cha-58-direct.n3> Fetcher: Error trying to parse <https://drive.verborgh.org/tmp/2022/cha-58-direct.n3> as Notation3:
Error: Subject is not a subject type status: 200

The Subject is not a subject is thrown by src/store.ts, which uses an isSubject call that checks for NamedNodeTermType/VariableTermType/BlankNodeTermType.

So either rdflib needs to be adjusted to output RDF/JS-compatible Notation3 subjects (which is what N3.js does), or the isSubject check needs to be adjusted when working with Notation3.

bourgeoa commented 1 year ago

So either rdflib needs to be adjusted to output RDF/JS-compatible Notation3 subjects (which is what N3.js does), or the isSubject check needs to be adjusted when working with Notation3.

@timbl Can you help with this I don't understand what is missing in isSubject call