use of org.eclipse.rdf4j.rio.RDFFormat in project opentheso by miledrousset.
the class RestRDFHelper method brancheOfConceptsTop.
/**
* Fonction qui permet de récupérer une branche complète en partant d'un
* concept et en allant jusqu'à la racine (vers le haut)
*
* @param ds
* @param idConcept
* @param idTheso
* @param format
* @return skos
*/
public String brancheOfConceptsTop(HikariDataSource ds, String idConcept, String idTheso, String format) {
RDFFormat rDFFormat = getRDFFormat(format);
WriteRdf4j writeRdf4j = brancheOfConceptsTop__(ds, idConcept, idTheso);
if (writeRdf4j == null)
return null;
ByteArrayOutputStream out;
out = new ByteArrayOutputStream();
Rio.write(writeRdf4j.getModel(), out, rDFFormat);
return out.toString();
}
use of org.eclipse.rdf4j.rio.RDFFormat in project opentheso by miledrousset.
the class RestRDFHelper method exportGroup.
/**
* Permet de retourner un group au format défini en passant par un identifiant Ark
* utilisé pour la négociation de contenu
*
* @param ds
* @param idArk
* @param format
* @return
*/
public String exportGroup(HikariDataSource ds, String idArk, String format) {
RDFFormat rDFFormat = getRDFFormat(format);
WriteRdf4j writeRdf4j = getGroupFromArk(ds, idArk);
if (writeRdf4j == null)
return null;
ByteArrayOutputStream out;
out = new ByteArrayOutputStream();
Rio.write(writeRdf4j.getModel(), out, rDFFormat);
return out.toString();
}
use of org.eclipse.rdf4j.rio.RDFFormat in project opentheso by miledrousset.
the class RestRDFHelper method exportConcept.
/**
* Permet de retourner un concept au format défini en passant par un identifiant Ark
* utilisé pour la négociation de contenu
*
* @param ds
* @param idArk
* @param format
* @return
*/
public String exportConcept(HikariDataSource ds, String idArk, String format) {
RDFFormat rDFFormat = getRDFFormat(format);
WriteRdf4j writeRdf4j = getConceptFromArk(ds, idArk);
if (writeRdf4j == null)
return null;
ByteArrayOutputStream out;
out = new ByteArrayOutputStream();
Rio.write(writeRdf4j.getModel(), out, rDFFormat);
return out.toString();
}
use of org.eclipse.rdf4j.rio.RDFFormat in project opentheso by miledrousset.
the class RestRDFHelper method findConcepts.
/**
* Permet de retourner un concept au format défini en passant par un identifiant Ark
* utilisé pour la négociation de contenu
*
* @param ds
* @param idTheso
* @param lang
* @param group
* @param format
* @param value
* @return
*/
public String findConcepts(HikariDataSource ds, String idTheso, String lang, String group, String value, String format) {
RDFFormat rDFFormat = getRDFFormat(format);
WriteRdf4j writeRdf4j = findConcepts__(ds, value, idTheso, lang, group);
if (writeRdf4j == null)
return null;
ByteArrayOutputStream out;
out = new ByteArrayOutputStream();
Rio.write(writeRdf4j.getModel(), out, rDFFormat);
return out.toString();
}
use of org.eclipse.rdf4j.rio.RDFFormat in project opentheso by miledrousset.
the class CopyAndPasteHelper method getBranch.
private SKOSXmlDocument getBranch(HikariDataSource ds, String fromIdTheso, String fromIdConcept) {
RDFFormat format = RDFFormat.RDFXML;
NodePreference nodePreference = new PreferencesHelper().getThesaurusPreferences(ds, fromIdTheso);
if (nodePreference == null)
return null;
ExportRdf4jHelper exportRdf4jHelper = new ExportRdf4jHelper();
exportRdf4jHelper.setInfos(ds, "dd-mm-yyyy", false, fromIdTheso, nodePreference.getCheminSite());
exportRdf4jHelper.setNodePreference(nodePreference);
exportRdf4jHelper.addBranch(fromIdTheso, fromIdConcept);
return exportRdf4jHelper.getSkosXmlDocument();
/* WriteRdf4j writeRdf4j = new WriteRdf4j(exportRdf4jHelper.getSkosXmlDocument());
ByteArrayOutputStream out;
out = new ByteArrayOutputStream();
Rio.write(writeRdf4j.getModel(), out, format);
return out.toString();*/
}
Aggregations