Skip to content

Conversation

@tgra
Copy link
Member

@tgra tgra commented Feb 9, 2026

need advice on this -

get roles(): Iterable {
return this.objects(ORG.member, Role)
}
Expected 3 arguments, but got 2.ts(2554)
TermWrapper.d.ts(12, 68): An argument for 'termMapping' was not provided

reference - https://github.com/SolidOS/profile-pane/blob/main/src/ontology/profileForm.ttl

@matthieubosquet
Copy link
Member

@tgra I'm at a conference, so not necessarily gonna manage to get to this today.
Don't hesitate to look into it and try to debug.
The code should be self explanatory.

A cursory look at your comment indicates that the problem is probably with Role not being properly defined as a TermWrapper.

Copy link
Contributor

@langsamu langsamu left a comment

Choose a reason for hiding this comment

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

I would appreciate more consistent whitespace style without superfluous empty lines and other comments from #7.

/* Roles (inverse org:member) */

get roles(): Iterable<Role> {
return this.objects(ORG.member, Role)
Copy link
Contributor

Choose a reason for hiding this comment

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

need advice on this -

get roles(): Iterable {
return this.objects(ORG.member, Role)
}
Expected 3 arguments, but got 2.ts(2554)
TermWrapper.d.ts(12, 68): An argument for 'termMapping' was not provided

The method objects indeed requires 3 arguments.
https://github.com/theodi/wrapper/blob/a058232fd9d8076215b9c7dc03dd20e83a88652b/src/TermWrapper.ts#L36-L38

  1. a string that is the predicate
  2. a ValueMapping that converts from a Term into some native type
  3. a TermMapping that converts from some native type into a Term

Since you want to expose a set of roles, we need to facilitate transformations in both directions (from term to value and from value to term). These are the two arguments.

Copy link
Contributor

Choose a reason for hiding this comment

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


/* Roles (inverse org:member) */

get roles(): Iterable<Role> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Typing this property as Iterable will make it immutable in TypeScript.
But the this.objects utility returns a Set<T> which is mutable.
Yours is valid modelling, but I imagine that the intent would be to expose the mutable set.

Suggested change
get roles(): Iterable<Role> {
get roles(): Set<Role> {

export class ProfileDataset extends DatasetWrapper {

get profile(): Iterable<Profile> {
return this.instancesOf(FOAF.PersonalProfileDocument, Profile)
Copy link
Contributor

Choose a reason for hiding this comment

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

Picking the profile node (term) out of the graph based on the a foaf:PersonalProfileDocument statement alone is optimistic to say the least.

I strongly recommend looking into how WebID profile graphs are shaped in the various Solid server implementations and other places.

Some related discussion in https://github.com/solid/object/blob/main/src/webid/WebIdDataset.ts

Copy link
Contributor

Choose a reason for hiding this comment

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

How does this relate to the existing classes in this folder?

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