use of uk.ac.manchester.cs.skos.SKOSDatasetImpl in project opentheso by miledrousset.
the class ImportSkosHelper method readFile.
/**
* Cette fonction a été modifié pour pouvoir lire un fichier SKOS en passant par un
* InputStream, l'API standard SKOSAPI n'a pas de constructeur adapté
* cette fonction permet de lire tout type de fichier SKOS-OWL en s'appuyant
* sur l'api (OWLAPI-SKOSAPI)
*
* @param streamFilename
* @param fileName
* @return
* @throws OWLOntologyCreationException
* @throws SKOSCreationException
*/
public boolean readFile(InputStream streamFilename, String fileName) throws OWLOntologyCreationException, SKOSCreationException {
try {
sKOSManager = new SKOSManager();
onto = ontologieManager.loadOntologyFromOntologyDocument(streamFilename);
SKOSDatasetImpl voc = new SKOSDatasetImpl(sKOSManager, onto);
if (voc.getURI() != null) {
String theso = "";
for (SKOSConceptScheme scheme : voc.getSKOSConceptSchemes()) {
theso = theso + " " + scheme.getURI();
}
message = "new ontology loaded: " + theso;
// voc.getAsOWLOntology().getOntologyID();
// System.out.println("new ontology loaded: " + voc.getAsOWLOntology().getOntologyID());
skosVocabularies.put(voc.getURI(), voc);
dataSet = voc;
return true;
}
} catch (SKOSCreationException ex) {
Logger.getLogger(ImportSkosHelper.class.getName()).log(Level.SEVERE, null, ex);
message = ex.getMessage();
}
return false;
}
use of uk.ac.manchester.cs.skos.SKOSDatasetImpl in project opentheso by miledrousset.
the class SKOSManager method loadDatasetFromInputStream.
public SKOSDataset loadDatasetFromInputStream(InputStream uri) throws SKOSCreationException {
OWLOntology onto = null;
try {
onto = man.loadOntologyFromOntologyDocument(uri);
} catch (OWLOntologyCreationException e) {
throw new SKOSCreationException(e);
}
SKOSDatasetImpl voc;
// voc;
return null;
}
Aggregations