Search in sources :

Example 16 with ConceptHelper

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);
}
Also used : ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper)

Example 17 with ConceptHelper

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);
    // }
    }
}
Also used : SKOSResource(mom.trd.opentheso.skosapi.SKOSResource) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper)

Example 18 with ConceptHelper

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);
}
Also used : NodeConceptExport(mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptExport) SKOSResource(mom.trd.opentheso.skosapi.SKOSResource) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) NodeTermTraduction(mom.trd.opentheso.bdd.helper.nodes.term.NodeTermTraduction) NodeNote(mom.trd.opentheso.bdd.helper.nodes.notes.NodeNote) NodeEM(mom.trd.opentheso.bdd.helper.nodes.NodeEM)

Example 19 with ConceptHelper

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;
}
Also used : ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) ThesaurusHelper(mom.trd.opentheso.bdd.helper.ThesaurusHelper) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper) NodeGroup(mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup)

Example 20 with ConceptHelper

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;
}
Also used : ToolsHelper(mom.trd.opentheso.bdd.helper.ToolsHelper) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper)

Aggregations

ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)125 GroupHelper (mom.trd.opentheso.bdd.helper.GroupHelper)38 SQLException (java.sql.SQLException)36 Connection (java.sql.Connection)29 ArrayList (java.util.ArrayList)28 FacesMessage (javax.faces.application.FacesMessage)23 Concept (mom.trd.opentheso.bdd.datas.Concept)18 AlignmentHelper (mom.trd.opentheso.bdd.helper.AlignmentHelper)16 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)16 Term (mom.trd.opentheso.bdd.datas.Term)15 PrefixString (com.k_int.IR.QueryModels.PrefixString)14 RelationsHelper (mom.trd.opentheso.bdd.helper.RelationsHelper)14 HierarchicalRelationship (mom.trd.opentheso.bdd.datas.HierarchicalRelationship)13 NoteHelper (mom.trd.opentheso.bdd.helper.NoteHelper)12 NodeEM (mom.trd.opentheso.bdd.helper.nodes.NodeEM)12 NodeNote (mom.trd.opentheso.bdd.helper.nodes.notes.NodeNote)12 HashMap (java.util.HashMap)9 MyTreeNode (mom.trd.opentheso.bdd.helper.nodes.MyTreeNode)9 NodeConceptExport (mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptExport)9 NodeTerm (mom.trd.opentheso.bdd.helper.nodes.term.NodeTerm)9