Skip to content

Commit

Permalink
Merge pull request #631 from arago/chat_session
Browse files Browse the repository at this point in the history
Add chat sessions for CustomerSupport
  • Loading branch information
cy303 authored Jun 28, 2024
2 parents df70561 + 9d43d45 commit a0ace20
Show file tree
Hide file tree
Showing 15 changed files with 196 additions and 5 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/build-ontology.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
on:
release:
types: [created]

name: Build ontology

jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
environment: production

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: prepare single ttl file
run: |
sh validate.sh
sh singleTTL.sh
- name: Publish Asset
uses: softprops/action-gh-release@v2
with:
files: graphit-ontology.ttl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

16 changes: 16 additions & 0 deletions .github/workflows/validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Validate ontology

on: pull_request

jobs:
validate:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: validate ontology
run: |
./validate.sh
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ language: java
jdk:
- oraclejdk8
install: true # skip
script: find . -type f -name "*.ttl" | xargs java -jar bin/ogit-validator.jar
script: find . -type f ! -name 'graphit-ontology.*' -name "*.ttl" | xargs java -jar bin/ogit-validator.jar

1 change: 1 addition & 0 deletions NTO/Automation/entities/AutomationIssue.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ IssueCondition is processed first.""";
ogit.Automation:parentIssue
ogit.Automation:suspendUntil
ogit.Automation:maxIdleTime
ogit:tenantId
ogit.Automation:webhook
ogit.RL:state
ogit.RL:totalReward
Expand Down
36 changes: 36 additions & 0 deletions NTO/CustomerSupport/entities/ChatMessage.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
@prefix ogit.CustomerSupport: <http://www.purl.org/ogit/CustomerSupport/> .
@prefix ogit: <http://www.purl.org/ogit/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

# https://developer.zendesk.com/rest_api/docs/support/ticket_comments

ogit.CustomerSupport:ChatMessage
a rdfs:Class ;
rdfs:subClassOf ogit:Entity ;
rdfs:label "ChatMessage" ;
dcterms:description """Represents a servicedesk chat message""";
dcterms:valid "start=2024-04-30;" ;
dcterms:creator "Leonie Glanzer" ;
ogit:scope "NTO" ;
ogit:parent ogit:Node ;
ogit:mandatory-attributes (
ogit:message
) ;
ogit:optional-attributes (
ogit:id # external entity based unique id
ogit:creator # name or id of the sending user
ogit:type # text or file
ogit:source # source system
ogit:sourceId # id of source system
ogit:externalId # id of the message in the source system
ogit:createdAt # timestamp of message creation
ogit:expiresAt # timestamp of message expiration (deletedAt?)
ogit:subject # ?
ogit:summary # ?
) ;
ogit:indexed-attributes ( ) ;
ogit:allowed (
[ ogit:belongs ogit.CustomerSupport:ChatSession ]
) ;
.
38 changes: 38 additions & 0 deletions NTO/CustomerSupport/entities/ChatSession.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@prefix ogit.CustomerSupport: <http://www.purl.org/ogit/CustomerSupport/> .
@prefix ogit.ServiceManagement: <http://www.purl.org/ogit/ServiceManagement/> .
@prefix ogit: <http://www.purl.org/ogit/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .

# https://developer.zendesk.com/rest_api/docs/support/ticket_comments

ogit.CustomerSupport:ChatSession
a rdfs:Class ;
rdfs:subClassOf ogit:Entity ;
rdfs:label "ChatSession" ;
dcterms:description """Represents a CustomerSupport chat session""";
dcterms:valid "start=2024-04-30;" ;
dcterms:creator "Leonie Glanzer" ;
ogit:scope "NTO" ;
ogit:parent ogit:Node ;
ogit:mandatory-attributes (
ogit:id # external entity based unique id
) ;
ogit:optional-attributes (
ogit:status # status of the session (AI-Chat or Agent-Chat)
ogit:tenantId # tenant id of the customer user
ogit:source # name of the source system
ogit:sourceId # ID of the source system
ogit:externalId # ID of the session in the source system
ogit:createdAt # timestamp of the chat creation
) ;
ogit:indexed-attributes ( ) ;
ogit:allowed (
[ ogit:belongs ogit.CustomerSupport:Ticket ]
[ ogit:belongs ogit.ServiceManagement:Ticket ]
[ ogit:belongs ogit.ServiceManagement:Problem ]
[ ogit:belongs ogit.ServiceManagement:Incident ]
[ ogit:belongs ogit.ServiceManagement:ChangeRequest ]
[ ogit:belongs ogit:Organization ]
) ;
.
2 changes: 2 additions & 0 deletions NTO/MARS/entities/Application.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ ogit.MARS:Application
ogit.Automation:lifecycle
ogit.Automation:serviceStatus
ogit.Automation:marsNodeType

ogit:tenantId
);
ogit:indexed-attributes (
ogit:name
Expand Down
2 changes: 2 additions & 0 deletions NTO/MARS/entities/Machine.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ ogit.MARS:Machine
ogit.MARS.Machine:distroName
ogit.MARS.Machine:kernel
ogit.MARS.Machine:ram

ogit:tenantId
);
ogit:indexed-attributes (
ogit:name
Expand Down
2 changes: 2 additions & 0 deletions NTO/MARS/entities/Resource.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ ogit.MARS:Resource
ogit.Automation:lifecycle
ogit.Automation:serviceStatus
ogit.Automation:marsNodeType

ogit:tenantId
);
ogit:indexed-attributes (
ogit:name
Expand Down
2 changes: 2 additions & 0 deletions NTO/MARS/entities/Software.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ ogit.MARS:Software
ogit.MARS.Network:port
ogit.MARS.Network:bindAddress
ogit.MARS.Network:protocol

ogit:tenantId
);
ogit:indexed-attributes (
ogit:name
Expand Down
14 changes: 14 additions & 0 deletions SGO/sgo/attributes/tenantId.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@prefix ogit: <http://www.purl.org/ogit/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .

ogit:tenantId
a owl:DatatypeProperty;
rdfs:subPropertyOf ogit:Attribute;
rdfs:label "tenantId";
dcterms:description "The Id of the tenant graph object.";
# For ranges, see http://dublincore.org/documents/dcmi-period/
dcterms:valid "start=2024-06-24;";
dcterms:creator "Jens Bartsch";
.
32 changes: 32 additions & 0 deletions SGO/sgo/entities/Agent.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
@prefix ogit.CustomerSupport: <http://www.purl.org/ogit/CustomerSupport/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix ogit: <http://www.purl.org/ogit/> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .

ogit:Agent
a rdfs:Class;
rdfs:subClassOf ogit:Entity;
rdfs:label "Agent";
dcterms:description "An agent.";
# For ranges, see http://dublincore.org/documents/dcmi-period/
dcterms:valid "start=2015-05-21;";
dcterms:creator "Jens Bartsch";
ogit:scope "SGO";
ogit:parent ogit:Node;
ogit:mandatory-attributes (

);
ogit:optional-attributes (
ogit:id
ogit:name
ogit:description
);
ogit:indexed-attributes (

);
ogit:allowed (
[ ogit:owns ogit.CustomerSupport:ChatSession ]
[ ogit:supports ogit:Organization ]
);
.
10 changes: 6 additions & 4 deletions SGO/sgo/entities/Attachment.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
@prefix ogit.Automation: <http://www.purl.org/ogit/Automation/> .
@prefix ogit.MARS: <http://www.purl.org/ogit/MARS/> .
@prefix ogit.Software: <http://www.purl.org/ogit/Software/> .
@prefix ogit.CustomerSupport: <http://www.purl.org/ogit/CustomerSupport/> .
@prefix ogit.Survey: <http://www.purl.org/ogit/Survey/> .
@prefix ogit.Auth: <http://www.purl.org/ogit/Auth/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
Expand All @@ -21,16 +22,16 @@ ogit:Attachment
a rdfs:Class;
rdfs:subClassOf ogit:Entity;
rdfs:label "Attachment";
dcterms:description """This entity defines a file attachment that an IT service, issue, task or a ticket might have. The attachment itself is
not saved in GraphIT, instead it contains an external url link for it.""";
dcterms:description """This entity defines a file attachment that an other entity might have. The attachment itself maybe
stored directly in the graph itself or be referenced by an external url link.""";
# For ranges, see http://dublincore.org/documents/dcmi-period/
dcterms:valid "start=2015-05-21;";
dcterms:creator "Peter Larem";
ogit:scope "SGO";
ogit:blob "true";
ogit:parent ogit:Node;
ogit:mandatory-attributes (

);
ogit:optional-attributes (
ogit:id
Expand All @@ -47,7 +48,7 @@ not saved in GraphIT, instead it contains an external url link for it.""";
ogit:accessControl
);
ogit:indexed-attributes (

);
ogit:allowed (
[ ogit:belongs ogit:Comment ]
Expand All @@ -70,5 +71,6 @@ not saved in GraphIT, instead it contains an external url link for it.""";
[ ogit:belongs ogit.Auth:AccountProfile ]
[ ogit:belongs ogit.Factory:Plant ]
[ ogit:belongs ogit.SaaS:ComponentInstance ]
[ ogit:belongs ogit.CustomerSupport:ChatMessage ]
);
.
12 changes: 12 additions & 0 deletions singleTTL.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

TTLFILE=graphit-ontology.ttl
rm -f $TTLFILE


find . -type f -name '*.ttl' -exec cat {} \; -exec echo $'\n' \;> TMP_cat_all.txt
grep "@prefix" TMP_cat_all.txt | awk '{$1=$1}!A[toupper($0)]++' > TMP_prefixed.txt
grep -v "@prefix" TMP_cat_all.txt > TMP_no_prefixes.txt
cat TMP_prefixed.txt TMP_no_prefixes.txt > $TTLFILE
rm TMP_prefixed.txt TMP_no_prefixes.txt TMP_cat_all.txt
echo $TTLFILE 'has been generated.'
1 change: 1 addition & 0 deletions validate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
find . -type f ! -name 'graphit-ontology.*' -name "*.ttl" | xargs java -jar bin/ogit-validator.jar

0 comments on commit a0ace20

Please sign in to comment.