Skip to content

Edit chat shape to include longchat#47

Open
bourgeoa wants to merge 2 commits intosolid:mainfrom
bourgeoa:edit-chat-shape
Open

Edit chat shape to include longchat#47
bourgeoa wants to merge 2 commits intosolid:mainfrom
bourgeoa:edit-chat-shape

Conversation

@bourgeoa
Copy link
Copy Markdown
Member

@bourgeoa bourgeoa commented Apr 8, 2026

see issue #40

Summary

Add longchat-specific SHACL shapes to shapes/chat.ttl without changing the existing published chat shapes.

What Changed

  • added LongChatChannelShape for mee:LongChat channels
  • added LongChatMessageShape for signed chat messages with append-only replacement links
  • added AppendOnlyMessageVersionShape for message version chains via dct:isReplacedBy
  • added DeletedLongChatMessageShape for replacement messages carrying deletion timestamps
  • added LongChatThreadShape for sioc:Thread reply structures
  • added LongChatActionShape for sentiment/action nodes targeting chat messages
  • accepted both https://schema.org/ and legacy http://schema.org/ predicates for compatibility with existing data
  • documented that sec:proofValue currently signs the core message fields only

Why

The current SolidOS long chat implementation stores richer chat data than the legacy chat shapes describe:

  • dated message documents (YYYY/MM/DD/chat.ttl)
  • signed messages
  • append-only edit and delete flows
  • thread membership through sioc:Thread
  • historical use of http://schema.org/ in deployed chat data

These additions model that behavior as new semantic variants inside the existing chat domain, while preserving the existing Chat* shapes unchanged.

Compatibility

  • no existing Chat* shape was renamed or modified incompatibly
  • legacy http://schema.org/ data remains valid
  • newer https://schema.org/ data is also accepted

Validation

Validated successfully with:

  • python3 scripts/validate-shacl-shapes-file.py shapes/chat.ttl
  • python3 scripts/check-namespaces-and-names-file.py shapes/chat.ttl
  • python3 scripts/check-metadata-and-immutability-file.py shapes/chat.ttl

Copilot AI review requested due to automatic review settings April 8, 2026 07:18
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/target and to target subjects of schema:target.
  • Added sec:proofValue support and legacy schema_http:dateDeleted compatibility.
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_type only requires some rdf:type, so non-Action resources could still pass. If the intent is to ensure these focus nodes are Actions, constrain rdf:type to schema:Action / schema_http:Action (e.g., via sh:in/sh:hasValue), or drop the targetSubjectsOf targeting.
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.

Comment on lines +465 to +472
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" .
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
chat_shape:longchatactionshape_type a sh:PropertyShape ;
sh:path rdf:type ;
sh:minCount 1 ;
sh:maxCount 1 ;
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
sh:maxCount 1 ;
sh:maxCount 1 ;
sh:in ( schema:Action schema_http:Action ) ;

Copilot uses AI. Check for mistakes.

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." ;
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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." ;

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants