linkeddata / rdflib.js

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

This fixes #526 by recursively parsing all nested `@graph` arrays. #527

Closed RinkeHoekstra closed 2 years ago

RinkeHoekstra commented 2 years ago

Added a processResource function that determines whether the resource is a triple statement, or a graph.

If it's a graph, it will use the graph's identifier as the new base for any statements contained in the graph's array.

These statements are processed by recursively calling the processResource function again.

bourgeoa commented 2 years ago

Thanks for the PR could you add a serialize test or modify the existing one test:serialize:9

RinkeHoekstra commented 2 years ago

Thanks @bourgeoa for your quick reaction! I have only touched the parser code, not the serialization. How is this related to test:serialize:9?

bourgeoa commented 2 years ago

Sorry not being an expert. Seeing the use cases it seems to be the way to compare data output with input. So it is an integrated test to check that parser and serialisation are working together correctly. Actually we can see there are no regression, but not that all inputs from your code can be serialised.

If you have better/other way please do.