Search in sources :

Example 6 with NodeEM

use of mom.trd.opentheso.bdd.helper.nodes.NodeEM in project opentheso by miledrousset.

the class WriteBranchSkosBDD method writeConceptAfterGroup.

private void writeConceptAfterGroup(SKOSResource resource, String idGroup, String idThesaurus, String id_langueSource, String dateFormat, String adressSite, boolean useArk, int idUser) {
    // ajout du concept dans la base
    Concept concept = new Concept();
    ConceptHelper conceptHelper = new ConceptHelper();
    String idC = getId(resource.getUri());
    concept.setIdConcept(idC);
    // concept.setCreated(null);
    concept.setIdThesaurus(idThesaurus);
    concept.setNotation("");
    concept.setStatus("");
    concept.setTopConcept(false);
    concept.setIdGroup(idGroup);
    concept = addDates(resource.getDateList(), concept, dateFormat);
    if (idGroup.trim().isEmpty())
        return;
    conceptHelper.insertConceptInTable(ds, concept, idUser);
    // ajout des termes et traductions
    NodeTerm nodeTerm = new NodeTerm();
    nodeTerm.setNodeTermTraduction(getTraductionConcept(resource.getLabelsList()));
    nodeTerm.setIdTerm(idC);
    nodeTerm.setIdConcept(idC);
    nodeTerm.setIdThesaurus(idThesaurus);
    nodeTerm.setSource("");
    nodeTerm.setStatus("");
    nodeTerm = addDatesTerm(resource.getDateList(), nodeTerm, dateFormat);
    TermHelper termHelper = new TermHelper();
    termHelper.insertTerm(ds, nodeTerm, idUser);
    // ajouter les notes
    ArrayList<NodeNote> nodeNoteList = addNotes(resource.getDocumentationsList());
    NoteHelper noteHelper = new NoteHelper();
    for (NodeNote nodeNoteList1 : nodeNoteList) {
        if (nodeNoteList1.getNotetypecode().contains("scopeNote")) {
            noteHelper.addConceptNote(ds, concept.getIdConcept(), nodeNoteList1.getLang(), idThesaurus, nodeNoteList1.getLexicalvalue(), nodeNoteList1.getNotetypecode(), idUser);
        }
        if (nodeNoteList1.getNotetypecode().contains("historyNote")) {
            noteHelper.addConceptNote(ds, concept.getIdConcept(), nodeNoteList1.getLang(), idThesaurus, nodeNoteList1.getLexicalvalue(), nodeNoteList1.getNotetypecode(), idUser);
        }
        if (nodeNoteList1.getNotetypecode().contains("definition")) {
            noteHelper.addTermNote(ds, nodeTerm.getIdTerm(), nodeNoteList1.getLang(), idThesaurus, nodeNoteList1.getLexicalvalue(), nodeNoteList1.getNotetypecode(), idUser);
        }
        if (nodeNoteList1.getNotetypecode().contains("editorialNote")) {
            noteHelper.addTermNote(ds, nodeTerm.getIdTerm(), nodeNoteList1.getLang(), idThesaurus, nodeNoteList1.getLexicalvalue(), nodeNoteList1.getNotetypecode(), idUser);
        }
    }
    // Enregistrer les relations
    writeRelationsList(resource.getRelationsList(), concept.getIdConcept(), idThesaurus, idUser);
    ArrayList<SKOSMapping> sKOSMappings = resource.getMappings();
    // Enregistrer les Mappings (alignements)
    AlignmentHelper alignmentHelper = new AlignmentHelper();
    for (SKOSMapping sKOSMapping : sKOSMappings) {
        if (sKOSMapping.getProperty() == SKOSProperty.exactMatch) {
            alignmentHelper.addNewAlignment(ds, // user
            1, // concept target
            "", // thesaurus target
            "", // URI
            sKOSMapping.getTargetUri(), 1, concept.getIdConcept(), idThesaurus, 0);
        }
        if (sKOSMapping.getProperty() == SKOSProperty.closeMatch) {
            alignmentHelper.addNewAlignment(ds, // user
            1, // concept target
            "", // thesaurus target
            "", // URI
            sKOSMapping.getTargetUri(), 2, concept.getIdConcept(), idThesaurus, 0);
        }
    }
    // Ajouter l'id du concept importé pour l'aligner avec le thésaurus source
    alignmentHelper.addNewAlignment(ds, // user
    1, // concept target
    "", // thesaurus target
    "", // URI de la source
    resource.getUri(), // sKOSMapping.getTargetUri(), // URI
    1, concept.getIdConcept(), idThesaurus, 0);
    // Enregister les synonymes et traductions
    ArrayList<NodeEM> nodeEMs = writeLabelsList(ds, resource.getLabelsList());
    Term term = new Term();
    for (int i = 0; i < nodeEMs.size(); i++) {
        term.setId_concept(concept.getIdConcept());
        term.setId_term(nodeTerm.getIdTerm());
        term.setLexical_value(nodeEMs.get(i).getLexical_value());
        term.setLang(nodeEMs.get(i).getLang());
        term.setId_thesaurus(idThesaurus);
        term.setSource(nodeEMs.get(i).getSource());
        term.setStatus(nodeEMs.get(i).getStatus());
        termHelper.addNonPreferredTerm(ds, term, idUser);
    }
}
Also used : SKOSTopConcept(skos.SKOSTopConcept) Concept(mom.trd.opentheso.bdd.datas.Concept) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) NodeTerm(mom.trd.opentheso.bdd.helper.nodes.term.NodeTerm) NoteHelper(mom.trd.opentheso.bdd.helper.NoteHelper) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) Term(mom.trd.opentheso.bdd.datas.Term) NodeTerm(mom.trd.opentheso.bdd.helper.nodes.term.NodeTerm) NodeEM(mom.trd.opentheso.bdd.helper.nodes.NodeEM) NodeNote(mom.trd.opentheso.bdd.helper.nodes.notes.NodeNote) SKOSMapping(skos.SKOSMapping) TermHelper(mom.trd.opentheso.bdd.helper.TermHelper)

Example 7 with NodeEM

use of mom.trd.opentheso.bdd.helper.nodes.NodeEM in project opentheso by miledrousset.

the class WriteSkosBDD method writeConcept.

public void writeConcept(SKOSResource resource, String idThesaurus, String id_langueSource, String dateFormat, String adressSite, boolean useArk, int idUser) {
    // ajout du concept dans la base
    // boolean isTopConcept = isTopConcept(getId(resource.getUri()));
    boolean isTopConcept = isTopConceptByRelation(resource.getRelationsList());
    Concept concept = new Concept();
    ConceptHelper conceptHelper = new ConceptHelper();
    String id = getId(getId(resource.getUri()));
    if (id == null) {
        System.out.println("identifiant null : " + resource.getUri());
    }
    concept.setIdConcept(getId(getId(resource.getUri())));
    // concept.setCreated(null);
    concept.setIdThesaurus(idThesaurus);
    concept.setNotation("");
    concept.setStatus("");
    concept.setTopConcept(isTopConcept);
    concept = addDates(resource.getDateList(), concept, dateFormat);
    ArrayList<String> idGroup = getGroups(resource.getRelationsList());
    if (!idGroup.isEmpty()) {
        for (String idGroup1 : idGroup) {
            concept.setIdGroup(getId(idGroup1));
            conceptHelper.insertConceptInTable(ds, concept, idUser);
        }
    }
    // ajout des termes et traductions
    NodeTerm nodeTerm = new NodeTerm();
    nodeTerm.setNodeTermTraduction(getTraductionConcept(resource.getLabelsList()));
    String id_term = getId(getId(resource.getUri()));
    if (id_term == null) {
        System.out.println("identifiant null : " + resource.getUri());
    }
    nodeTerm.setIdTerm(getId(getId(resource.getUri())));
    nodeTerm.setIdConcept(getId(resource.getUri()));
    nodeTerm.setIdThesaurus(idThesaurus);
    nodeTerm.setSource("");
    nodeTerm.setStatus("");
    nodeTerm = addDatesTerm(resource.getDateList(), nodeTerm, dateFormat);
    TermHelper termHelper = new TermHelper();
    termHelper.insertTerm(ds, nodeTerm, idUser);
    // ajouter les notes
    ArrayList<NodeNote> nodeNoteList = addNotes(resource.getDocumentationsList());
    NoteHelper noteHelper = new NoteHelper();
    for (NodeNote nodeNoteList1 : nodeNoteList) {
        if (nodeNoteList1.getNotetypecode().contains("scopeNote")) {
            noteHelper.addConceptNote(ds, concept.getIdConcept(), nodeNoteList1.getLang(), idThesaurus, nodeNoteList1.getLexicalvalue(), nodeNoteList1.getNotetypecode(), idUser);
        }
        if (nodeNoteList1.getNotetypecode().contains("historyNote")) {
            noteHelper.addConceptNote(ds, concept.getIdConcept(), nodeNoteList1.getLang(), idThesaurus, nodeNoteList1.getLexicalvalue(), nodeNoteList1.getNotetypecode(), idUser);
        }
        if (nodeNoteList1.getNotetypecode().contains("definition")) {
            noteHelper.addTermNote(ds, nodeTerm.getIdTerm(), nodeNoteList1.getLang(), idThesaurus, nodeNoteList1.getLexicalvalue(), nodeNoteList1.getNotetypecode(), idUser);
        }
        if (nodeNoteList1.getNotetypecode().contains("editorialNote")) {
            noteHelper.addTermNote(ds, nodeTerm.getIdTerm(), nodeNoteList1.getLang(), idThesaurus, nodeNoteList1.getLexicalvalue(), nodeNoteList1.getNotetypecode(), idUser);
        }
    }
    // Enregistrer les relations
    if (isTopConcept) {
        writeRelationsListTopConcept(resource.getRelationsList(), concept.getIdConcept(), idThesaurus, idUser);
    } else {
        writeRelationsList(resource.getRelationsList(), concept.getIdConcept(), idThesaurus, idUser);
    }
    ArrayList<SKOSMapping> sKOSMappings = resource.getMappings();
    // Enregistrer les Mappings (alignements)
    AlignmentHelper alignmentHelper = new AlignmentHelper();
    for (SKOSMapping sKOSMapping : sKOSMappings) {
        if (sKOSMapping.getProperty() == SKOSProperty.exactMatch) {
            alignmentHelper.addNewAlignment(ds, // user
            1, // concept target
            "", // thesaurus target
            "", // URI
            sKOSMapping.getTargetUri(), 1, concept.getIdConcept(), idThesaurus, 0);
        }
        if (sKOSMapping.getProperty() == SKOSProperty.closeMatch) {
            alignmentHelper.addNewAlignment(ds, // user
            1, // concept target
            "", // thesaurus target
            "", // URI
            sKOSMapping.getTargetUri(), 2, concept.getIdConcept(), idThesaurus, 0);
        }
    }
    // Enregister les synonymes et traductions
    ArrayList<NodeEM> nodeEMs = writeLabelsList(ds, resource.getLabelsList());
    Term term = new Term();
    for (int i = 0; i < nodeEMs.size(); i++) {
        term.setId_concept(concept.getIdConcept());
        term.setId_term(nodeTerm.getIdTerm());
        term.setLexical_value(nodeEMs.get(i).getLexical_value());
        term.setLang(nodeEMs.get(i).getLang());
        term.setId_thesaurus(idThesaurus);
        term.setSource(nodeEMs.get(i).getSource());
        term.setStatus(nodeEMs.get(i).getStatus());
        termHelper.addNonPreferredTerm(ds, term, idUser);
    }
}
Also used : SKOSTopConcept(skos.SKOSTopConcept) Concept(mom.trd.opentheso.bdd.datas.Concept) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper) NodeTerm(mom.trd.opentheso.bdd.helper.nodes.term.NodeTerm) NoteHelper(mom.trd.opentheso.bdd.helper.NoteHelper) AlignmentHelper(mom.trd.opentheso.bdd.helper.AlignmentHelper) Term(mom.trd.opentheso.bdd.datas.Term) NodeTerm(mom.trd.opentheso.bdd.helper.nodes.term.NodeTerm) NodeEM(mom.trd.opentheso.bdd.helper.nodes.NodeEM) NodeNote(mom.trd.opentheso.bdd.helper.nodes.notes.NodeNote) SKOSMapping(skos.SKOSMapping) TermHelper(mom.trd.opentheso.bdd.helper.TermHelper)

Example 8 with NodeEM

use of mom.trd.opentheso.bdd.helper.nodes.NodeEM in project opentheso by miledrousset.

the class ImportRdf4jHelper method finalizeAddConceptStruct.

private void finalizeAddConceptStruct(AddConceptsStruct acs) throws SQLException {
    acs.termHelper.insertTerm(ds, acs.nodeTerm, idUser);
    RelationsHelper relationsHelper = new RelationsHelper();
    for (HierarchicalRelationship hierarchicalRelationship : acs.hierarchicalRelationships) {
        if (!relationsHelper.insertHierarchicalRelation(ds, hierarchicalRelationship.getIdConcept1(), hierarchicalRelationship.getIdThesaurus(), hierarchicalRelationship.getRole(), hierarchicalRelationship.getIdConcept2())) {
            // System.out.println("Erreur sur la relation = " + acs.concept.getIdConcept() + " ## " + hierarchicalRelationship.getRole());
            message.append(System.getProperty("line.separator"));
            message.append("Erreur sur la relation = ");
            message.append(acs.concept.getIdConcept());
            message.append(" ## ");
            message.append(hierarchicalRelationship.getRole());
        }
    }
    // For Term : definition; editorialNote; historyNote;
    for (NodeNote nodeNoteList1 : acs.nodeNotes) {
        if (nodeNoteList1.getNotetypecode().equals("customnote") || nodeNoteList1.getNotetypecode().equals("scopeNote") || nodeNoteList1.getNotetypecode().equals("historyNote") || nodeNoteList1.getNotetypecode().equals("note")) {
            acs.noteHelper.addConceptNote(ds, acs.concept.getIdConcept(), nodeNoteList1.getLang(), idTheso, nodeNoteList1.getLexicalvalue(), nodeNoteList1.getNotetypecode(), idUser);
        }
        if (nodeNoteList1.getNotetypecode().equals("definition") || nodeNoteList1.getNotetypecode().equals("editorialNote")) {
            acs.noteHelper.addTermNote(ds, acs.nodeTerm.getIdTerm(), nodeNoteList1.getLang(), idTheso, nodeNoteList1.getLexicalvalue(), nodeNoteList1.getNotetypecode(), idUser);
        }
    }
    for (NodeAlignment nodeAlignment : acs.nodeAlignments) {
        acs.alignmentHelper.addNewAlignment(ds, nodeAlignment);
    }
    for (NodeEM nodeEMList1 : acs.nodeEMList) {
        acs.term.setId_concept(acs.concept.getIdConcept());
        acs.term.setId_term(acs.nodeTerm.getIdTerm());
        acs.term.setLexical_value(nodeEMList1.getLexical_value());
        acs.term.setLang(nodeEMList1.getLang());
        acs.term.setId_thesaurus(thesaurus.getId_thesaurus());
        acs.term.setSource(nodeEMList1.getSource());
        acs.term.setStatus(nodeEMList1.getStatus());
        acs.termHelper.addNonPreferredTerm(ds, acs.term, idUser);
    }
    if (acs.nodeGps.getLatitude() != null && acs.nodeGps.getLongitude() != null) {
        // insertion des données GPS
        acs.gpsHelper.insertCoordonees(ds, acs.concept.getIdConcept(), thesaurus.getId_thesaurus(), acs.nodeGps.getLatitude(), acs.nodeGps.getLongitude());
    }
    for (String idTopConcept1 : idTopConcept) {
        if (!acs.conceptHelper.setTopConcept(ds, idTopConcept1, thesaurus.getId_thesaurus())) {
        // erreur;
        }
    }
    // initialisation des variables
    acs.concept = new Concept();
    acs.nodeTerm = new NodeTerm();
    acs.nodeTermTraductionList = new ArrayList<>();
    acs.nodeEMList = new ArrayList<>();
    acs.nodeNotes = new ArrayList<>();
    acs.nodeAlignments = new ArrayList<>();
    acs.hierarchicalRelationships = new ArrayList<>();
    acs.idGrps = new ArrayList<>();
    acs.isTopConcept = false;
    acs.nodeGps = new NodeGps();
}
Also used : Concept(mom.trd.opentheso.bdd.datas.Concept) NodeAlignment(mom.trd.opentheso.bdd.helper.nodes.NodeAlignment) NodeTerm(mom.trd.opentheso.bdd.helper.nodes.term.NodeTerm) HierarchicalRelationship(mom.trd.opentheso.bdd.datas.HierarchicalRelationship) NodeGps(mom.trd.opentheso.bdd.helper.nodes.NodeGps) NodeNote(mom.trd.opentheso.bdd.helper.nodes.notes.NodeNote) RelationsHelper(mom.trd.opentheso.bdd.helper.RelationsHelper) NodeEM(mom.trd.opentheso.bdd.helper.nodes.NodeEM)

Example 9 with NodeEM

use of mom.trd.opentheso.bdd.helper.nodes.NodeEM in project opentheso by miledrousset.

the class WriteAltLabel method AddAltLabelByGroup.

public void AddAltLabelByGroup(HikariDataSource ds, String idTheso, String idGroup, String idLang) {
    boolean passed = false;
    // ConceptHelper conceptHelper = new ConceptHelper();
    TermHelper termHelper = new TermHelper();
    NoteHelper noteHelper = new NoteHelper();
    // ArrayList<NodeConceptArkId> allIds = conceptHelper.getAllConceptArkIdOfThesaurus(conn, idTheso);
    ArrayList<NodeEM> nodeEMs;
    ArrayList<NodeTab2Levels> nodeConceptTermId = termHelper.getAllIdOfNonPreferredTermsByGroup(ds, idTheso, idGroup);
    Term term;
    ArrayList<NodeNote> nodeNotes;
    for (NodeTab2Levels nodeTab2Levels : nodeConceptTermId) {
        nodeEMs = termHelper.getNonPreferredTerms(ds, nodeTab2Levels.getIdTerm(), idTheso, idLang);
        if (!nodeEMs.isEmpty()) {
            term = termHelper.getThisTerm(ds, nodeTab2Levels.getIdConcept(), idTheso, idLang);
            nodeNotes = noteHelper.getListNotesTerm(ds, nodeTab2Levels.getIdTerm(), idTheso, idLang);
            // écriture dans le fichier
            stringBuilder.append(nodeTab2Levels.getIdConcept());
            stringBuilder.append("\t");
            stringBuilder.append(term.getLexical_value());
            stringBuilder.append("\t");
            for (NodeEM nodeEM : nodeEMs) {
                if (passed) {
                    stringBuilder.append("##");
                }
                stringBuilder.append(nodeEM.getLexical_value());
                passed = true;
            }
            passed = false;
            stringBuilder.append("\t");
            for (NodeNote nodeNote : nodeNotes) {
                if (nodeNote.getNotetypecode().equalsIgnoreCase("definition")) {
                    if (passed) {
                        stringBuilder.append("##");
                    }
                    stringBuilder.append(nodeNote.getLexicalvalue());
                    passed = true;
                }
            }
            stringBuilder.append("\n");
        }
        passed = false;
    }
// System.out.println(stringBuilder.toString());
}
Also used : NodeTab2Levels(mom.trd.opentheso.bdd.helper.nodes.NodeTab2Levels) NoteHelper(mom.trd.opentheso.bdd.helper.NoteHelper) Term(mom.trd.opentheso.bdd.datas.Term) NodeNote(mom.trd.opentheso.bdd.helper.nodes.notes.NodeNote) TermHelper(mom.trd.opentheso.bdd.helper.TermHelper) NodeEM(mom.trd.opentheso.bdd.helper.nodes.NodeEM)

Example 10 with NodeEM

use of mom.trd.opentheso.bdd.helper.nodes.NodeEM in project opentheso by miledrousset.

the class ExportTabulateHelper method writeConcepts.

private boolean writeConcepts() {
    ArrayList<NodeConceptExport> nodeConceptExports = thesaurusDatas.getNodeConceptExports();
    boolean first = true;
    ArrayList<NodeNote> nodeNoteDefinition = new ArrayList<>();
    ArrayList<NodeNote> nodeNoteScope = new ArrayList<>();
    ArrayList<NodeNote> nodeNoteHistory = new ArrayList<>();
    ArrayList<NodeNote> nodeNoteEditorial = new ArrayList<>();
    ArrayList<String> listLangues = new ArrayList<>();
    for (NodeLang selectedLanguage : selectedLanguages) {
        listLangues.add(selectedLanguage.getCode());
    }
    for (NodeConceptExport nodeConceptExport : nodeConceptExports) {
        nodeNoteDefinition.clear();
        nodeNoteScope.clear();
        nodeNoteHistory.clear();
        nodeNoteEditorial.clear();
        // id
        tabulateBuff.append(nodeConceptExport.getConcept().getIdConcept());
        tabulateBuff.append(";");
        // idArk
        if (nodeConceptExport.getConcept().getIdArk() == null) {
            tabulateBuff.append("");
        } else {
            tabulateBuff.append(nodeConceptExport.getConcept().getIdArk());
        }
        tabulateBuff.append(";");
        // type
        if (nodeConceptExport.getConcept().isTopConcept()) {
            tabulateBuff.append("TT");
        } else {
            tabulateBuff.append("DE");
        }
        tabulateBuff.append(";");
        // preflabel
        for (NodeTermTraduction nodeTermTraduction : nodeConceptExport.getNodeTermTraductions()) {
            if (listLangues.contains(nodeTermTraduction.getLang())) {
                if (!first) {
                    tabulateBuff.append("##");
                }
                tabulateBuff.append(nodeTermTraduction.getLexicalValue());
                tabulateBuff.append("::");
                tabulateBuff.append(nodeTermTraduction.getLang());
                first = false;
            }
        }
        tabulateBuff.append(";");
        // altLabel
        first = true;
        for (NodeEM nodeEM : nodeConceptExport.getNodeEM()) {
            if (listLangues.contains(nodeEM.getLang())) {
                if (!first) {
                    tabulateBuff.append("##");
                }
                tabulateBuff.append(nodeEM.getLexical_value());
                tabulateBuff.append("::");
                tabulateBuff.append(nodeEM.getLang());
                first = false;
            }
        }
        tabulateBuff.append(";");
        // inScheme
        first = true;
        for (NodeUri nodeUri : nodeConceptExport.getNodeListIdsOfConceptGroup()) {
            if (!first) {
                tabulateBuff.append("##");
            }
            tabulateBuff.append(nodeUri.getIdConcept());
            first = false;
        }
        tabulateBuff.append(";");
        // broader
        first = true;
        for (NodeHieraRelation node : nodeConceptExport.getNodeListOfBT()) {
            if (!first) {
                tabulateBuff.append("##");
            }
            tabulateBuff.append(node.getUri().getIdConcept());
            first = false;
        }
        tabulateBuff.append(";");
        // narrower
        first = true;
        for (NodeHieraRelation node : nodeConceptExport.getNodeListOfNT()) {
            if (!first) {
                tabulateBuff.append("##");
            }
            tabulateBuff.append(node.getUri().getIdConcept());
            first = false;
        }
        tabulateBuff.append(";");
        // related
        first = true;
        for (NodeHieraRelation nodeUri : nodeConceptExport.getNodeListIdsOfRT()) {
            if (!first) {
                tabulateBuff.append("##");
            }
            tabulateBuff.append(nodeUri.getUri().getIdConcept());
            first = false;
        }
        tabulateBuff.append(";");
        // alignment
        first = true;
        for (NodeAlignment nodeAlignment : nodeConceptExport.getNodeAlignmentsList()) {
            if (!first) {
                tabulateBuff.append("##");
            }
            if (nodeAlignment.getAlignement_id_type() == 1) {
                tabulateBuff.append("exactMatch::");
                tabulateBuff.append(nodeAlignment.getUri_target());
            }
            if (nodeAlignment.getAlignement_id_type() == 2) {
                tabulateBuff.append("closeMatch::");
                tabulateBuff.append(nodeAlignment.getUri_target());
            }
            first = false;
        }
        tabulateBuff.append(";");
        // types : definition; editorialNote; historyNote ; scopeNote
        for (NodeNote nodeNote : nodeConceptExport.getNodeNoteConcept()) {
            nodeNote.setLexicalvalue(nodeNote.getLexicalvalue().replace('\r', ' '));
            nodeNote.setLexicalvalue(nodeNote.getLexicalvalue().replace('\n', ' '));
            if (nodeNote.getNotetypecode().equalsIgnoreCase("definition")) {
                nodeNoteDefinition.add(nodeNote);
            }
            if (nodeNote.getNotetypecode().equalsIgnoreCase("editorialNote")) {
                nodeNoteEditorial.add(nodeNote);
            }
            if (nodeNote.getNotetypecode().equalsIgnoreCase("historyNote")) {
                nodeNoteHistory.add(nodeNote);
            }
            if (nodeNote.getNotetypecode().equalsIgnoreCase("scopeNote")) {
                nodeNoteScope.add(nodeNote);
            }
        }
        // types : definition; editorialNote; historyNote ; scopeNote
        for (NodeNote nodeNote : nodeConceptExport.getNodeNoteTerm()) {
            nodeNote.setLexicalvalue(nodeNote.getLexicalvalue().replace('\r', ' '));
            nodeNote.setLexicalvalue(nodeNote.getLexicalvalue().replace('\n', ' '));
            if (nodeNote.getNotetypecode().equalsIgnoreCase("definition")) {
                nodeNoteDefinition.add(nodeNote);
            }
            if (nodeNote.getNotetypecode().equalsIgnoreCase("editorialNote")) {
                nodeNoteEditorial.add(nodeNote);
            }
            if (nodeNote.getNotetypecode().equalsIgnoreCase("historyNote")) {
                nodeNoteHistory.add(nodeNote);
            }
            if (nodeNote.getNotetypecode().equalsIgnoreCase("scopeNote")) {
                nodeNoteScope.add(nodeNote);
            }
        }
        // definition
        first = true;
        for (NodeNote nodeNote : nodeNoteDefinition) {
            if (listLangues.contains(nodeNote.getLang())) {
                if (!first) {
                    tabulateBuff.append("##");
                }
                tabulateBuff.append(nodeNote.getLexicalvalue());
                tabulateBuff.append("::");
                tabulateBuff.append(nodeNote.getLang());
                first = false;
            }
        }
        tabulateBuff.append(";");
        // scopeNote
        first = true;
        for (NodeNote nodeNote : nodeNoteScope) {
            if (listLangues.contains(nodeNote.getLang())) {
                if (!first) {
                    tabulateBuff.append("##");
                }
                tabulateBuff.append(nodeNote.getLexicalvalue());
                tabulateBuff.append("::");
                tabulateBuff.append(nodeNote.getLang());
                first = false;
            }
        }
        tabulateBuff.append(";");
        // historyNote
        first = true;
        for (NodeNote nodeNote : nodeNoteHistory) {
            if (listLangues.contains(nodeNote.getLang())) {
                if (!first) {
                    tabulateBuff.append("##");
                }
                tabulateBuff.append(nodeNote.getLexicalvalue());
                tabulateBuff.append("::");
                tabulateBuff.append(nodeNote.getLang());
                first = false;
            }
        }
        tabulateBuff.append(";");
        // editorialNote
        first = true;
        for (NodeNote nodeNote : nodeNoteEditorial) {
            if (listLangues.contains(nodeNote.getLang())) {
                if (!first) {
                    tabulateBuff.append("##");
                }
                tabulateBuff.append(nodeNote.getLexicalvalue());
                tabulateBuff.append("::");
                tabulateBuff.append(nodeNote.getLang());
                first = false;
            }
        }
        tabulateBuff.append(";");
        // dates
        tabulateBuff.append(nodeConceptExport.getConcept().getCreated());
        tabulateBuff.append(";");
        tabulateBuff.append(nodeConceptExport.getConcept().getModified());
        tabulateBuff.append("\n");
        first = true;
    }
    return true;
}
Also used : NodeConceptExport(mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptExport) ArrayList(java.util.ArrayList) NodeUri(mom.trd.opentheso.bdd.helper.nodes.NodeUri) NodeTermTraduction(mom.trd.opentheso.bdd.helper.nodes.term.NodeTermTraduction) NodeEM(mom.trd.opentheso.bdd.helper.nodes.NodeEM) NodeAlignment(mom.trd.opentheso.bdd.helper.nodes.NodeAlignment) NodeHieraRelation(mom.trd.opentheso.bdd.helper.nodes.NodeHieraRelation) NodeLang(mom.trd.opentheso.bdd.helper.nodes.NodeLang) NodeNote(mom.trd.opentheso.bdd.helper.nodes.notes.NodeNote)

Aggregations

NodeEM (mom.trd.opentheso.bdd.helper.nodes.NodeEM)28 NodeNote (mom.trd.opentheso.bdd.helper.nodes.notes.NodeNote)17 TermHelper (mom.trd.opentheso.bdd.helper.TermHelper)13 Term (mom.trd.opentheso.bdd.datas.Term)12 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)12 NoteHelper (mom.trd.opentheso.bdd.helper.NoteHelper)11 NodeTermTraduction (mom.trd.opentheso.bdd.helper.nodes.term.NodeTermTraduction)11 Concept (mom.trd.opentheso.bdd.datas.Concept)10 NodeTerm (mom.trd.opentheso.bdd.helper.nodes.term.NodeTerm)10 AlignmentHelper (mom.trd.opentheso.bdd.helper.AlignmentHelper)9 SQLException (java.sql.SQLException)8 Connection (java.sql.Connection)7 ArrayList (java.util.ArrayList)7 NodeAlignment (mom.trd.opentheso.bdd.helper.nodes.NodeAlignment)5 SKOSMapping (skos.SKOSMapping)5 SKOSTopConcept (skos.SKOSTopConcept)5 ResultSet (java.sql.ResultSet)4 Statement (java.sql.Statement)4 HierarchicalRelationship (mom.trd.opentheso.bdd.datas.HierarchicalRelationship)4 NodeConceptExport (mom.trd.opentheso.bdd.helper.nodes.concept.NodeConceptExport)4