diff --git a/.github/workflows/build-ontology.yaml b/.github/workflows/build-ontology.yaml new file mode 100644 index 00000000000..5c2fa0871e5 --- /dev/null +++ b/.github/workflows/build-ontology.yaml @@ -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 }} + diff --git a/.github/workflows/validation.yaml b/.github/workflows/validation.yaml new file mode 100644 index 00000000000..865eae8e0a3 --- /dev/null +++ b/.github/workflows/validation.yaml @@ -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 diff --git a/.travis.yml b/.travis.yml index 7cf88d5a2c7..750c437fa79 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/NTO/Automation/entities/AutomationIssue.ttl b/NTO/Automation/entities/AutomationIssue.ttl index f44509151f7..6b6ba4e599f 100644 --- a/NTO/Automation/entities/AutomationIssue.ttl +++ b/NTO/Automation/entities/AutomationIssue.ttl @@ -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 diff --git a/NTO/CustomerSupport/entities/ChatMessage.ttl b/NTO/CustomerSupport/entities/ChatMessage.ttl new file mode 100644 index 00000000000..969fea691a2 --- /dev/null +++ b/NTO/CustomerSupport/entities/ChatMessage.ttl @@ -0,0 +1,36 @@ +@prefix ogit.CustomerSupport: . +@prefix ogit: . +@prefix dcterms: . +@prefix rdfs: . + +# 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 ] + ) ; +. diff --git a/NTO/CustomerSupport/entities/ChatSession.ttl b/NTO/CustomerSupport/entities/ChatSession.ttl new file mode 100644 index 00000000000..19b6745f429 --- /dev/null +++ b/NTO/CustomerSupport/entities/ChatSession.ttl @@ -0,0 +1,38 @@ +@prefix ogit.CustomerSupport: . +@prefix ogit.ServiceManagement: . +@prefix ogit: . +@prefix dcterms: . +@prefix rdfs: . + +# 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 ] + ) ; +. diff --git a/NTO/MARS/entities/Application.ttl b/NTO/MARS/entities/Application.ttl index 28959fd8fe5..3d1fec4934d 100644 --- a/NTO/MARS/entities/Application.ttl +++ b/NTO/MARS/entities/Application.ttl @@ -37,6 +37,8 @@ ogit.MARS:Application ogit.Automation:lifecycle ogit.Automation:serviceStatus ogit.Automation:marsNodeType + + ogit:tenantId ); ogit:indexed-attributes ( ogit:name diff --git a/NTO/MARS/entities/Machine.ttl b/NTO/MARS/entities/Machine.ttl index c91944990ef..8b15ec97435 100644 --- a/NTO/MARS/entities/Machine.ttl +++ b/NTO/MARS/entities/Machine.ttl @@ -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 diff --git a/NTO/MARS/entities/Resource.ttl b/NTO/MARS/entities/Resource.ttl index 900042d41ea..3857b8bcdc3 100644 --- a/NTO/MARS/entities/Resource.ttl +++ b/NTO/MARS/entities/Resource.ttl @@ -38,6 +38,8 @@ ogit.MARS:Resource ogit.Automation:lifecycle ogit.Automation:serviceStatus ogit.Automation:marsNodeType + + ogit:tenantId ); ogit:indexed-attributes ( ogit:name diff --git a/NTO/MARS/entities/Software.ttl b/NTO/MARS/entities/Software.ttl index e51839fdb52..517c81345d0 100644 --- a/NTO/MARS/entities/Software.ttl +++ b/NTO/MARS/entities/Software.ttl @@ -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 diff --git a/SGO/sgo/attributes/tenantId.ttl b/SGO/sgo/attributes/tenantId.ttl new file mode 100644 index 00000000000..d248074cb89 --- /dev/null +++ b/SGO/sgo/attributes/tenantId.ttl @@ -0,0 +1,14 @@ +@prefix ogit: . +@prefix owl: . +@prefix rdfs: . +@prefix dcterms: . + +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"; +. diff --git a/SGO/sgo/entities/Agent.ttl b/SGO/sgo/entities/Agent.ttl new file mode 100644 index 00000000000..1524b2b55bc --- /dev/null +++ b/SGO/sgo/entities/Agent.ttl @@ -0,0 +1,32 @@ +@prefix ogit.CustomerSupport: . +@prefix owl: . +@prefix ogit: . +@prefix rdfs: . +@prefix dcterms: . + +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 ] + ); +. diff --git a/SGO/sgo/entities/Attachment.ttl b/SGO/sgo/entities/Attachment.ttl index e5e0d8c8699..22e7d21e373 100644 --- a/SGO/sgo/entities/Attachment.ttl +++ b/SGO/sgo/entities/Attachment.ttl @@ -7,6 +7,7 @@ @prefix ogit.Automation: . @prefix ogit.MARS: . @prefix ogit.Software: . +@prefix ogit.CustomerSupport: . @prefix ogit.Survey: . @prefix ogit.Auth: . @prefix owl: . @@ -21,8 +22,8 @@ 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"; @@ -30,7 +31,7 @@ not saved in GraphIT, instead it contains an external url link for it."""; ogit:blob "true"; ogit:parent ogit:Node; ogit:mandatory-attributes ( - + ); ogit:optional-attributes ( ogit:id @@ -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 ] @@ -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 ] ); . diff --git a/singleTTL.sh b/singleTTL.sh new file mode 100644 index 00000000000..4d1819fa408 --- /dev/null +++ b/singleTTL.sh @@ -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.' diff --git a/validate.sh b/validate.sh new file mode 100755 index 00000000000..4cfafd4fea8 --- /dev/null +++ b/validate.sh @@ -0,0 +1 @@ +find . -type f ! -name 'graphit-ontology.*' -name "*.ttl" | xargs java -jar bin/ogit-validator.jar