Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RDF support and bump Kùzu version to 0.2.0 #71

Merged
merged 33 commits into from
Feb 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion datasets.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"repository": "https://github.com/kuzudb/kuzu",
"commitHash": "5d7ad0045c026e711edbd446e4c3d90ed2823c14",
"commitHash": "83e28e4eba40594835156903f0a2826fcd2e865c",
"datasetsRoot": "dataset",
"datasets": [
{
Expand Down Expand Up @@ -32,6 +32,24 @@
"path": "snap/twitter/csv",
"isProduction": true,
"description": ""
},
{
"name": "RDF Taxonomy",
"path": "copy-test/rdf",
"isProduction": false,
"description": ""
},
{
"name": "RDF SPB",
"path": "rdf/spb",
"isProduction": true,
"description": ""
},
{
"name": "RDFox Example",
"path": "rdf/rdfox_example",
"isProduction": false,
"description": ""
}
]
}
2 changes: 1 addition & 1 deletion kuzu
Submodule kuzu updated 1442 files
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"bootstrap": "^5.3.1",
"core-js": "^3.8.3",
"express": "^4.18.2",
"kuzu": "0.1.0",
"kuzu": "0.2.0",
"moment": "^2.29.4",
"monaco-editor": "^0.41.0",
"monaco-themes": "^0.4.4",
Expand Down
23 changes: 20 additions & 3 deletions src/components/DatasetView/DatasetMainView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
class="dataset-view__wrapper"
>
<div
v-if="!isSchemaEmpty && !datasetLoadingLog && modeStore.isReadWrite"
v-if="!isSchemaEmpty && isProduction && !datasetLoadingLog && modeStore.isReadWrite"
class="alert alert-warning"
role="alert"
>
Expand All @@ -16,7 +16,7 @@
</div>

<div
v-if="isSchemaEmpty && !datasetLoadingLog && modeStore.isReadWrite"
v-if="isSchemaEmpty && isProduction && !datasetLoadingLog && modeStore.isReadWrite"
class="alert alert-info"
role="alert"
>
Expand All @@ -25,6 +25,16 @@
database.
</div>

<div
v-if="!isProduction && modeStore.isReadWrite"
class="alert alert-warning"
role="alert"
>
<i class="fa-solid fa-info-circle" />
You are running KùzuExplorer in development mode. You can load any dataset into the
database. However, please make sure there is no conflict with the existing schema.
</div>

<div
v-if="modeStore.isReadOnly"
class="alert alert-warning"
Expand Down Expand Up @@ -84,7 +94,7 @@
class="btn btn-lg btn-primary"
title="Load Dataset"
:disabled="
!isSchemaEmpty ||
(!isSchemaEmpty && isProduction) ||
!selectedDatasetSchema ||
datasetLoadingLog ||
!modeStore.isReadWrite
Expand Down Expand Up @@ -128,6 +138,7 @@ export default {
datasetLoadingEnded: false,
databaseSchemaHash: {},
allDatasets: [],
isProduction: true,
}),
computed: {
isSchemaEmpty() {
Expand All @@ -151,6 +162,12 @@ export default {
if (!this.selectedDataset && this.allDatasets.length > 0) {
this.selectedDataset = this.allDatasets[0];
}
for (const dataset of this.allDatasets) {
if (!dataset.isProduction) {
this.isProduction = false;
break;
}
}
})
.catch((error) => {
console.error(error);
Expand Down
19 changes: 19 additions & 0 deletions src/components/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,25 @@ export default {
r.group = relGroupsMap[r.name];
}
});
const rdfMap = {};
this.schema.rdf.forEach((r) => {
r.nodes.forEach((n) => {
rdfMap[n] = r.name;
});
r.rels.forEach((rel) => {
rdfMap[rel] = r.name;
});
});
this.schema.nodeTables.forEach((n) => {
if (rdfMap[n.name]) {
n.rdf = rdfMap[n.name];
}
});
this.schema.relTables.forEach((r) => {
if (rdfMap[r.name]) {
r.rdf = rdfMap[r.name];
}
});
},
async getMode() {
const response = await Axios.get("/api/mode");
Expand Down
17 changes: 17 additions & 0 deletions src/components/SchemaView/SchemaActionDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,23 @@ export default {
this.statement = statement;
this.showModal();
},
addRdf(tableName, rdf) {
this.reset();
this.currentAction = {
type: SCHEMA_ACTION_TYPES.ADD_RDF,
table: tableName,
rdf,
};
const statement = DataDefinitionLanguage.addRdf(tableName, rdf);
this.statement = statement;
this.showModal();
},
dropRdf(tableName) {
this.reset();
const statement = DataDefinitionLanguage.dropRdf(tableName);
this.statement = statement;
this.showModal();
},
dropProperty(table, property) {
this.reset();
const statement = DataDefinitionLanguage.dropProperty(table, property);
Expand Down
13 changes: 6 additions & 7 deletions src/components/SchemaView/SchemaSidebarEditView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<h6 v-if="relGroup">
<b>{{ relGroup }} </b> group
</h6>

<h6>
<span
class="badge bg-primary"
Expand Down Expand Up @@ -85,7 +86,6 @@
&nbsp;
<button
class="btn btn-sm btn-outline-danger"
:disabled="!!relGroup"
title="Drop Table"
@click="$emit('dropTable', label)"
>
Expand Down Expand Up @@ -253,11 +253,10 @@ export default {

relGroup() {
if (!this.schema || !this.label || this.isNode) {
return false;
return null;
}
return this.schema.relTables.find(t => t.name === this.label).group;
},

tableProperties() {
if (this.isEditingLabel) {
if (this.isNode) {
Expand All @@ -270,12 +269,12 @@ export default {
}
if (this.isNode) {
return this.schema.nodeTables
.find(t => t.name === this.label)
.properties;
.find(t => t.name === this.label)
.properties;
} else {
return this.schema.relTables
.find(t => t.name === this.label)
.properties;
.find(t => t.name === this.label)
.properties;
}
},
},
Expand Down
Loading
Loading