Skip to content

Commit 288f8e7

Browse files
committed
AI assisted data catalog
dashjoin/dashjoin-aas#723
1 parent 7bc94a8 commit 288f8e7

3 files changed

Lines changed: 55 additions & 0 deletions

File tree

dashjoin-core/src/main/java/org/dashjoin/service/PojoDatabase.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,10 @@ public int compare(Map<String, Object> o1, Map<String, Object> o2) {
898898
continue;
899899
if ("App".equals(page.get("ID")))
900900
continue;
901+
if ("DataCatalog".equals(page.get("ID")))
902+
continue;
903+
if ("BusinessLogicCatalog".equals(page.get("ID")))
904+
continue;
901905
if ("ERDiagram".equals(page.get("ID")))
902906
continue;
903907
if ("Notebook".equals(page.get("ID")))
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"ID": "BusinessLogicCatalog",
3+
"layout": {
4+
"widget": "page",
5+
"onRender": "$count($all('config', 'dj-function', {'ID': 'dj-copilot'})) = 0 ? $notify('Please configure an AIApp function called dj-copilot in order to use the suggest feature')",
6+
"children": [
7+
{
8+
"expression": "$all('config', 'dj-query-catalog').{'ID':ID, 'query': query, 'comment':comment}",
9+
"title": "Query Catalog Descriptions",
10+
"properties": {
11+
"Enter": "($d := $prompt('Description'); $d ? selected.$update('config', 'dj-query-catalog', ID, {'comment': $d}); $refresh())",
12+
"Suggest": "selected.($comment := $parseJson($call('dj-copilot', {'response_format': { 'properties': {'res': {}} }, 'messages':[{'role':'user', 'content':'Create a very short description for this query called ' & ID & ': ' & query}]}).choices.message.content).res; $setIfAbsent('config', 'dj-query-catalog', ID, {'comment': $comment}); $refresh())",
13+
"Delete": "($confirm('Delete descriptions?') ? selected.$update('config', 'dj-query-catalog', ID, {'comment': null}); $refresh())"
14+
},
15+
"widget": "actionTable"
16+
},
17+
{
18+
"expression": "$all('config', 'dj-function')[djClassName = 'com.dashjoin.function.ETL'].{'ID':ID, 'foreach':expressions.foreach, 'expression': expressions.expression, 'table': $keys(mappings),'comment': comment}",
19+
"title": "ETL Descriptions",
20+
"properties": {
21+
"Enter": "($d := $prompt('Description'); $d ? selected.$update('config', 'dj-function', ID, {'comment': $d}); $refresh())",
22+
"Suggest": "selected.($comment := $parseJson($call('dj-copilot', {'response_format': { 'properties': {'res': {}} }, 'messages':[{'role':'user', 'content':'Create a very short description for this ETL called ' & ID & ' that loads data into the table ' & table & ': ' & foreach & '\n' & expression }]}).choices.message.content).res; $setIfAbsent('config', 'dj-function', ID, {'comment': $comment}); $refresh())",
23+
"Delete": "($confirm('Delete descriptions?') ? selected.$update('config', 'dj-function', ID, {'comment': null}); $refresh())"
24+
},
25+
"widget": "actionTable"
26+
},
27+
{
28+
"expression": "$all('config', 'dj-function')[djClassName = 'org.dashjoin.function.Invoke'].{'ID':ID, 'foreach':expressions.foreach, 'expression':expression, 'comment': comment}",
29+
"title": "Invoke Descriptions",
30+
"properties": {
31+
"Enter": "($d := $prompt('Description'); $d ? selected.$update('config', 'dj-function', ID, {'comment': $d}); $refresh())",
32+
"Suggest": "selected.($comment := $parseJson($call('dj-copilot', {'response_format': { 'properties': {'res': {}} }, 'messages':[{'role':'user', 'content':'Create a very short description for this function called ' & ID & ': ' & expression }]}).choices.message.content).res; $setIfAbsent('config', 'dj-function', ID, {'comment': $comment}); $refresh())",
33+
"Delete": "($confirm('Delete descriptions?') ? selected.$update('config', 'dj-function', ID, {'comment': null}); $refresh())"
34+
},
35+
"widget": "actionTable"
36+
}
37+
]
38+
}
39+
}

dashjoin-core/src/main/resources/model/page/Info.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,18 @@
130130
"href": "/page/ERDiagram",
131131
"icon": "schema",
132132
"text": "ER Diagram"
133+
},
134+
{
135+
"widget": "text",
136+
"href": "/page/DataCatalog",
137+
"icon": "library_books",
138+
"text": "Data Catalog"
139+
},
140+
{
141+
"widget": "text",
142+
"href": "/page/BusinessLogicCatalog",
143+
"icon": "functions",
144+
"text": "Business Logic Catalog"
133145
}
134146
]
135147
},

0 commit comments

Comments
 (0)