pietercolpaert / hardf

Low level PHP library for RDF1.1 based on N3.js
https://packagist.org/packages/pietercolpaert/hardf
MIT License
36 stars 7 forks source link

TriGParser: distinguish empty entities from no-entity being read #42

Closed zozlak closed 8 months ago

zozlak commented 8 months ago

Solves the #37 by throwing an informative exception describing why the parsing can not be done without the document base IRI being set.

zozlak commented 8 months ago

See https://github.com/pietercolpaert/hardf/issues/37#issuecomment-1967174143

What is your (@k00ni, @pietercolpaert ) preferred way to deal with that?

I can either adjust the parser to consistently return empty subject/predicate/object on "diamonds" (<>) without the base IRI set (it is only a matter of turning comparisons like this one into type-strict ones) or I can adjust the failing test to expect the "please set the documentIRI" exception.

pietercolpaert commented 8 months ago

Adjusting the test to expect an exception takes my preference