This commit is contained in:
felix
2026-09-15 19:12:26 +02:00
parent c55ad4eebb
commit 2c812ed48b
6 changed files with 164 additions and 3 deletions

View File

@@ -56,6 +56,9 @@
:reporting "http://lblod.data.gift/vocabularies/reporting/"
:oslc "http://open-services.net/ns/core#"
:cogs "http://vocab.deri.ie/cogs#"
:sioc "http://rdfs.org/sioc/ns#"
:sioct "http://rdfs.org/sioc/types#"
:as "https://www.w3.org/ns/activitystreams#"
)
(type-cache::add-type-for-prefix "http://mu.semte.ch/sessions/" "http://mu.semte.ch/vocabularies/session/Session")
@@ -220,7 +223,8 @@
("code:EredienstBeroepen" -> _)
("code:Rechtsvormtype" -> _)
("prov:Location" -> _)
("code:BijkomendeKwalificatieCode" -> _))
("code:BijkomendeKwalificatieCode" -> _)
("prov:SoftwareAgent" -> _))
(define-graph shared ("http://mu.semte.ch/graphs/shared")
("foaf:Image" -> _)
@@ -266,6 +270,22 @@
("nfo:DataContainer" -> _)
("nfo:FileDataObject" -> _))
;; Chat: one graph per account, only its owner reads or writes it.
;; The four chat types appear in no other group: a graph-less insert lands
;; in every graph whose group allows the type.
(define-graph chat ("http://mu.semte.ch/graphs/users/")
("reporting:Report" -> _)
("oslc:Error" -> _)
("nfo:DataContainer" -> _)
("nfo:FileDataObject" -> _)
("cogs:Job" -> _)
("nfo:DataContainer" -> _)
("nfo:FileDataObject" -> _)
("sioc:Thread" -> _)
("sioc:Post" -> _)
("sioct:InstantMessage" -> _)
("as:Document" -> _))
(supply-allowed-group "public")
(supply-allowed-group "o-admin-rwf"
@@ -336,12 +356,20 @@
FILTER( ?session_role = \"ABBOrganisatiePortaalErediensten-beheerder\" )
}")
(supply-allowed-group "chat-owner"
:parameters ("session_account")
:query "PREFIX session: <http://mu.semte.ch/vocabularies/session/>
PREFIX mu: <http://mu.semte.ch/vocabularies/core/>
SELECT DISTINCT ?session_account WHERE {
<SESSION_ID> session:account/mu:uuid ?session_account.
}")
(grant (read)
:to-graph (acmidm-lezer acmidm-vendor)
:for-allowed-group "ABBOrganisatiePortaalGebruiker-lezer")
(grant (read write)
:to-graph (acmidm-editeerder acmidm-vendor)
:to-graph (acmidm-editeerder acmidm-vendor chat)
:for-allowed-group "ABBOrganisatiePortaalGebruiker-editeerder")
(grant (read write)
@@ -366,4 +394,8 @@
(grant (read write)
:to-graph (reports jobs system-jobs)
:for-allowed-group "o-admin-rwf")
:for-allowed-group "o-admin-rwf")
(grant (read write)
:to-graph (chat)
:for-allowed-group "chat-owner")

View File

@@ -199,6 +199,27 @@ export default [
gracePeriod: 1000,
ignoreFromSelf: true
}
},
// The chat's data (per-user graphs) is written straight to the store by
// the natural-language-report service, so mu-cl-resources only sees it
// fresh when a delta clears its caches.
{
match: {
subject: {}
},
callback: {
url: 'http://resource/.mu/delta',
method: 'POST'
},
options: {
resourceFormat: 'v0.0.1',
gracePeriod: 250,
ignoreFromSelf: true,
optOutMuScopeIds: [
"http://redpencil.data.gift/id/concept/muScope/deltas/initialSync",
"http://redpencil.data.gift/id/concept/muScope/deltas/vendor-data"
]
}
}
/*
Commenting ldes rules until ready to go to qa/prod. In the meantime, we override the configuration on dev.

View File

@@ -248,6 +248,47 @@ defmodule Dispatcher do
Proxy.forward(conn, path, "http://resource/kbo-organizations/")
end
###############################################################
# CHAT
# To the resource service, not the cache: the data is per user and
# changes every few seconds.
###############################################################
match "/chat-conversations/*path", %{accept: [:json], layer: :api} do
Proxy.forward(conn, path, "http://resource/chat-conversations/")
end
match "/chat-messages/*path", %{accept: [:json], layer: :api} do
Proxy.forward(conn, path, "http://resource/chat-messages/")
end
match "/chat-instant-messages/*path", %{accept: [:json], layer: :api} do
Proxy.forward(conn, path, "http://resource/chat-instant-messages/")
end
match "/chat-documents/*path", %{accept: [:json], layer: :api} do
Proxy.forward(conn, path, "http://resource/chat-documents/")
end
match "/chat-agents/*path", %{accept: [:json], layer: :api} do
Proxy.forward(conn, path, "http://resource/chat-agents/")
end
# The chat frontend's login screens speak the gebruiker/bestuurseenheid
# resource names (frontend-lblod-chat, used verbatim). The same data as
# /users and /groups, seen through the loket naming.
match "/gebruikers/*path", %{accept: [:json], layer: :api} do
Proxy.forward(conn, path, "http://cache/gebruikers/")
end
match "/bestuurseenheden/*path", %{accept: [:json], layer: :api} do
Proxy.forward(conn, path, "http://cache/bestuurseenheden/")
end
match "/bestuurseenheid-classificatie-codes/*path", %{accept: [:json], layer: :api} do
Proxy.forward(conn, path, "http://cache/bestuurseenheid-classificatie-codes/")
end
# Dashboard
match "/jobs/*path", %{accept: [:json], layer: :api} do
Proxy.forward(conn, path, "http://cache/jobs/")
@@ -417,6 +458,15 @@ defmodule Dispatcher do
forward(conn, path, "http://error-report-service/error-reports/")
end
#################################################################
# CHAT ASSISTANT
# The chat's turn endpoint: POST /assistant/conversations/:id/turns
#################################################################
match "/assistant/*path" do
forward(conn, path, "http://natural-language-report/assistant/")
end
#################################################################
# FILES
#################################################################
@@ -491,6 +541,20 @@ defmodule Dispatcher do
forward conn, [], "http://frontend-dashboard/index.html"
end
# The chat frontend (frontend-lblod-chat). Hosted on the "chat"
# subdomain (reverse_host), so the SPA stays a separate app.
get "/assets/*path", %{ reverse_host: ["chat" | _rest], layer: :api } do
forward conn, path, "http://chat/assets/"
end
get "/@appuniversum/*path", %{ reverse_host: ["chat" | _rest], layer: :api } do
forward conn, path, "http://chat/@appuniversum/"
end
match "/*_path", %{ reverse_host: ["chat" | _rest], layer: :api, accept: [:html] } do
forward conn, [], "http://chat/index.html"
end
match "/assets/*path", %{layer: :api} do
Proxy.forward(conn, path, "http://frontend/assets/")
end

View File

@@ -53,6 +53,12 @@
"target": "user",
"cardinality": "one",
"inverse": true
},
"gebruiker": {
"predicate": "foaf:account",
"target": "gebruikers",
"cardinality": "one",
"inverse": true
}
},
"new-resource-base": "http://data.lblod.info/id/account/"

View File

@@ -16,6 +16,7 @@
(read-domain-file "domain.json")
(read-domain-file "auth.json")
(read-domain-file "chat-domain.json")
(read-domain-file "change-events.json")
(read-domain-file "file.json")
(read-domain-file "dcat.json")