Are you a front-end developer, interested in Solid, but unfamiliar with Linked Data? Try Tripledoc

I need to create /root/index.ttl#this as a subject in a /root/year/month/day/chat.ttl doc

Hmm, Tripledoc doesn’t currently support subject identifiers that are not relative to the containing Document, unfortunately :frowning:

So while you’d be able to add a message to chat.ttl with a timestamp as ID, you cannot add a pointer from the root Document inside something other than the root Document:

const chatDoc = await fetchDocument('root/year/month/day/chat.ttl');
const conversation = chatDoc.addSubject({ identifier: 'Msg1555487418787' });
conversation.addDateTime(dct.created, new Date());
conversation.addString(sioc.content, "hi");
conversation.addRef(foaf.maker, "https://example.com/profile/card#me");
chatDoc.save([conversation]);

Well this is bad… As I must deal with two libs and two post, that throw two websocket notifications…
Either the libs can simply implement the specs, either the solid specs for Chat must be simplier…
Do you know if the last @inrupt/solid-client implement this index.ttl#this creation ?

Yes! So what Tripledoc calls a TripleSubject is called a Thing in solid-client, and you can choose to give it either an identifier or a full URL. Off the top of my head, the code snippet I posted above using solid-client (but including the back-reference) would look like this:

const chatDoc = await getSolidDataset('root/year/month/day/chat.ttl');
let conversation = createThing({ name: 'Msg1555487418787' });
conversation = addDateTime(conversation, dct.created, new Date());
conversation = addStringNoLocale(conversation, sioc.content, "hi");
conversation = addUrl(conversation, foaf.maker, "https://example.com/profile/card#me");

let backReference = createThing({ url: '/root/index.ttl#this' });
backReference = addUrl(backReference, flow.message, '/long-chat/2019/04/17/chat.ttl#Msg1555487418787');

let docToSave = setThing(chatDoc, conversation);
docToSave = setThing(chatDoc, backReference);

const updatedDoc = saveSolidDatasetAt('root/year/month/day/chat.ttl', docToSave);

Sorry that Tripledoc does not (currently) satisfy that use case; the Long Chat data layout is somewhat more convoluted than what I knew people did with RDF when it was written.

No worry, we all are here to learn and experiment… :blush: Thxs for all that good tools :+1::trophy: that let other focus on the functionalities