Conversation
There was a problem hiding this comment.
Pull request overview
Adds SHACL shapes to model SolidOS “longchat” data (signed messages, append-only edits/deletes, threads, and actions) while extending schema.org predicate compatibility (http/https) for action/deletion fields.
Changes:
- Added new
LongChat*NodeShapes for channels, messages, threads, actions, and append-only replacement/deletion patterns. - Extended action validation to accept legacy
http://schema.org/agent/targetand to target subjects ofschema:target. - Added
sec:proofValuesupport and legacyschema_http:dateDeletedcompatibility.
Comments suppressed due to low confidence (1)
shapes/chat.ttl:294
- With
sh:targetSubjectsOf schema:target/schema_http:target, this shape now applies to nodes that may not be explicitly typed as an Action.chatactionshape_typeonly requires somerdf:type, so non-Action resources could still pass. If the intent is to ensure these focus nodes are Actions, constrainrdf:typetoschema:Action/schema_http:Action(e.g., viash:in/sh:hasValue), or drop thetargetSubjectsOftargeting.
chat_shape:ChatActionShape a sh:NodeShape ;
sh:name "Chat Action Shape" ;
sh:description "NodeShape defining constraints for actions representing interactions or sentiments in the chat system." ;
sh:targetClass schema:Action ;
sh:targetClass schema_http:Action ;
sh:targetSubjectsOf schema:target ;
sh:targetSubjectsOf schema_http:target ;
dct:created "2026-03-12"^^xsd:date ;
vs:term_status "testing" ;
dc:source <https://github.com/SolidOS/chat-pane/blob/main/shapes/chat-shapes.ttl> ;
prov:wasDerivedFrom <https://github.com/SolidOS/chat-pane/blob/main/shapes/chat-shapes.ttl> ;
sh:codeIdentifier "ChatAction" ;
sh:property chat_shape:chatactionshape_type,
chat_shape:chatactionshape_agent,
chat_shape:chatactionshape_agent_http,
chat_shape:chatactionshape_target,
chat_shape:chatactionshape_target_http ;
sh:or (
[ sh:property [
sh:path schema:agent ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
sh:property [
sh:path schema:target ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ]
[ sh:property [
sh:path schema_http:agent ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
sh:property [
sh:path schema_http:target ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ]
)
.
chat_shape:chatactionshape_type a sh:PropertyShape ;
sh:path rdf:type ;
sh:minCount 1 ;
sh:name "Type" ;
sh:codeIdentifier "type" .
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| chat_shape:longchatthreadshape_type a sh:PropertyShape ; | ||
| sh:path rdf:type ; | ||
| sh:value sioc:Thread ; | ||
| sh:minCount 1 ; | ||
| sh:maxCount 1 ; | ||
| sh:name "Type" ; | ||
| sh:description "Specifies that the node must be of type sioc:Thread." ; | ||
| sh:codeIdentifier "type" . |
There was a problem hiding this comment.
sh:value is not a SHACL Core constraint component for PropertyShapes, so this won’t actually require rdf:type to be sioc:Thread. Use sh:hasValue sioc:Thread (or sh:in (sioc:Thread) / sh:class sioc:Thread) to make the type constraint effective.
| chat_shape:longchatactionshape_type a sh:PropertyShape ; | ||
| sh:path rdf:type ; | ||
| sh:minCount 1 ; | ||
| sh:maxCount 1 ; |
There was a problem hiding this comment.
longchatactionshape_type currently enforces exactly one rdf:type but doesn’t restrict the value to schema:Action/schema_http:Action. Since this NodeShape also targets subjects of schema:target, consider constraining the allowed type(s) (e.g., sh:in (schema:Action schema_http:Action)) so the shape actually validates “Action” resources rather than any typed node with a schema:target.
| sh:maxCount 1 ; | |
| sh:maxCount 1 ; | |
| sh:in ( schema:Action schema_http:Action ) ; |
|
|
||
| chat_shape:AppendOnlyMessageVersionShape a sh:NodeShape ; | ||
| sh:name "Append-Only Message Version Shape" ; | ||
| sh:description "NodeShape for long chat messages that replace an earlier message version." ; |
There was a problem hiding this comment.
AppendOnlyMessageVersionShape targets subjects of dct:isReplacedBy (i.e., earlier message versions that have been replaced), but the description says these messages “replace an earlier message version.” Consider updating the description to match the targeting semantics to avoid confusion for shape consumers.
| sh:description "NodeShape for long chat messages that replace an earlier message version." ; | |
| sh:description "NodeShape for earlier long chat message versions that have been replaced by a later version." ; |
see issue #40
Summary
Add longchat-specific SHACL shapes to
shapes/chat.ttlwithout changing the existing published chat shapes.What Changed
LongChatChannelShapeformee:LongChatchannelsLongChatMessageShapefor signed chat messages with append-only replacement linksAppendOnlyMessageVersionShapefor message version chains viadct:isReplacedByDeletedLongChatMessageShapefor replacement messages carrying deletion timestampsLongChatThreadShapeforsioc:Threadreply structuresLongChatActionShapefor sentiment/action nodes targeting chat messageshttps://schema.org/and legacyhttp://schema.org/predicates for compatibility with existing datasec:proofValuecurrently signs the core message fields onlyWhy
The current SolidOS long chat implementation stores richer chat data than the legacy chat shapes describe:
YYYY/MM/DD/chat.ttl)sioc:Threadhttp://schema.org/in deployed chat dataThese additions model that behavior as new semantic variants inside the existing chat domain, while preserving the existing
Chat*shapes unchanged.Compatibility
Chat*shape was renamed or modified incompatiblyhttp://schema.org/data remains validhttps://schema.org/data is also acceptedValidation
Validated successfully with:
python3 scripts/validate-shacl-shapes-file.py shapes/chat.ttlpython3 scripts/check-namespaces-and-names-file.py shapes/chat.ttlpython3 scripts/check-metadata-and-immutability-file.py shapes/chat.ttl