apache / jena

Apache Jena
https://jena.apache.org/
Apache License 2.0
1.08k stars 643 forks source link

GH-2487: optimize HierarchySupport#contains; add OntClass#has{Sub|Super}Class, OntProperty#has{Sub|Super}Property + minor refactoring #2528

Closed sszuev closed 3 weeks ago

sszuev commented 4 weeks ago

Pull request Description:


By submitting this pull request, I acknowledge that I am making a contribution to the Apache Software Foundation under the terms and conditions of the Contributor's Agreement.


See the Apache Jena "Contributing" guide.

sszuev commented 3 weeks ago

maybe it is better instead of this:

interface OntClass {
  OntClass asSubClass(): {null|class}
}

implement something like this:

interface OntClass {
  OntClass asSubClass(): {class|throws OntJenaException.Creation}
  boolean canAsSubClass()
}

Can be done either in this PR or in the next one. After this, no new interface changes are expected. api should be stable.

afs commented 3 weeks ago

BTW For another time: a git commit message is usually a short line, optionally followed by a blank line then multiple lines of text (which can be longer lines). A bit long in thr first line is OK; 269 is really quite long!

https://git-scm.com/docs/git-commit#_discussion