Skip to content

Commit 9867f96

Browse files
authored
Merge pull request #47 from bourgeoa/edit-chat-shape
Edit chat shape to include longchat
2 parents 1413007 + 6d09696 commit 9867f96

1 file changed

Lines changed: 281 additions & 9 deletions

File tree

shapes/chat.ttl

Lines changed: 281 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@
99
@prefix sioc: <http://rdfs.org/sioc/ns#> .
1010
@prefix solid: <http://www.w3.org/ns/solid/terms#> .
1111
@prefix terms: <http://purl.org/dc/terms/> .
12+
@prefix sec: <https://w3id.org/security#> .
1213
@prefix ui: <http://www.w3.org/ns/ui#> .
1314
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
1415
@prefix schema: <https://schema.org/> .
16+
@prefix schema_http: <http://schema.org/> .
1517
@prefix dct: <http://purl.org/dc/terms/> .
1618
@prefix vs: <http://www.w3.org/2003/06/sw-vocab-status/ns#> .
1719
@prefix prov: <http://www.w3.org/ns/prov#> .
@@ -126,13 +128,6 @@ chat_shape:chatmessageshape_content a sh:PropertyShape ;
126128
sh:description "The textual content of the message." ;
127129
sh:codeIdentifier "content" .
128130

129-
chat_shape:chatmessageshape_relatedchatchannel a sh:PropertyShape ;
130-
sh:path [ sh:inversePath flow:message ] ;
131-
sh:minCount 1 ;
132-
sh:name "Related Chat" ;
133-
sh:description "The chat channel or conversation to which this message belongs." ;
134-
sh:codeIdentifier "relatedChatChannel" .
135-
136131
##################### Chat Participation Shape
137132

138133
chat_shape:ChatParticipationShape a sh:NodeShape ;
@@ -255,14 +250,41 @@ chat_shape:ChatActionShape a sh:NodeShape ;
255250
sh:name "Chat Action Shape" ;
256251
sh:description "NodeShape defining constraints for actions representing interactions or sentiments in the chat system." ;
257252
sh:targetClass schema:Action ;
253+
sh:targetClass schema_http:Action ;
254+
sh:targetSubjectsOf schema:target ;
255+
sh:targetSubjectsOf schema_http:target ;
258256
dct:created "2026-03-12"^^xsd:date ;
259257
vs:term_status "testing" ;
260258
dc:source <https://github.com/SolidOS/chat-pane/blob/main/shapes/chat-shapes.ttl> ;
261259
prov:wasDerivedFrom <https://github.com/SolidOS/chat-pane/blob/main/shapes/chat-shapes.ttl> ;
262260
sh:codeIdentifier "ChatAction" ;
263261
sh:property chat_shape:chatactionshape_type,
264262
chat_shape:chatactionshape_agent,
265-
chat_shape:chatactionshape_target
263+
chat_shape:chatactionshape_agent_http,
264+
chat_shape:chatactionshape_target,
265+
chat_shape:chatactionshape_target_http ;
266+
sh:or (
267+
[ sh:property [
268+
sh:path schema:agent ;
269+
sh:minCount 1 ;
270+
sh:maxCount 1 ;
271+
] ;
272+
sh:property [
273+
sh:path schema:target ;
274+
sh:minCount 1 ;
275+
sh:maxCount 1 ;
276+
] ]
277+
[ sh:property [
278+
sh:path schema_http:agent ;
279+
sh:minCount 1 ;
280+
sh:maxCount 1 ;
281+
] ;
282+
sh:property [
283+
sh:path schema_http:target ;
284+
sh:minCount 1 ;
285+
sh:maxCount 1 ;
286+
] ]
287+
)
266288
.
267289

268290
chat_shape:chatactionshape_type a sh:PropertyShape ;
@@ -277,9 +299,259 @@ chat_shape:chatactionshape_agent a sh:PropertyShape ;
277299
sh:name "Agent" ;
278300
sh:codeIdentifier "agent" .
279301

302+
chat_shape:chatactionshape_agent_http a sh:PropertyShape ;
303+
sh:path schema_http:agent ;
304+
sh:maxCount 1 ;
305+
sh:name "Agent (Legacy)" ;
306+
sh:description "Legacy http://schema.org/ agent predicate accepted for compatibility." ;
307+
sh:codeIdentifier "agentLegacy" .
308+
280309
chat_shape:chatactionshape_target a sh:PropertyShape ;
281310
sh:path schema:target ;
311+
sh:maxCount 1 ;
312+
sh:name "Target" ;
313+
sh:codeIdentifier "target" .
314+
315+
chat_shape:chatactionshape_target_http a sh:PropertyShape ;
316+
sh:path schema_http:target ;
317+
sh:maxCount 1 ;
318+
sh:name "Target (Legacy)" ;
319+
sh:description "Legacy http://schema.org/ target predicate accepted for compatibility." ;
320+
sh:codeIdentifier "targetLegacy" .
321+
322+
##################### Long Chat Semantic Variants
323+
324+
# These additive shapes model the current SolidOS long chat implementation
325+
# without changing the existing published Chat* shapes above.
326+
327+
##################### Long Chat Channel Shape
328+
329+
chat_shape:LongChatChannelShape a sh:NodeShape ;
330+
sh:name "Long Chat Channel Shape" ;
331+
sh:description "SHACL NodeShape for signed, append-only, threaded Solid Long Chat channels." ;
332+
sh:targetClass mee:LongChat ;
333+
dct:created "2026-04-07"^^xsd:date ;
334+
vs:term_status "testing" ;
335+
dc:source <https://github.com/SolidOS/chat-pane/blob/main/shapes/longchat-shapes.ttl> ;
336+
prov:wasDerivedFrom <https://github.com/SolidOS/chat-pane/blob/main/shapes/chat-shapes.ttl>,
337+
<https://github.com/SolidOS/chat-pane/blob/main/shapes/longchat-shapes.ttl> ;
338+
sh:codeIdentifier "LongChatChannel" ;
339+
sh:property chat_shape:chatchannelshape_type,
340+
chat_shape:chatchannelshape_author,
341+
chat_shape:chatchannelshape_title,
342+
chat_shape:chatchannelshape_createddate,
343+
chat_shape:chatchannelshape_sharedpreferences,
344+
chat_shape:chatchannelshape_participation,
345+
chat_shape:longchatchannelshape_message .
346+
347+
chat_shape:longchatchannelshape_message a sh:PropertyShape ;
348+
sh:path flow:message ;
349+
sh:node chat_shape:LongChatMessageShape ;
350+
sh:name "Top-Level Long Chat Message" ;
351+
sh:description "Top-level messages linked directly from the long chat channel." ;
352+
sh:codeIdentifier "topLevelMessage" .
353+
354+
##################### Long Chat Message Shape
355+
356+
chat_shape:LongChatMessageShape a sh:NodeShape ;
357+
sh:name "Long Chat Message Shape" ;
358+
sh:description "SHACL NodeShape for signed long chat messages, including replies, replacements, and deletions. In the current implementation, proofValue signs the core message fields id, created, content, and maker, but does not directly sign replacement, thread, or deletion metadata. Both http://schema.org/ and https://schema.org/ deletion predicates are accepted for compatibility." ;
359+
sh:targetObjectsOf flow:message ;
360+
sh:targetObjectsOf sioc:has_member ;
361+
sh:targetObjectsOf dct:isReplacedBy ;
362+
dct:created "2026-04-07"^^xsd:date ;
363+
vs:term_status "testing" ;
364+
dc:source <https://github.com/SolidOS/chat-pane/blob/main/shapes/longchat-shapes.ttl> ;
365+
prov:wasDerivedFrom <https://github.com/SolidOS/chat-pane/blob/main/shapes/chat-shapes.ttl>,
366+
<https://github.com/SolidOS/chat-pane/blob/main/shapes/longchat-shapes.ttl> ;
367+
sh:codeIdentifier "LongChatMessage" ;
368+
sh:property chat_shape:chatmessageshape_createddate,
369+
chat_shape:chatmessageshape_author,
370+
chat_shape:chatmessageshape_content,
371+
chat_shape:longchatmessageshape_proofvalue,
372+
chat_shape:longchatmessageshape_replythread,
373+
chat_shape:longchatmessageshape_replacedby,
374+
chat_shape:longchatmessageshape_datedeleted,
375+
chat_shape:longchatmessageshape_datedeleted_http .
376+
# inverse-path containment constraints are intentionally omitted here because
377+
# the current shacl-converter object generation only supports NamedNode sh:path values.
378+
379+
chat_shape:longchatmessageshape_proofvalue a sh:PropertyShape ;
380+
sh:path sec:proofValue ;
381+
sh:datatype xsd:string ;
382+
sh:minCount 1 ;
383+
sh:maxCount 1 ;
384+
sh:name "Proof Value" ;
385+
sh:description "Cryptographic signature or proof for the message." ;
386+
sh:codeIdentifier "proofValue" .
387+
388+
chat_shape:longchatmessageshape_replythread a sh:PropertyShape ;
389+
sh:path sioc:has_reply ;
390+
sh:maxCount 1 ;
391+
sh:node chat_shape:LongChatThreadShape ;
392+
sh:name "Reply Thread" ;
393+
sh:description "Links a thread root message to its thread resource." ;
394+
sh:codeIdentifier "replyThread" .
395+
396+
chat_shape:longchatmessageshape_replacedby a sh:PropertyShape ;
397+
sh:path dct:isReplacedBy ;
398+
sh:maxCount 1 ;
399+
sh:node chat_shape:LongChatMessageShape ;
400+
sh:name "Is Replaced By" ;
401+
sh:description "Append-only link from an earlier message version to its replacement." ;
402+
sh:codeIdentifier "isReplacedBy" .
403+
404+
chat_shape:longchatmessageshape_datedeleted a sh:PropertyShape ;
405+
sh:path schema:dateDeleted ;
406+
sh:datatype xsd:dateTime ;
407+
sh:maxCount 1 ;
408+
sh:name "Date Deleted" ;
409+
sh:description "Deletion marker carried by a replacement message representing a deleted message." ;
410+
sh:codeIdentifier "dateDeleted" .
411+
412+
chat_shape:longchatmessageshape_datedeleted_http a sh:PropertyShape ;
413+
sh:path schema_http:dateDeleted ;
414+
sh:datatype xsd:dateTime ;
415+
sh:maxCount 1 ;
416+
sh:name "Date Deleted (Legacy)" ;
417+
sh:description "Legacy http://schema.org/ deletion marker accepted for compatibility." ;
418+
sh:codeIdentifier "dateDeletedLegacy" .
419+
420+
##################### Long Chat Replacement Shape
421+
422+
chat_shape:AppendOnlyMessageVersionShape a sh:NodeShape ;
423+
sh:name "Append-Only Message Version Shape" ;
424+
sh:description "NodeShape for long chat messages that replace an earlier message version." ;
425+
sh:targetSubjectsOf dct:isReplacedBy ;
426+
dct:created "2026-04-07"^^xsd:date ;
427+
vs:term_status "testing" ;
428+
dc:source <https://github.com/SolidOS/chat-pane/blob/main/shapes/longchat-shapes.ttl> ;
429+
prov:wasDerivedFrom <https://github.com/SolidOS/chat-pane/blob/main/shapes/longchat-shapes.ttl> ;
430+
sh:codeIdentifier "AppendOnlyMessageVersion" ;
431+
sh:property chat_shape:longchatmessageshape_replacedby .
432+
433+
##################### Deleted Long Chat Message Shape
434+
435+
chat_shape:DeletedLongChatMessageShape a sh:NodeShape ;
436+
sh:name "Deleted Long Chat Message Shape" ;
437+
sh:description "NodeShape for replacement messages that mark a long chat message as deleted. Both http://schema.org/ and https://schema.org/ deletion predicates are accepted for compatibility." ;
438+
sh:targetSubjectsOf schema:dateDeleted ;
439+
sh:targetSubjectsOf schema_http:dateDeleted ;
440+
dct:created "2026-04-07"^^xsd:date ;
441+
vs:term_status "testing" ;
442+
dc:source <https://github.com/SolidOS/chat-pane/blob/main/shapes/longchat-shapes.ttl> ;
443+
prov:wasDerivedFrom <https://github.com/SolidOS/chat-pane/blob/main/shapes/longchat-shapes.ttl> ;
444+
sh:codeIdentifier "DeletedLongChatMessage" ;
445+
sh:property chat_shape:longchatmessageshape_datedeleted,
446+
chat_shape:longchatmessageshape_datedeleted_http .
447+
# previousVersion inverse path is intentionally omitted here because
448+
# the current shacl-converter object generation only supports NamedNode sh:path values.
449+
450+
##################### Long Chat Thread Shape
451+
452+
chat_shape:LongChatThreadShape a sh:NodeShape ;
453+
sh:name "Long Chat Thread Shape" ;
454+
sh:description "NodeShape for thread resources grouping long chat replies." ;
455+
sh:targetObjectsOf sioc:has_reply ;
456+
sh:targetSubjectsOf sioc:has_member ;
457+
dct:created "2026-04-07"^^xsd:date ;
458+
vs:term_status "testing" ;
459+
dc:source <https://github.com/SolidOS/chat-pane/blob/main/shapes/longchat-shapes.ttl> ;
460+
prov:wasDerivedFrom <https://github.com/SolidOS/chat-pane/blob/main/shapes/longchat-shapes.ttl> ;
461+
sh:codeIdentifier "LongChatThread" ;
462+
sh:property chat_shape:longchatthreadshape_type,
463+
chat_shape:longchatthreadshape_member .
464+
465+
chat_shape:longchatthreadshape_type a sh:PropertyShape ;
466+
sh:path rdf:type ;
467+
sh:value sioc:Thread ;
282468
sh:minCount 1 ;
283469
sh:maxCount 1 ;
470+
sh:name "Type" ;
471+
sh:description "Specifies that the node must be of type sioc:Thread." ;
472+
sh:codeIdentifier "type" .
473+
474+
chat_shape:longchatthreadshape_member a sh:PropertyShape ;
475+
sh:path sioc:has_member ;
476+
sh:node chat_shape:LongChatMessageShape ;
477+
sh:name "Thread Member" ;
478+
sh:description "A reply message belonging to the thread." ;
479+
sh:codeIdentifier "member" .
480+
481+
##################### Long Chat Action Shape
482+
483+
chat_shape:LongChatActionShape a sh:NodeShape ;
484+
sh:name "Long Chat Action Shape" ;
485+
sh:description "NodeShape defining constraints for long chat actions such as reactions or other sentiments. Both http://schema.org/ and https://schema.org/ action terms are accepted for compatibility." ;
486+
sh:targetClass schema:Action ;
487+
sh:targetClass schema_http:Action ;
488+
sh:targetSubjectsOf schema:target ;
489+
sh:targetSubjectsOf schema_http:target ;
490+
dct:created "2026-04-07"^^xsd:date ;
491+
vs:term_status "testing" ;
492+
dc:source <https://github.com/SolidOS/chat-pane/blob/main/shapes/longchat-shapes.ttl> ;
493+
prov:wasDerivedFrom <https://github.com/SolidOS/chat-pane/blob/main/shapes/longchat-shapes.ttl> ;
494+
sh:codeIdentifier "LongChatAction" ;
495+
sh:property chat_shape:longchatactionshape_type,
496+
chat_shape:longchatactionshape_agent,
497+
chat_shape:longchatactionshape_agent_http,
498+
chat_shape:longchatactionshape_target,
499+
chat_shape:longchatactionshape_target_http ;
500+
sh:or (
501+
[ sh:property [
502+
sh:path schema:agent ;
503+
sh:minCount 1 ;
504+
sh:maxCount 1 ;
505+
] ;
506+
sh:property [
507+
sh:path schema:target ;
508+
sh:minCount 1 ;
509+
sh:maxCount 1 ;
510+
] ]
511+
[ sh:property [
512+
sh:path schema_http:agent ;
513+
sh:minCount 1 ;
514+
sh:maxCount 1 ;
515+
] ;
516+
sh:property [
517+
sh:path schema_http:target ;
518+
sh:minCount 1 ;
519+
sh:maxCount 1 ;
520+
] ]
521+
) .
522+
523+
chat_shape:longchatactionshape_type a sh:PropertyShape ;
524+
sh:path rdf:type ;
525+
sh:minCount 1 ;
526+
sh:maxCount 1 ;
527+
sh:name "Type" ;
528+
sh:description "The action class for the long chat action resource." ;
529+
sh:codeIdentifier "type" .
530+
531+
chat_shape:longchatactionshape_agent a sh:PropertyShape ;
532+
sh:path schema:agent ;
533+
sh:maxCount 1 ;
534+
sh:name "Agent" ;
535+
sh:description "The agent who performed the long chat action." ;
536+
sh:codeIdentifier "agent" .
537+
538+
chat_shape:longchatactionshape_agent_http a sh:PropertyShape ;
539+
sh:path schema_http:agent ;
540+
sh:maxCount 1 ;
541+
sh:name "Agent (Legacy)" ;
542+
sh:description "Legacy http://schema.org/ agent predicate accepted for compatibility." ;
543+
sh:codeIdentifier "agentLegacy" .
544+
545+
chat_shape:longchatactionshape_target a sh:PropertyShape ;
546+
sh:path schema:target ;
547+
sh:maxCount 1 ;
284548
sh:name "Target" ;
285-
sh:codeIdentifier "target" .
549+
sh:description "The long chat resource targeted by the action." ;
550+
sh:codeIdentifier "target" .
551+
552+
chat_shape:longchatactionshape_target_http a sh:PropertyShape ;
553+
sh:path schema_http:target ;
554+
sh:maxCount 1 ;
555+
sh:name "Target (Legacy)" ;
556+
sh:description "Legacy http://schema.org/ target predicate accepted for compatibility." ;
557+
sh:codeIdentifier "targetLegacy" .

0 commit comments

Comments
 (0)