Search in sources :

Example 11 with SKOSResource

use of mom.trd.opentheso.skosapi.SKOSResource in project opentheso by miledrousset.

the class WritePdf method writeConceptSheme.

/**
 * ecri les information du ConceptSheme dans le PDF
 */
private void writeConceptSheme() {
    PdfPTable table = new PdfPTable(2);
    PdfPCell cell1 = new PdfPCell();
    PdfPCell cell2 = new PdfPCell();
    try {
        SKOSResource thesaurus = xmlDocument.getConceptScheme();
        for (SKOSLabel label : thesaurus.getLabelsList()) {
            if (label.getLanguage().equals(codeLang)) {
                String labelValue = label.getLabel();
                if (label.getProperty() == SKOSProperty.prefLabel) {
                    cell1.addElement(new Paragraph(labelValue + " (" + codeLang + ")", titleFont));
                }
            }
        }
        cell1.setBorderWidth(Rectangle.NO_BORDER);
        table.addCell(cell1);
        if (!codeLang2.equals("")) {
            for (SKOSLabel label : thesaurus.getLabelsList()) {
                if (label.getLanguage().equals(codeLang2)) {
                    String labelValue = label.getLabel();
                    if (label.getProperty() == SKOSProperty.prefLabel) {
                        cell2.addElement(new Paragraph(labelValue + " (" + codeLang2 + ")", titleFont));
                    }
                }
            }
        }
        cell2.setBorder(Rectangle.NO_BORDER);
        table.addCell(cell2);
        document.add(new Paragraph(thesaurus.getUri(), subTitleFont));
        document.add(table);
        document.add(new Paragraph(" "));
        document.add(new Paragraph(" "));
    } catch (DocumentException ex) {
        Logger.getLogger(WritePdf.class.getName()).log(Level.SEVERE, null, ex);
    }
}
Also used : PdfPCell(com.itextpdf.text.pdf.PdfPCell) SKOSResource(mom.trd.opentheso.skosapi.SKOSResource) PdfPTable(com.itextpdf.text.pdf.PdfPTable) DocumentException(com.itextpdf.text.DocumentException) SKOSLabel(mom.trd.opentheso.skosapi.SKOSLabel) Paragraph(com.itextpdf.text.Paragraph)

Example 12 with SKOSResource

use of mom.trd.opentheso.skosapi.SKOSResource in project opentheso by miledrousset.

the class WriteRdf4j method writeGroup.

private void writeGroup() {
    for (SKOSResource group : xmlDocument.getGroupList()) {
        builder.subject(vf.createIRI(group.getUri()));
        builder.add(RDF.TYPE, SKOS.COLLECTION);
        writeLabel(group);
        writeRelation(group);
        writeMatch(group);
        writeNotation(group);
        writeDate(group);
        writeIdentifier(group);
        writeCreator(group);
        writeDocumentation(group);
        writeGPS(group);
    }
}
Also used : SKOSResource(mom.trd.opentheso.skosapi.SKOSResource)

Example 13 with SKOSResource

use of mom.trd.opentheso.skosapi.SKOSResource in project opentheso by miledrousset.

the class WriteRdf4j method writeConcept.

private void writeConcept() {
    for (SKOSResource concept : xmlDocument.getConceptList()) {
        builder.subject(vf.createIRI(concept.getUri()));
        builder.add(RDF.TYPE, SKOS.CONCEPT);
        writeLabel(concept);
        writeRelation(concept);
        writeMatch(concept);
        writeNotation(concept);
        writeDate(concept);
        writeIdentifier(concept);
        writeCreator(concept);
        writeDocumentation(concept);
        writeGPS(concept);
    }
}
Also used : SKOSResource(mom.trd.opentheso.skosapi.SKOSResource)

Example 14 with SKOSResource

use of mom.trd.opentheso.skosapi.SKOSResource in project opentheso by miledrousset.

the class ExportRdf4jHelper method addGroup.

/*
    private void addSelectedGroupRecursif(){
        
    }*/
public void addGroup(String idThesaurus, List<NodeLang> selectedLanguages, List<NodeGroup> selectedGroups) {
    rootGroupList = new GroupHelper().getListIdOfRootGroup(ds, idTheso);
    for (String idGroup : rootGroupList) {
        boolean isInselectedGroups = false;
        for (NodeGroup nodeGroup : selectedGroups) {
            if (nodeGroup.getConceptGroup().getIdgroup().equals(idGroup)) {
                isInselectedGroups = true;
                break;
            }
        }
        if (!isInselectedGroups) {
            continue;
        }
        SKOSResource group = new SKOSResource(getUriFromId(idGroup), SKOSProperty.ConceptGroup);
        group.addRelation(getUriFromId(idThesaurus), SKOSProperty.microThesaurusOf);
        addFilsGroupRcursif(idThesaurus, idGroup, group, selectedLanguages);
    }
}
Also used : SKOSResource(mom.trd.opentheso.skosapi.SKOSResource) GroupHelper(mom.trd.opentheso.bdd.helper.GroupHelper) NodeGroup(mom.trd.opentheso.bdd.helper.nodes.group.NodeGroup)

Example 15 with SKOSResource

use of mom.trd.opentheso.skosapi.SKOSResource in project opentheso by miledrousset.

the class ExportRdf4jHelper method addFilsConceptRecursif.

private void addFilsConceptRecursif(String idThesaurus, String idPere, SKOSResource sKOSResource, DownloadBean downloadBean, List<NodeLang> selectedLanguages) {
    ConceptHelper conceptHelper = new ConceptHelper();
    ArrayList<String> listIdsOfConceptChildren = conceptHelper.getListChildrenOfConcept(ds, idPere, idThesaurus);
    writeConceptInfo(conceptHelper, sKOSResource, idThesaurus, idPere, downloadBean, selectedLanguages);
    for (String idOfConceptChildren : listIdsOfConceptChildren) {
        sKOSResource = new SKOSResource();
        // writeConceptInfo(conceptHelper, concept, idThesaurus, idOfConceptChildren, downloadBean, selectedLanguages);
        // if (conceptHelper.haveChildren(ds, idThesaurus, idOfConceptChildren)) {
        addFilsConceptRecursif(idThesaurus, idOfConceptChildren, sKOSResource, downloadBean, selectedLanguages);
    // }
    }
}
Also used : SKOSResource(mom.trd.opentheso.skosapi.SKOSResource) ConceptHelper(mom.trd.opentheso.bdd.helper.ConceptHelper)

Aggregations

SKOSResource (mom.trd.opentheso.skosapi.SKOSResource)20 ConceptHelper (mom.trd.opentheso.bdd.helper.ConceptHelper)5 GroupHelper (mom.trd.opentheso.bdd.helper.GroupHelper)5 SKOSLabel (mom.trd.opentheso.skosapi.SKOSLabel)3 SKOSRelation (mom.trd.opentheso.skosapi.SKOSRelation)3 Paragraph (com.itextpdf.text.Paragraph)2 ArrayList (java.util.ArrayList)2 Thesaurus (mom.trd.opentheso.bdd.datas.Thesaurus)2 ThesaurusHelper (mom.trd.opentheso.bdd.helper.ThesaurusHelper)2 DocumentException (com.itextpdf.text.DocumentException)1 PdfPCell (com.itextpdf.text.pdf.PdfPCell)1 PdfPTable (com.itextpdf.text.pdf.PdfPTable)1 Connection (java.sql.Connection)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 ConceptGroupLabel (mom.trd.opentheso.bdd.datas.ConceptGroupLabel)1 HierarchicalRelationship (mom.trd.opentheso.bdd.datas.HierarchicalRelationship)1 UserHelper (mom.trd.opentheso.bdd.helper.UserHelper)1 NodeEM (mom.trd.opentheso.bdd.helper.nodes.NodeEM)1 NodeLang (mom.trd.opentheso.bdd.helper.nodes.NodeLang)1