use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.
the class AlignementParLotBean method prevPosition.
/**
* Cette fonction permet de passer au concept précédant
*/
public void prevPosition() {
if (position <= 0) {
return;
}
erreur = "";
AlignmentHelper alignmentHelper = new AlignmentHelper();
ConceptHelper conceptHelper = new ConceptHelper();
if (optionNonAligned == optionOfAlignement) {
position--;
if (position >= 0) {
id_concept = listOfChildrenInConcept.get(position);
}
checkEndConcepts();
while (alignmentHelper.isAlignedWithThisSource(connect.getPoolConnexion(), id_concept, id_theso, selectedTerme.alignementSource.getId())) {
// alignement_id_type)) {
position--;
if (first) {
return;
}
if (position >= 0) {
id_concept = listOfChildrenInConcept.get(position);
}
checkEndConcepts();
}
nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
}
if ((optionAllBranch == optionOfAlignement) || (optionWorkFlow == optionOfAlignement)) {
position--;
checkEndConcepts();
if (position >= 0) {
id_concept = listOfChildrenInConcept.get(position);
} else {
return;
}
nomduterm = conceptHelper.getLexicalValueOfConcept(connect.getPoolConnexion(), id_concept, selectedTerme.getIdTheso(), selectedTerme.getIdlangue());
}
selectedTerme.creerAlignAuto(id_concept, nomduterm);
listConceptTrates.remove(id_concept);
}
use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.
the class ExportRdf4jHelper method addFilsConceptRecursif.
private void addFilsConceptRecursif(String idThesaurus, String idPere, SKOSResource sKOSResource) {
ConceptHelper conceptHelper = new ConceptHelper();
ArrayList<String> listIdsOfConceptChildren = conceptHelper.getListChildrenOfConcept(ds, idPere, idThesaurus);
writeConceptInfo(conceptHelper, sKOSResource, idThesaurus, idPere);
for (String idOfConceptChildren : listIdsOfConceptChildren) {
sKOSResource = new SKOSResource();
// writeConceptInfo(conceptHelper, concept, idThesaurus, idOfConceptChildren, downloadBean, selectedLanguages);
// if (conceptHelper.haveChildren(ds, idThesaurus, idOfConceptChildren)) {
addFilsConceptRecursif(idThesaurus, idOfConceptChildren, sKOSResource);
// }
}
}
use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.
the class ExportRdf4jHelper method addSignleConcept.
public void addSignleConcept(String idThesaurus, String idConcept) {
idTheso = idThesaurus;
ConceptHelper conceptHelper = new ConceptHelper();
SKOSResource sKOSResource = new SKOSResource();
NodeConceptExport nodeConcept = conceptHelper.getConceptForExport(ds, idConcept, idThesaurus, false);
if (nodeConcept == null) {
return;
}
// concept.setUri(getUriFromId(idConcept));
sKOSResource.setUri(getUri(nodeConcept));
sKOSResource.setProperty(SKOSProperty.Concept);
// prefLabel
for (NodeTermTraduction traduction : nodeConcept.getNodeTermTraductions()) {
sKOSResource.addLabel(traduction.getLexicalValue(), traduction.getLang(), SKOSProperty.prefLabel);
}
// altLabel
for (NodeEM nodeEM : nodeConcept.getNodeEM()) {
sKOSResource.addLabel(nodeEM.getLexical_value(), nodeEM.getLang(), SKOSProperty.altLabel);
}
ArrayList<NodeNote> nodeNotes = nodeConcept.getNodeNoteConcept();
nodeNotes.addAll(nodeConcept.getNodeNoteTerm());
addNoteGiven(nodeNotes, sKOSResource);
addGPSGiven(nodeConcept.getNodeGps(), sKOSResource);
addAlignementGiven(nodeConcept.getNodeAlignmentsList(), sKOSResource);
addRelationGiven(nodeConcept.getNodeListOfBT(), nodeConcept.getNodeListOfNT(), nodeConcept.getNodeListIdsOfRT(), sKOSResource, nodeConcept.getConcept().getIdThesaurus());
String notation = nodeConcept.getConcept().getNotation();
String created = nodeConcept.getConcept().getCreated().toString();
String modified = nodeConcept.getConcept().getModified().toString();
if (notation != null && !notation.equals("null")) {
sKOSResource.addNotation(notation);
}
if (created != null) {
sKOSResource.addDate(created, SKOSProperty.created);
}
if (modified != null) {
sKOSResource.addDate(modified, SKOSProperty.modified);
}
sKOSResource.addRelation(getUriFromId(idTheso), SKOSProperty.inScheme);
sKOSResource.addIdentifier(idConcept, SKOSProperty.identifier);
skosXmlDocument.addconcept(sKOSResource);
}
use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.
the class ThesaurusDatas method exportAllDatas.
/**
* permet de récupérer toutes les données d'un thésaurus
* puis les chargées dans les variables de la classe
* en filrant par langue et Groupe
*
* @param ds
* @param idThesaurus
* @param selectedLanguages
* @param selectedGroups
* @return
*/
public boolean exportAllDatas(HikariDataSource ds, String idThesaurus, List<NodeLang> selectedLanguages, List<NodeGroup> selectedGroups) {
// récupération du thésaurus
this.nodeThesaurus = new ThesaurusHelper().getNodeThesaurus(ds, idThesaurus);
// ArrayList<String> idGroups = new GroupHelper().getListIdOfGroup(ds, idThesaurus);
for (NodeGroup nodeGroup : selectedGroups) {
this.nodeGroupLabels.add(new GroupHelper().getNodeGroupLabel(ds, nodeGroup.getConceptGroup().getIdgroup(), idThesaurus));
// System.out.println("idGroup = : " + idGroup);
}
// récupération des ids des Tops Concepts
// nodeTTs = new ConceptHelper().getAllListIdsOfTopConcepts(ds, idThesaurus);
ArrayList<String> listTopConcept;
for (NodeGroup nodeGroup : selectedGroups) {
listTopConcept = new ConceptHelper().getListIdsOfTopConcepts(ds, nodeGroup.getConceptGroup().getIdgroup(), idThesaurus);
// récupération de tous les concepts
for (String idTop : listTopConcept) {
new ConceptHelper().exportAllConcepts(ds, idTop, idThesaurus, nodeConceptExports);
}
}
return true;
}
use of mom.trd.opentheso.bdd.helper.ConceptHelper in project opentheso by miledrousset.
the class ImportSkosHelper method getNewId.
private String getNewId() {
ConceptHelper conceptHelper = new ConceptHelper();
ToolsHelper toolsHelper = new ToolsHelper();
String id = toolsHelper.getNewId(10);
while (conceptHelper.isIdExiste(ds, id, thesaurus.getId_thesaurus())) {
id = toolsHelper.getNewId(10);
}
return id;
}
Aggregations