Create two Things in a SolidDataset with @inrupt/solid-client

I know how to create a Thing in a Dataset with @inrupt/solid-client, but i would like to create Another thing in the same dataset.
i havent found any add Thing

example :

ThingA type TypeA
ThingA uses ThingB
ThingB type TypeB
ThingB uses ThingC
...

perharps another for @zwifi ?

What have you tried so far? Feels like this should just work:

let dataset = createSolidDataset();

let thingB = createThing({ name: "ThingB" });
thingB = addUrl(thingB, rdf.type, "https://example.com/TypeB");

let thingA = createThing({ name: "thingA" });
thingA = addUrl(thingA, rdf.type, "https://example.com/TypeA");
thingA = addUrl(thingA, "https://example.com/uses", thingB);

dataset = setThing(dataset, thingA);
dataset = setThing(dataset, thingB);

(Edit: fixed ;.)

2 Likes

Thxs, it folks :wink:

just a typo https://example.com/uses with : instead of

1 Like