use of mom.trd.opentheso.bdd.datas.Thesaurus in project opentheso by miledrousset.
the class ExportRdf4jHelper method addThesaurus.
public void addThesaurus(String idThesaurus, List<NodeLang> selectedLanguages) {
nodeThesaurus = new ThesaurusHelper().getNodeThesaurus(ds, idThesaurus);
String uri = getUriFromId(nodeThesaurus.getIdThesaurus());
SKOSResource conceptScheme = new SKOSResource(uri, SKOSProperty.ConceptScheme);
idTheso = nodeThesaurus.getIdThesaurus();
String creator;
String contributor;
String title;
String language;
for (Thesaurus thesaurus : nodeThesaurus.getListThesaurusTraduction()) {
boolean isInSelectedLanguages = false;
for (NodeLang nodeLang : selectedLanguages) {
if (nodeLang.getCode().equals(thesaurus.getLanguage())) {
isInSelectedLanguages = true;
break;
}
}
if (!isInSelectedLanguages) {
break;
}
creator = thesaurus.getCreator();
contributor = thesaurus.getContributor();
title = thesaurus.getTitle();
language = thesaurus.getLanguage();
/*[...]*/
if (creator != null && !creator.equalsIgnoreCase("null")) {
conceptScheme.addCreator(creator, SKOSProperty.creator);
}
if (contributor != null && !contributor.equalsIgnoreCase("null")) {
conceptScheme.addCreator(creator, SKOSProperty.contributor);
}
if (title != null && language != null) {
conceptScheme.addLabel(title, language, SKOSProperty.prefLabel);
}
// dates
String created = thesaurus.getCreated().toString();
String modified = thesaurus.getModified().toString();
if (created != null) {
conceptScheme.addDate(created, SKOSProperty.created);
}
if (modified != null) {
conceptScheme.addDate(modified, SKOSProperty.modified);
}
}
skosXmlDocument.setConceptScheme(conceptScheme);
}
use of mom.trd.opentheso.bdd.datas.Thesaurus in project opentheso by miledrousset.
the class ImportSkosHelper method addLangsToThesaurus.
private void addLangsToThesaurus(HikariDataSource ds, String idThesaurus) {
ThesaurusHelper thesaurusHelper = new ThesaurusHelper();
Thesaurus thesaurus2 = new Thesaurus();
ArrayList<String> tabListLang = thesaurusHelper.getAllUsedLanguagesOfThesaurus(ds, idThesaurus);
for (String tabListLang1 : tabListLang) {
if (!thesaurusHelper.isLanguageExistOfThesaurus(ds, idThesaurus, tabListLang1)) {
thesaurus2.setId_thesaurus(idThesaurus);
thesaurus2.setContributor("");
thesaurus2.setCoverage("");
thesaurus2.setCreator("");
thesaurus2.setDescription("");
thesaurus2.setFormat("");
thesaurus2.setLanguage(tabListLang1);
thesaurus2.setPublisher("");
thesaurus2.setRelation("");
thesaurus2.setRights("");
thesaurus2.setSource("");
thesaurus2.setSubject("");
thesaurus2.setTitle("theso_" + idThesaurus);
thesaurus2.setType("");
thesaurusHelper.addThesaurusTraduction(ds, thesaurus2);
}
}
}
use of mom.trd.opentheso.bdd.datas.Thesaurus in project opentheso by miledrousset.
the class WriteBranchSkosBDD method addLangsToThesaurus.
public void addLangsToThesaurus(HikariDataSource ds, String idThesaurus) {
ThesaurusHelper thesaurusHelper = new ThesaurusHelper();
ArrayList<String> tabListLang = thesaurusHelper.getAllUsedLanguagesOfThesaurus(ds, idThesaurus);
for (int i = 0; i < tabListLang.size(); i++) {
if (!thesaurusHelper.isLanguageExistOfThesaurus(ds, idThesaurus, tabListLang.get(i).trim())) {
Thesaurus thesaurus = new Thesaurus();
thesaurus.setId_thesaurus(idThesaurus);
thesaurus.setContributor("");
thesaurus.setCoverage("");
thesaurus.setCreator("");
thesaurus.setDescription("");
thesaurus.setFormat("");
thesaurus.setLanguage(tabListLang.get(i));
thesaurus.setPublisher("");
thesaurus.setRelation("");
thesaurus.setRights("");
thesaurus.setSource("");
thesaurus.setSubject("");
thesaurus.setTitle("");
thesaurus.setType("");
thesaurusHelper.addThesaurusTraduction(ds, thesaurus);
}
}
}
use of mom.trd.opentheso.bdd.datas.Thesaurus in project opentheso by miledrousset.
the class ExportTxtHelper method writeHeader.
/**
* permet d'acrire le titre du thésaurus
*
* @return
*/
private void writeHeader(NodeThesaurus nodeThesaurus) {
for (Thesaurus thesaurus : nodeThesaurus.getListThesaurusTraduction()) {
if (thesaurus.getLanguage().equalsIgnoreCase(selectedLang)) {
txtBuff.append(thesaurus.getTitle());
txtBuff.append(" (");
txtBuff.append(idTheso);
txtBuff.append(" )");
}
}
txtBuff.append("\n");
}
use of mom.trd.opentheso.bdd.datas.Thesaurus in project opentheso by miledrousset.
the class ImportTabuleIntoBDD method addLangsToThesaurus.
private void addLangsToThesaurus(HikariDataSource ds, String idThesaurus) {
ThesaurusHelper thesaurusHelper = new ThesaurusHelper();
ArrayList<String> tabListLang = thesaurusHelper.getAllUsedLanguagesOfThesaurus(ds, idThesaurus);
for (String tabListLang1 : tabListLang) {
if (!thesaurusHelper.isLanguageExistOfThesaurus(ds, idThesaurus, tabListLang1.trim())) {
Thesaurus thesaurus = new Thesaurus();
thesaurus.setId_thesaurus(idThesaurus);
thesaurus.setContributor("");
thesaurus.setCoverage("");
thesaurus.setCreator("");
thesaurus.setDescription("");
thesaurus.setFormat("");
thesaurus.setLanguage(tabListLang1);
thesaurus.setPublisher("");
thesaurus.setRelation("");
thesaurus.setRights("");
thesaurus.setSource("");
thesaurus.setSubject("");
thesaurus.setTitle("");
thesaurus.setType("");
thesaurusHelper.addThesaurusTraduction(ds, thesaurus);
}
}
}
Aggregations