-
Notifications
You must be signed in to change notification settings - Fork 315
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
Unable to get instances of OWL Class correctly - version 5.1.5 of OWL-API and Hermit - 1.4.1.513 #800
Comments
What are the classes equivalent to Movie? |
Can you please add the ontology without the inferred axioms? It is impossible to figure out what is being expressed in this ontology due to the noise from irrelevant axioms. We've been through how unnecessary it is to put the inferred axioms back in the ontology when using a reasoner in other issues. |
Movie_ABoxLoaded_PopularPage1.txt |
Issue owlcs/hermit-reasoner#3 might be related. This was fixed in HermiT 1.4.3.456 and 1.4.3.517. Trying your code with those versions I get back only Movies. |
Ok, thanks will use the latest version of Hermit then, |
Found an issue again with Hermit 1.4.3.517, Though the ontology does not contain equivalent data properties, when i run my application, i get the following error: |
Found an issue again with Hermit 1.4.3.517, Though the ontology does not contain equivalent data properties, when i run my application, i get the following error: |
I don't get the same issue with the ontology attached to this issue. Which ontology causes the issue? |
Inferred ontology causes this issue though there all data properties are
sub properties of owl:topDataProperty
…On Mon 12 Nov, 2018, 1:29 PM Ignazio Palmisano, ***@***.***> wrote:
I don't get the same issue with the ontology attached to this issue. Which
ontology causes the issue?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub
<#800 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AYvmOk-uzaquaTYFCMmKqMReDDndnZoNks5uuSppgaJpZM4YSUC3>
.
|
Ok. As discussed a few times before, reasoners don't do well with reasoning on ontologies where inferred axioms are added back in. Also, reasoning again on ontologies where inferred axioms have been asserted is not useful - it just forces the reasoner to do the same work twice. |
In particular, all inferred axioms that say |
Ok, i get it.. |
Have used the following code to get instances of class Movie:
String base = "http://www.semanticweb.org/drkm/ontologies/2018/5/untitled-ontology-42#";
OWLDataFactory dataFactory = manager.getOWLDataFactory();
OWLClass movieClass = dataFactory.getOWLClass(IRI.create(base+"Movie"));
System.out.println("Class "+movieClass);
Reasoner.ReasonerFactory factory = new Reasoner.ReasonerFactory();
Configuration configuration=new Configuration();
configuration.throwInconsistentOntologyException=false;
OWLReasoner reasoner=factory.createReasoner(ontology, configuration);
System.out.println("In Genre Coverage");
// Get individuals of class Movie
Set indivMovies = reasoner.getInstances(movieClass, true).getFlattened();
OWLObjectProperty hasCast = dataFactory.getOWLObjectProperty(IRI.create(base+"hasCast"));
Iterator iterMovie = indivMovies.iterator();
while(iterMovie.hasNext())
{
OWLNamedIndividual eachMovie = (OWLNamedIndividual) iterMovie.next();
// Get hasCast assertions of this individual
Set castOfThisMovie = reasoner.getObjectPropertyValues(eachMovie, hasCast).getFlattened();
System.out.println("Movie: "+eachMovie);
System.out.println("---------------------------------------------------------------------------");
for(OWLNamedIndividual eachCast: castOfThisMovie)
{
System.out.println("Cast "+ eachCast.getIRI().getShortForm());
}
System.out.println("---------------------------------------------------------------------------");
}
May I know what may be the issue?
It gives me instances of all classes and not just Movie class
The text was updated successfully, but these errors were encountered: