Skip to content
Snippets Groups Projects
Commit 0f3e807f14b3 authored by Olivier Giorgis's avatar Olivier Giorgis
Browse files

feat: add graph_uri field

parent f62131463bda
No related branches found
No related tags found
1 merge request!22Export data into SPARQL endpoint
Pipeline #228918 passed
......@@ -179,7 +179,7 @@
export function useApiCreateRecipe() {
const client = useClient();
const insertRql =
"INSERT ImportRecipe X: X name %(name)s, X process_type %(process_type)s";
"INSERT ImportRecipe X: X name %(name)s, X graph_uri %(graph_uri)s, X process_type %(process_type)s";
const setDataServiceRql =
"SET X dataservice %(dataservice)s WHERE X eid %(eid)s";
const setProjectRql =
......@@ -188,6 +188,7 @@
const transaction = new Transaction();
const insertQuery = transaction.push(insertRql, {
name: data.name,
graph_uri: data.graph_uri,
process_type: data.process_type,
});
const eidRef = insertQuery.ref().row(0).column(0);
......@@ -211,8 +212,8 @@
"X virtuoso_password ATTR_VIRTUOSO_PASSWORD, X activated ATTR_ACTIVATED, X ontology_file REL_ONTOLOGY?, X shacl_files REL_SHACL?";
const recipeListRql =
"Any X, ATTR_NAME, ATTR_PROCESS_TYPE , REL_DATASERVICE " +
"WHERE X is ImportRecipe, X name ATTR_NAME, X process_type ATTR_PROCESS_TYPE, X dataservice REL_DATASERVICE, O import_recipes X, O eid %(eid)s";
"Any X, ATTR_NAME, ATTR_GRAPH_URI, ATTR_PROCESS_TYPE ,REL_DATASERVICE " +
"WHERE X is ImportRecipe, X name ATTR_NAME, X graph_uri ATTR_GRAPH_URI, X process_type ATTR_PROCESS_TYPE, X dataservice REL_DATASERVICE, O import_recipes X, O eid %(eid)s";
return async (eid: number) => {
try {
......@@ -233,7 +234,8 @@
eid: r[0],
name: r[1],
process_type: r[2],
dataservice: r[3],
graph_uri: r[3],
dataservice: r[4],
}) as Recipe,
);
......
......@@ -130,6 +130,22 @@
)}
/>
<Controller
name="graph_uri"
control={control}
rules={{ required: true }}
render={({ field, fieldState: { error } }) => (
<TextField
label="Graph Uri"
disabled={saving}
{...field}
error={error !== undefined}
helperText={
error?.type === "required" ? "Champ requis" : error?.message
}
/>
)}
/>
<Controller
name="process_type"
control={control}
rules={{ required: true }}
......
......@@ -29,6 +29,7 @@
eid: number;
name: string;
dataservice: number;
graph_uri: string;
process_type: "default" | "default-dryrun";
};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment