Skip to content

Term wrapper docs#59

Merged
langsamu merged 5 commits intomainfrom
term_wrapper_docs
Apr 13, 2026
Merged

Term wrapper docs#59
langsamu merged 5 commits intomainfrom
term_wrapper_docs

Conversation

@langsamu
Copy link
Copy Markdown
Collaborator

@langsamu langsamu commented Apr 9, 2026

image

@langsamu langsamu force-pushed the term_wrapper_docs branch from 5ceb959 to 90c99a8 Compare April 10, 2026 13:43
@langsamu langsamu marked this pull request as ready for review April 10, 2026 13:46
Comment thread src/TermWrapper.ts Outdated
Comment thread src/TermWrapper.ts
Comment thread src/TermWrapper.ts
* let dataset: DatasetCore
*
* // Our instance used as subject when matching statements in a dataset
* dataset.match(instance as Term)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Suggested change
* dataset.match(instance as Term)
* dataset.match(instance)

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@langsamu langsamu merged commit fd30984 into main Apr 13, 2026
11 checks passed
@langsamu langsamu deleted the term_wrapper_docs branch April 13, 2026 12:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants