-
Notifications
You must be signed in to change notification settings - Fork 27
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
Unexpected behaviour of OWL-RL reasoner (Literals in the position of Subjects) #63
Comments
Hi @arrascue This is intentional behaviour. Whether it is correct or not is a different question. When that change was made in 2018, the view by @iherman and @wrobell was that Literals in the Subject position are allowed by RDFlib, so the OWL-RL tool should use take advantage of the feature. |
From the RDF 1.2 Concepts Specification:
So no literals in the s or p positions. and: The set of nodes of an RDF graph is the set of subjects and objects of the triples in the graph. It is possible for a predicate IRI to also occur as a node in the same graph. so subjects cannot. However, according to Section 7. Generalized RDF Triples, Graphs, and Datasets: A generalized RDF triple is a triple having a subject, a predicate, and an object, where each can be an IRI, a blank node, a triple term, or a literal. and this is "convenient" since: the completeness of the RDFS entailment rules is easier to show with a generalization of RDF triples. So OWL-RL implements generalised triples and this is ok but ansl in the Spec: NOTE: Any user of generalized RDF triples, graphs, or datasets needs to be aware that these notions are non-standard extensions of RDF, and their use may cause interoperability problems. There is no requirement for any RDF tool to accept, process, or produce anything beyond standard normative RDF triples, graphs, and datasets. So we have a nice-to-have already implemented but sometimes it can be problematic. Suggestion: DeductiveClosure(RDFS_Semantics).expand(g, generalised_triples=True) There are several options to include/exclude axiomatic triples etc., in the result, so setting I already also do this sort of cleanup a bit: # remove boring RDF & RDFS bits
for t in g.triples((None, None, None)):
if str(t[0]).startswith((str(RDF), str(RDFS))):
g.remove(t) So there's lots to improve in the output presentation... |
This problem has been reported in #50, but there it has been reported as a problem on PROV-O.
The problem seems to be more generic than that. The following is a minimal example:
The augmented graph contains the following (offensive) inferred triple:
This type of inferred facts would cause the graph to be unparseable in some triplestores. In GraphDB, for instance, one gets a parsing error.
Other OWL-RL reasoners, like the one from GraphDB, do not generate statements with literals as the first component of a triple.
The version used was owlrl==6.0.2
The ticket #13 seems to aim to solve this, but is it open since 2018.
Are there any plans to fix it?
The text was updated successfully, but these errors were encountered: