Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 9b7bbbb8 authored by Jérôme David's avatar Jérôme David
Browse files

getEntity(Uri) was returning always something. now it returns null when the...

getEntity(Uri) was returning always something. now it returns null when the uri do not correspond to a skosconcept
parent 45e3ff33
No related branches found
No related tags found
No related merge requests found
......@@ -179,7 +179,12 @@ public class SKOSLiteThesaurus implements HeavyLoadedOntology<Model> {
@Override
public Object getEntity(URI u) throws OntowrapException {
try {
return ontoInf.getResource(u.toString());
Object o = ontoInf.getRawModel().getResource(u.toString());
if (! ontoInf.contains((Resource) o, RDF.type, ontoInf.getResource(SKOS_CONCEPT))) {
return null;//System.out.println(u+" : "+o);
}
return o;
} catch (Exception e) {
throw new OntowrapException("No Object for URI "+u);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment