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);
}
}
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);
}
}
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);
}
}
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);
}
}
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);
// }
}
}
Aggregations