Skip to content

Commit

Permalink
sig.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
menocsk27 committed Nov 6, 2024
1 parent c6d4d27 commit 720e174
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
4 changes: 2 additions & 2 deletions frontend/public/js/main/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function computeAxiomsBtnFunction() {
body.append('type', 'ce')
}
body.append('signaturePath', proof.signatureFile
? "frontend/public/data/" + getSessionId() + "/" + proof.signatureFile.name
? "frontend/public/data/" + getSessionId() + "/sig.txt"
: "NoSignature");
body.append('translate2NL', document.getElementById('checkboxT2NL').checked);

Expand Down Expand Up @@ -357,7 +357,7 @@ function loadProof(event) {

function loadSignature(event) {
proof.signatureFile = event.target.files[0];
upload(proof.signatureFile);
upload(proof.signatureFile, undefined, 'signature');
}

export { progress, loadProof, loadSignature }
15 changes: 13 additions & 2 deletions server.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import {
lstatSync,
copyFileSync,
readdirSync,
readFileSync
readFileSync,
renameSync,
} from 'fs';
import { v4 as uuidv4 } from 'uuid';
import { createRequire } from "module";
Expand Down Expand Up @@ -290,6 +291,10 @@ app.post('/upload', (req, res) => {
return res.status(500).send(err);
}

if (req.body.type === 'signature') {
renameSync(uploadPath, path.join(uploadsDir, 'sig.txt'));
}

if (req.body.type === 'ontology') {
//Try to translate the ontology file to OWL XML format.
const owlFileName = convertOntology(file, uploadsDir)
Expand Down Expand Up @@ -383,7 +388,13 @@ app.post('/explain', (req, res) => {
const axiom = req.body.lhs + " SubClassOf: " + req.body.rhs;
const ontPath = path.join(projPath, ontology);

const preserve = ['.owl', 'reasoner.txt', 'cnsHierarchy.json', 'cnsOriginal.json'];
const preserve = [
'.owl',
'sig.txt',
'reasoner.txt',
'cnsHierarchy.json',
'cnsOriginal.json'
];

readdirSync(projPath).forEach(function (file) {
for (const p of preserve) {
Expand Down

0 comments on commit 720e174

Please sign in to comment.