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