RDFLib / OWL-RL

A simple implementation of the OWL2 RL Profile on top of RDFLib: it expands the graph with all possible triples that OWL RL defines. It can be used together with RDFLib to expand an RDFLib Graph object, or as a stand alone service with its own serialization.
http://www.ivan-herman.net/Misc/2008/owlrl/
Other
139 stars 30 forks source link

Enable selection of other OWL reasoning profiles - EL, QL #33

Open nicholascar opened 5 years ago

nicholascar commented 5 years ago

EL & QL reasoning should use fewer rules than RL and thus this tookit should be able to implement them since it can already do RL. Having EL, QL & RL as options will allow people to see the different results that these profiles actually produce, rather than having to just look at the profile definitions.

pbonte commented 4 years ago

I just came across this comment and I wanted to note that the EL and QL profile are not contained within the OWL2RL profile. All three OWL2 profiles are complementary. This can be seen in the w3c recommendation [1] where it explains that each profile allows different constructions at the lefthand or righthand side of the subsumption. This can be seen at the different allowed expressions in either subclass of superclass position of each profile, e.g. Table1 and Table2.

For example, the EL profile allows to reason about blank nodes, something that typically does not translate well to rule engines, which are used to evaluate the RL profile.

Hope this helps.

Kind regards, Pieter

[1] https://www.w3.org/TR/owl2-profiles/

nicholascar commented 4 years ago

Thanks Pieter! Yes, I think I worded the above awkwardly and it doesn't make sense.

We still should, I think, aim for an expanded tool here that can implement EL & QL as well as RL & RDFS, even if under the hood the tool selects completely different code to implement them. I don't know enough about EL & QL to know what can be done in a lump of Python code like the current RL reasoner but that's part of the point: this exercise would be to de-mystify implementation of these profiles!

I may now have an external trigger to look into this feature more. I'm working on some systems that would benefit from selecting different reasoning profiles.

pbonte commented 4 years ago

Hi Nicholas,

Integrating the various profiles would be interesting indeed. I think selecting the profile based on the ontology can be done rather easy by identifying the expressivity of each side of the subsumption of each class expression in the ontology. Which basically boils down to checking the tables from owl2 profiles spec for each class definition. From experience, I have found that many ontologies don't fit within one of the profiles, but require OWL2DL to be interpreted correctly. But of course, this depends on the domain.

I'm convinced both EL and QL can be done. QL typically uses query rewriting techniques, thus instead of inferring implicit facts from your data, you rewrite the queries using some kind of reasoner and then you can evaluate these expanded queries without the need for a reasoner. Of course, query evaluation becomes more complex in the latter. However, my point is that it should be rather easy to integrate. I'm not so familiar with EL, I know they use some kind of inference rules, but different from rule evaluation in a rule engine. Mainly because you need to be able to reason upon blank nodes. You can find more detailed info in the Elk paper [1].

I haven't delved into your code here yet, but I assume you use some kind of rule engine implementation such as Rete?

Kind regards, Pieter

[1] Kazakov, Y., Krötzsch, M. and Simančík, F., 2014. The incredible elk. Journal of automated reasoning, 53(1), pp.1-61.