linkeddata / rdflib.js

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

Store requestedURI as NamedNode #427

Closed michielbdejong closed 4 years ago

michielbdejong commented 4 years ago

This fixes a bug where https://github.com/linkeddata/rdflib.js/blob/master/src/fetcher.ts#L1600 would return zero results and the update manager would incorrectly end up at https://github.com/linkeddata/rdflib.js/blob/master/src/update-manager.ts#L593.

michielbdejong commented 4 years ago

Another option for fixing this would be to leave the storing code as it is (storing a literal), and then change the querying code to look for a literal that has the doc's URI as its value, but that felt less clean.

Not sure if there are other consideration or other places that depend on storing the requestedURI as a literal. I did find addType which seems to use a NamedNode for the requestedURI as a subject in a type triple.

michielbdejong commented 4 years ago

@timbl I made the changes you requested. Tested this using our new https://github.com/solid/mashlib-dev#debugging-rdflib-using-solid-pane-tester and it works. I'll interpret this as good to merge now, if someone knows of further improvements we can do them in follow-up.