use of mom.trd.opentheso.core.imports.rdf4j.ReadRdf4j in project opentheso by miledrousset.
the class rdf4jFileBean method chargeJsonLd.
/**
* @param event
*/
public void chargeJsonLd(FileUploadEvent event) {
progress = 0;
if (!PhaseId.INVOKE_APPLICATION.equals(event.getPhaseId())) {
event.setPhaseId(PhaseId.INVOKE_APPLICATION);
event.queue();
} else {
InputStream is = null;
try {
try {
is = event.getFile().getInputstream();
} catch (IOException ex) {
error.append(System.getProperty("line.separator"));
error.append(ex.getMessage());
} catch (Exception ex) {
error.append(System.getProperty("line.separator"));
error.append(ex.getMessage());
}
ReadRdf4j readRdf4j;
try {
readRdf4j = new ReadRdf4j(is, 1);
warning = readRdf4j.getMessage();
progress = 100;
sKOSXmlDocument = readRdf4j.getsKOSXmlDocument();
total = sKOSXmlDocument.getConceptList().size() + sKOSXmlDocument.getGroupList().size() + 1;
uri = sKOSXmlDocument.getTitle();
uploadEnable = false;
BDDinsertEnable = true;
info = "File correctly loaded";
} catch (IOException ex) {
error.append(System.getProperty("line.separator"));
error.append(ex.getMessage());
} catch (Exception ex) {
error.append(System.getProperty("line.separator"));
error.append(ex.getMessage());
}
} catch (Exception e) {
error.append(System.getProperty("line.separator"));
error.append(e.toString());
} finally {
showError();
}
}
}
use of mom.trd.opentheso.core.imports.rdf4j.ReadRdf4j in project opentheso by miledrousset.
the class rdf4jFileBean method chargeJson.
/**
* @param event
*/
public void chargeJson(FileUploadEvent event) {
progress = 0;
if (!PhaseId.INVOKE_APPLICATION.equals(event.getPhaseId())) {
event.setPhaseId(PhaseId.INVOKE_APPLICATION);
event.queue();
} else {
InputStream is = null;
try {
try {
is = event.getFile().getInputstream();
} catch (IOException ex) {
error.append(System.getProperty("line.separator"));
error.append(ex.getMessage());
} catch (Exception ex) {
error.append(System.getProperty("line.separator"));
error.append(ex.getMessage());
}
ReadRdf4j readRdf4j;
try {
readRdf4j = new ReadRdf4j(is, 3);
warning = readRdf4j.getMessage();
progress = 100;
sKOSXmlDocument = readRdf4j.getsKOSXmlDocument();
total = sKOSXmlDocument.getConceptList().size() + sKOSXmlDocument.getGroupList().size() + 1;
uri = sKOSXmlDocument.getTitle();
uploadEnable = false;
BDDinsertEnable = true;
info = "File correctly loaded";
} catch (IOException ex) {
error.append(System.getProperty("line.separator"));
error.append(ex.getMessage());
} catch (Exception ex) {
error.append(System.getProperty("line.separator"));
error.append(ex.getMessage());
}
} catch (Exception e) {
error.append(System.getProperty("line.separator"));
error.append(e.toString());
} finally {
showError();
}
}
}
Aggregations