Search in sources :

Example 1 with SKOSResource

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

the class WritePdf method writeAlphabetiquePDF.

/**
 * ecri un thésaurus en PDF par ordre alphabetique
 */
private void writeAlphabetiquePDF(ArrayList<Paragraph> paragraphs, String langue, String langue2, boolean isTrad) {
    ArrayList<SKOSResource> conceptList = xmlDocument.getConceptList();
    System.setProperty("java.util.Arrays.useLegacyMergeSort", "true");
    Collections.sort(conceptList, sortAlphabeticInLang(isTrad, langue, langue2, idToNameHashMap, idToIsTrad, resourceChecked));
    for (SKOSResource concept : conceptList) {
        writeTerm(concept, paragraphs, langue, langue2);
    }
}
Also used : SKOSResource(mom.trd.opentheso.skosapi.SKOSResource)

Example 2 with SKOSResource

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

the class WriteRdf4j method writeConceptScheme.

private void writeConceptScheme() {
    if (xmlDocument.getConceptScheme() == null) {
        return;
    }
    SKOSResource conceptScheme = xmlDocument.getConceptScheme();
    // createURI(conceptScheme.getUri()));
    builder.subject(vf.createIRI(conceptScheme.getUri()));
    builder.add(RDF.TYPE, SKOS.CONCEPT_SCHEME);
    writeLabel(conceptScheme);
    writeRelation(conceptScheme);
    writeMatch(conceptScheme);
    writeNotation(conceptScheme);
    writeDate(conceptScheme);
    writeIdentifier(conceptScheme);
    writeCreator(conceptScheme);
    writeDocumentation(conceptScheme);
    writeGPS(conceptScheme);
}
Also used : SKOSResource(mom.trd.opentheso.skosapi.SKOSResource)

Example 3 with SKOSResource

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

the class ExportRdf4jHelper method addConcept.

public void addConcept(String idThesaurus, DownloadBean downloadBean, List<NodeLang> selectedLanguages) {
    // récupération de tous les concepts
    for (NodeUri nodeTT1 : nodeTTs) {
        SKOSResource sKOSResource = new SKOSResource();
        sKOSResource.addRelation(getUriFromId(idTheso), SKOSProperty.topConceptOf);
        // fils top concept
        addFilsConceptRecursif(idThesaurus, nodeTT1.getIdConcept(), sKOSResource, downloadBean, selectedLanguages);
    }
}
Also used : SKOSResource(mom.trd.opentheso.skosapi.SKOSResource) NodeUri(mom.trd.opentheso.bdd.helper.nodes.NodeUri)

Example 4 with SKOSResource

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

the class ExportRdf4jHelper method addBranch.

public void addBranch(String idThesaurus, String idConcept) {
    idTheso = idThesaurus;
    addFilsConceptRecursif(idTheso, idConcept, new SKOSResource());
}
Also used : SKOSResource(mom.trd.opentheso.skosapi.SKOSResource)

Example 5 with SKOSResource

use of mom.trd.opentheso.skosapi.SKOSResource 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);
}
Also used : SKOSResource(mom.trd.opentheso.skosapi.SKOSResource) Thesaurus(mom.trd.opentheso.bdd.datas.Thesaurus) NodeThesaurus(mom.trd.opentheso.bdd.helper.nodes.thesaurus.NodeThesaurus) ThesaurusHelper(mom.trd.opentheso.bdd.helper.ThesaurusHelper) NodeLang(mom.trd.opentheso.bdd.helper.nodes.NodeLang)

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