Open megoth opened 4 years ago
Work in progress branch: https://github.com/linkeddata/rdflib.js/tree/typing-improvements-%23376
In general I prefer Store.add() to take anything anywhere to be safe. In N3 you can put a literal as the subject, bnodes as predicate, etc ... best to be liberal.
This is an issue where I'll note improvements that can be done to various typings.
graph(features, opts)
->graph(features = [], opts = {})
: Allows creation of with simplyconst store = graph()
Fetcher.delete(uri, options)
->Fetcher.delete(uri, options = {})
: Don't need to supply options all the timeStore.add
should allow string as third parameter (object, i.e. it should be interpreted as a Literal)NamedNode
for methods such asnamedNode
andsym
) are compatible with methods that have parameters that reflect these types.namedNode
st
Store.any
Store.canon
Store.each
Store.statementsMatching
sym
Fetcher.load
should be dependent on the type of the first parameter: If its an array, return an array of promises, if its a singular value, return a single promiseUpdateManager.editable(docUri, kb)
->UpdateManager.editable(docUri, kb?)
so that you don't have to supplykb
Probably more to come, I'll update this as I find them - propose that the one that fixes this strikes out the issues as they are fixed