Conversation
5ceb959 to
90c99a8
Compare
| * let dataset: DatasetCore | ||
| * | ||
| * // Our instance used as subject when matching statements in a dataset | ||
| * dataset.match(instance as Term) |
There was a problem hiding this comment.
Related to https://github.com/rdfjs/wrapper/pull/59/changes#r3069524679 -- does this mean the library actually requires type annotation; and that TermWrapper does not conform to type Term?
If so we should look at implementing TermWrapper so that it implements Term
| * dataset.match(instance as Term) | |
| * dataset.match(instance) |
There was a problem hiding this comment.
I would love a better mechanism than this.
I did try to make TermWrapper implements Term, but that is impossible vis-à-vis the TypeScript implementation of RDF/JS in @rdfjs/types, which is a union type of interfaces:
export type Term = NamedNode | BlankNode | Literal | Variable | DefaultGraph | BaseQuad;I'm not saying that anything is incompatible with the RDF/JS spec itself. But neither would I consider moving away from the official typings. It's worth too much in my opinion.
So I would leave this all as is here, and continue on #61, which goes further than I got towards TermWrapper truely being a Term.
There was a problem hiding this comment.
So I would leave this all as is here, and continue on #61, which goes further than I got towards TermWrapper truely being a Term.
+1
Co-authored-by: Jesse Wright <63333554+jeswr@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.