-
Notifications
You must be signed in to change notification settings - Fork 26
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
Inference and updating the triple store. #21
Comments
In the reasonning kernel, removing an assertion result in a deprecation of the actual inference, and force a complete re-evaluation. Maybe there is a bug somewhere in the jena module. Do you have a short sample that demonstrate the problem ? |
Another thing to take into account is whether the axiom removed can still be inferred from the remaining axioms. In that case, there is no bug: that's prescribed behaviour. |
Hi, thanks for your replies. @ignazio1977: I'm quite sure the removed axiom cannot be derived from other axioms, but I'll recheck that. Thanks. I wanted to explain what I was doing exactly and show what went wrong, but unexpectedly the inferred statements are successfully updated in the scenario I'm explaining below. I'll have to check other examples, to see if this issue is fully solved. You can see the exact configuration and ontology at the end of this post for more details. I'm using Apache Jena Fuseki's assemblers to create a InfModel with the PelletReasonerFactory attached. Because I'm not using Openllet from Java code, I'm unable to see what is happening under the hood. In this configuration I'm loading the When querying this dataset from Fuseki SPARQL query interface (see Query 1 below), it successfully returns the expected inferred statements of the single individual having the inffered data type property value "12". Now I execute an update query (see Query 2 below) to remove an axiom and this is successful (note that in Fuseki for updates you need to use the /update URL and not the /query URL), Query 1
Query 2
File: config.ttl
File: ontology-plus-data.ttl
|
Hi, I've tested a slightly different scenario to the one described above. I use the following ontology file (I've removed the single individual and will create it with a SPARQL INSERT query):
Now, when I insert an individual of type TestClass (see query below), it successfully infers it should have value
You can use the query below to see the inferred statements:
This works as expected, however, now I delete the same individual (triple) again (see query below), but some of the inferred statements remain:
Now run the query again and you will still see triples about our individual, which I think is not correct. Either the removal of the individual failed (although it said 'success'), but then I would still expect all triples remaining, or something goes wrong with updating and inference.
Hope this helps you to reproduce the behaviour! Regards, Barry |
Hi, I've tested the above scenario from Java code (with openllet-jena as an Maven dependency) and it behaves exactly the same. I've shared the code here. After adding, it correctly infers the additional statements, but after removing the statement, it will not clean up correctly. Although it is now possible to step through the code to find out what goes wrong, I'm too unfamiliar with the openllet source code to understand what's happening. So, it would be helpful if someone with more knowledge tries it as well. Regards, Barry |
Thank for the code, coolest way to grab it. The strangest thing is the "I sameAs I" statement that appear. This is strange enough to be classified as bug 👍 |
Hi, thanks for your reply! I'm not sure what you mean with 'the strangest thing is the "I sameAs I" statement....'. Why is that the strangest? However, what I find weird is that after removing the following statement:
The exact statement still shows up in the InfModel! Maybe I'm not removing correctly? Regards, Barry |
You are doing things correctly, but there is a bug somewhere. I have start investigate it a little thuesday night, and clearly this 'sameAs' statement is crapy,it do not add information, so it is very strange that the reasoner produce it. |
I would not say the 'I sameAs I' inference is wrong...logically it is true, isn't it? Similar to the inference that every individual has rdf:type owl:Thing, it is true, but it might not be very useful. |
Last commit may solve the problem. |
Yes, you can use my code as Unit Test. |
I noticed you included the test, but you did not yet include the '/ontology-plus-data.ttl' resource. Currently the test fails because of this. I would be able to include it, but I have never worked with pull-requests before... |
Thx, I forget to add the file. |
I've just tested your latest commit in my example explained above and it works fine. I've also tested it in a more complex example (within Apache Jena Fuseki) and it works there as well! I'll have to do some further tests to see if all problems are fixed now, but it looks good! Thank you. Can you explain what you changed? Was it only the boolean value about statementsRemoved that you added that fixed it? Regards, Barry |
The main correction is here [https://github.com/Galigator/openllet/blob/integration/module-jena/src/main/java/openllet/jena/PelletGraphListener.java#L343]. Other changes are only to get the code the way I like. |
Hi all,
Thanks for your efforts in keeping an up-to-date version of Pellet available!
I'm using Openllet to get a Protege-like inference experience within Apache Jena Fuseki, but I experience some problems after the repository in which inference is enabled is modified. After I remove (SPARQL: DELETE) the triples from which new triples are derived, the derived triples remain in the repository (i.e. they come up in SPARQL queries). I'm not sure yet, whether adding (SPARQL: CONSTRUCT) triples also gives problems.
Does anyone recognize this behaviour? Is this a bug, or is it a feature? For example, are the inferred triples 'converted' to real triples (after which there is no distinction between them)? I would say the ideal situation would be the distinction between stated and derived triples remains and after each modification the inference engine should update the inferred triples (like Sychronize in Protege).
Hope someone can help!
Regards, Barry
The text was updated successfully, but these errors were encountered: