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

Entailment Algorithm in Semantics Appendix is incomplete #46

Closed
Antoine-Zimmermann opened this issue Oct 26, 2023 · 17 comments
Closed

Entailment Algorithm in Semantics Appendix is incomplete #46

Antoine-Zimmermann opened this issue Oct 26, 2023 · 17 comments
Labels
propose closing Proposed for closing spec:enhancement Change to enhance the spec without affecting conformance (class 2) –see also spec:editorial

Comments

@Antoine-Zimmermann
Copy link
Contributor

There are several kinds of valid entailments that the algorithm cannot prove. One such kind is covered by @pfps's pull request #45 but there are the two following cases:

  1. the empty graph (in fact, any graph) RDFS-entails ex:a rdf:type rdfs:Resource (in general, any graph S RDFS-entails any triple of the form aaa rdf:type rdfs:Resource for aaa an arbitrary IRI).
  2. the graph S = {_:bn rdf:type xsd:string . _:bn rdf:type rdf:langString .} RDFS:entails every RDF graphs because S is inconsistent.

Note that these are only related to RDF 1.1 semantics. For RDF 1.2, additional rules for directional text and for quoted triples/triple terms/graph terms will be needed.

@pfps
Copy link
Contributor

pfps commented Oct 26, 2023

The second is covered by the condition "If S is RDF (RDFS) consistent" in the proposition.

The first was covered by rules rdfs4a and rdfs4b, but these need to be generalized, as does rule rdfs1. Then the completion process needs to be modified to restrict the application of the generalized rule rdfs4. The reason for this change is the change that all IRIs now have denotations.

The generalized rules are more like axioms, but leaving them as rules is the lesser change.

@Antoine-Zimmermann
Copy link
Contributor Author

Antoine-Zimmermann commented Oct 26, 2023

The rules don't need changes. My proposal would be: update the first enumerated list that appears in Appendix A by adding the following after step 2.:

  1. For every IRI aaa used in E, add aaa rdf:type rdfs:Resource to S

and update the second enumerated list of the appendix by adding this after step 3.:

  1. For every IRI or literal aaa used in E, add aaa rdf:type rdfs:Resource to S

Then the completeness result in the orange box should be correct. This could be generalised to cover inconsistent graphs by adding a step to the procedure. Before checking that the resulting graph contains an instance of E, it can be checked that the resulting graph contains an instance of {_:bn rdf:type xsd:string . _:bn rdf:type rdf:langString .} I believe, yet I haven't proved, that this is the only possibility for inconsistency in RDFS entailment recognising {xsd:string, rdf:langString}.

@Antoine-Zimmermann
Copy link
Contributor Author

Last step of the algorithm could become:

If {_:bn rdf:type xsd:string . _:bn rdf:type rdf:langString .} is in the resulting graph, or if the resulting graph contains an instance of E, then S RDFS-entails E.

@doerthe
Copy link

doerthe commented Oct 26, 2023

4. For every IRI or literal aaa used in E, add aaa rdf:type rdfs:Resource to S

Is this correct? You actually add a blank node for the literal, right?

@Antoine-Zimmermann
Copy link
Contributor Author

@doerthe What are you referring to when you say "this" in the question "Is this correct?"?

@doerthe
Copy link

doerthe commented Oct 26, 2023

@doerthe What are you referring to when you say "this" in the question "Is this correct?"?

@Antoine-Zimmermann: I maybe did not read enough in detail, but I read the part I cited as:

For every IRI or literal aaa used in E, add aaa rdf:type rdfs:Resource to S.

So, let aaa="test", then this says that I have to add the triple

"test" rdf:type rdfs:Resource.

But this is not a valid triple, therefore my question.

@Antoine-Zimmermann
Copy link
Contributor Author

OK. I'm referring to a section of the appendix where it is said that we apply rules and materialise inferrences in generalized RDF where blank nodes and literals can be used anywhere. See the text after the first table in Appendix A of RDF Semantics.

@doerthe
Copy link

doerthe commented Oct 27, 2023

OK, that was the missing piece, I should have read more carefully. Thank you for the clarification.

@doerthe
Copy link

doerthe commented Oct 27, 2023

Do we the also need to add rdfs:Resource rdf:type rdfs:Resource. as axiomatic triple?

@pfps
Copy link
Contributor

pfps commented Oct 27, 2023

Do we the also need to add rdfs:Resource rdf:type rdfs:Resource. as axiomatic triple?

The replacement for rdfs4a and b does this.

@doerthe
Copy link

doerthe commented Oct 27, 2023

sorry again, that I was lost here, but I think I now understood:
if the fact rdfs:Resource rdf:type rdfs:Resource. is relevant for E, then the iri rdfs:Resource already occurs in E. In that case the rule produces the triple, otherwise it won't, but that is not a problem either.
Thank you for your patience explaining me the rules :)

@pfps pfps changed the title Algorithm in Appendix is incomplete Entailment Algorithm in Semantics Appendix is incomplete Jan 25, 2024
@pfps
Copy link
Contributor

pfps commented Jan 25, 2024

Is there anything else that needs to be done here? I'm making this issue to be closed but if anyone thinks there is more to do, please speak up.

@pfps pfps added the propose closing Proposed for closing label Jan 25, 2024
@Antoine-Zimmermann
Copy link
Contributor Author

Antoine-Zimmermann commented Jan 25, 2024

@pfps in my message with a suggestion, there is something that can be done to resolve the issue. Should I make a pull request myself with these changes or would you do it?

@pfps
Copy link
Contributor

pfps commented Jan 25, 2024

@Antoine-Zimmermann Please go ahead and create a PR.

@pfps pfps added spec:enhancement Change to enhance the spec without affecting conformance (class 2) –see also spec:editorial and removed propose closing Proposed for closing labels Jan 25, 2024
@pfps
Copy link
Contributor

pfps commented Mar 7, 2024

As there has been no PR produced and the appendix is correct as it, I'm again proposing to close this issue.

@pfps pfps added the propose closing Proposed for closing label Mar 7, 2024
@Antoine-Zimmermann
Copy link
Contributor Author

Antoine-Zimmermann commented Apr 24, 2024

@pfps I finally took the time to create a PR with the modifications I suggested above. It is PR #48.

@pfps
Copy link
Contributor

pfps commented Jul 18, 2024

This issue is closed with the merging of PR #48

@pfps pfps closed this as completed Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
propose closing Proposed for closing spec:enhancement Change to enhance the spec without affecting conformance (class 2) –see also spec:editorial
Projects
None yet
Development

No branches or pull requests

3 participants