Hi, I’ve got a method that eventally reaches a section like this:
const updatedDataset = removeThing(this.dataset, habit);
console.log(solidDatasetAsMarkdown(updatedDataset));
console.log(changeLogAsMarkdown(updatedDataset));
await saveSolidDatasetAt(getSourceUrl(this.dataset), updatedDataset, { fetch: this.session.fetch });
habit
here is a Thing retrieved from the dataset using getThing
. My dataset looks like this:
@prefix : <#>.
@prefix ex: <http://example.com/>.
@prefix ic: <http://www.w3.org/2002/12/cal/ical#>.
@prefix XML: <http://www.w3.org/2001/XMLSchema#>.
@prefix schem: <https://schema.org/>.
:161721840909105701640716636325
a ex:habit_itm;
ic:created "2021-03-31T19:20:09.091Z"^^XML:dateTime;
schem:text "Item 1".
:16172184128225402754458653447
a ex:habit_itm;
ic:created "2021-03-31T19:20:12.822Z"^^XML:dateTime;
schem:text "Item 2".
:161721841572814167595175896774
a ex:habit_itm;
ic:created "2021-03-31T19:20:15.728Z"^^XML:dateTime;
schem:text "Item 3".
My goal is to remove one of these, for instance Item 2. From my understanding, I need to provide the UrlString of Item 2 to removeThing and get back a new dataset that has everything except Item 2. I check this by logging the markdown of the new dataset and its changes, and confirm that it has worked:
solidDatasetAsMarkdown
SolidDataset: https://etscevhq.inrupt.net/habits2/index.ttl
Thing: https://etscevhq.inrupt.net/habits2/index.ttl#161721840909105701640716636325
Property: http://www.w3.org/1999/02/22-rdf-syntax-ns#type
- <
http://example.com/habit_itm>
(URL)
Property: http://www.w3.org/2002/12/cal/ical#created
- Wed, 31 Mar 2021 19:20:09 GMT (datetime)
Property: https://schema.org/text
- “Item 1” (string)
(0 new values added / 0 values removed)
Thing: https://etscevhq.inrupt.net/habits2/index.ttl#161721841572814167595175896774
Property: http://www.w3.org/1999/02/22-rdf-syntax-ns#type
- <
http://example.com/habit_itm>
(URL)
Property: http://www.w3.org/2002/12/cal/ical#created
- Wed, 31 Mar 2021 19:20:15 GMT (datetime)
Property: https://schema.org/text
- “Item 3” (string)
(0 new values added / 0 values removed)
changeLogAsMarkdown
Changes compared to https://etscevhq.inrupt.net/habits2/index.ttl
Thing: https://etscevhq.inrupt.net/habits2/index.ttl#16172184128225402754458653447
Property: http://www.w3.org/1999/02/22-rdf-syntax-ns#type
- Removed:
- <
http://example.com/habit_itm>
(URL)
- <
Property: http://www.w3.org/2002/12/cal/ical#created
- Removed:
- Wed, 31 Mar 2021 19:20:12 GMT (datetime)
Property: https://schema.org/text
- Removed:
- “Item 2” (string)
Perfect! Now I just need to run saveSolidDatasetAt
to save this, right? Apparently not…
I am new to Solid, is there something that I am missing?