Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InferredOWLClassHierarchyProvider can crash depending on the reasoner implementation #403

Closed
bdionne opened this issue May 2, 2016 · 2 comments

Comments

@bdionne
Copy link
Contributor

bdionne commented May 2, 2016

InferredOWLClassHierarchyProvider crashes if the reasoner returns an immutable collection. Using getEntitiesMinus seems to fix it.

@matthewhorridge matthewhorridge changed the title InferredOWLClassHierarchyProvider crashes InferredOWLClassHierarchyProvider can crash depending on the reasoner implementation May 2, 2016
@bdionne
Copy link
Contributor Author

bdionne commented May 2, 2016

Thanks @matthewhorridge - is this one ok?

@andrewdbate
Copy link

andrewdbate commented Nov 19, 2017

Sorry to be commenting on a closed issue... but I'm currently getting this exact crash due to a reasoner returning an immutable collection.

The code immediately below the fix commited in 61c4f7b calls remove:

// Class which is not Thing or Nothing
subs.remove(owlNothing);
for (Iterator<OWLClass> it = subs.iterator(); it.hasNext();) {
if (!getReasoner().isSatisfiable(it.next())) {
it.remove();
}
}

The problem seems to be that a valid implementation of getFlattened() is to return an immutable collection:

Set<OWLClass> subs = getReasoner().getSubClasses(object, true).getFlattened();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants