inrupt / inrupt/solid-client-js

get thing of type

Open
#1,488 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Search terms you've used

getThing

Feature suggestion

Get a Thing not by iri but by type.
const bag = getThingOfType(ds, golf.classes.Bag)
const clubs = getThingAllOfType(ds, golf.classes.Club)

Expected functionality/enhancement

getThingOfType returns the first Thing of that type,
getThingAllOfType returns all Things of that type

Actual functionality/enhancement

at the moment you have to know the iri of the Thing to be able to get the Thing from the Dataset or you have to use getThingAll and filter the items by checking the type. If you have one Thing of type in the document this seems overly verbose. Also you don't always know the iri of the Thing: "https://test.inrupt.net/public/golf/data/clubs.ttl#164561119414735272867392814433"

Use Cases

load a list of Things, show those things in a UI, manipulate those Things

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 reading the existing getThing and getThingAll entry points and the dataset access APIs they use. Add type-based helpers that return the first matching Thing or all matching Things, then verify that the requested Bag and Club examples work when the Thing IRIs are unknown.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.