inrupt / inrupt/solid-client-js

setThing not creating blank nodes included within a Thing

Open
#1,544 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
245
Forks
42
Avg merge
12h 49m
Merged PRs (30d)
22

Description

I am experiencing issues with setThing ignoring blankNodes entirely. The internal dataset changelog will have no quads for the blank node. This seems to be expected behavior according to this line;
https://github.com/inrupt/solid-client-js/blob/main/src/thing/thing.internal.ts#L121
which removes them from the "additions". Removing this filter fixes the issue without any failed tests, so I am not sure why it is being used?

I've created a unit test in this fork:
https://github.com/Maximvdw/solid-client-js/commit/d2227cf33cbebc47bd80db075d3dc07fb6f9ca74

The unit test creates a mock object:

const mockThing3: ThingPersisted = {
    type: "Subject",
    url: mockThing3Iri,
    predicates: {
      ["https://arbitrary.vocab/predicate"]: {
        namedNodes: ["https://arbitrary.vocab/object"],
        blankNodes: [
          {
            ["https://arbitrary.vocab/blanknode/predicate"]: {
              namedNodes: ["https://arbitrary.vocab/blanknode/object"],
            },
          },
        ],
      },
    },
  };

When using setThing only one quad will be added (the named node) which is verified
with the test line at https://github.com/Maximvdw/solid-client-js/commit/d2227cf33cbebc47bd80db075d3dc07fb6f9ca74#diff-b64c1976153ad9380bdd23fab11663989148669f7f2e99cbd3faf7342a687b34R600

Is this intended behavior for setThing?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at setThing and inspect the additions filter in src/thing/thing.internal.ts around line 121. Review the linked unit test commit and its blank-node fixture, then run the relevant tests to confirm whether setThing should add quads for nested blank nodes as well as the named node.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.