inrupt / inrupt/solid-client-js

`getThing` should support `name` as well as `url` like `createThing` does

Open
#1,511 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Search terms you've used

getThing

Feature suggestion

I find myself creating named Things a lot, and relying on the client / server to set the base url to match a given resource when I save the resource. However, when I go to get those Things back out of the dataset, I can no longer solely use the name, I have to also use the base url to construct the full URL identifier for that Thing.

I often pass datasets around the code, and want to refer to Things in that dataset by name without also having to keep track of where that dataset was from. While I could do it myself using getSourceUrl, it seems like the SolidDataset should also have the information to just accept a string and do that conversion for me.

Expected functionality/enhancement

getThing can be called with either the name relative to the base IRI of the dataset, or the full url

getThing(dataset, "name")) === getThing(dataset,`${getSourceUrl(dataset)}#name`)

I would be happy to implement this if there is support for it, but it seems like it might be a controversial API choice, so wanted to open the issue to chat about it first. Personally, I think for pure feature parity, if createThing supports name, then getThing should as well.

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 by locating the getThing, createThing, and getSourceUrl entry points in the TypeScript library and compare how they handle names and full URLs. Confirm the expected behavior with the issue's equality example, then add coverage showing that a relative name resolves against the dataset base IRI while a full URL continues to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Feature
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.