sszuev commented on PR #2498:
URL: https://github.com/apache/jena/pull/2498#issuecomment-2132280722

   > GitHub issue resolved #2497
   > 
   > Continues from #2461.
   > 
   > There are categories of chnage:
   > 
   >     * `{@link Generic}` -> `{@code Generic}` -- there is no link for a 
generic. Fixed by regex.
   > 
   >     * `href='...'` - Eclispe complains when this is in `@see` or `@param`. 
It accepts `"`.  Fixed by regex.
   > 
   >     * Add `@SuppressWarnings("javadoc")` where a nested class is named. 
`Foo.Bar`. Despite the in-IDE javadoc seeming to work, it's warning and only 
correctable by incliding the full package name or suppression. This PR suppress 
the warning.
   > 
   >     * Remove unnecessary `@SuppressWarnings("unused")`
   > 
   >     * `Created by @szz` -- a few of these. `@` is not good! Jena does not 
have `@author` so these are removed inline with that.
   > 
   >     * `UnionGraphTest` - extend `GraphMem2Fast` not deprecated `GraphMem`
   > 
   > 
   > @sszuev -- This one that look like a problem:
   > 
   > ```
   > Unlikely argument type for equals(): OntRelationalProperty seems to be 
unrelated to OntNamedProperty OntIndividual.java    
/jena-ontapi/src/main/java/org/apache/jena/ontapi/model line 193        Java 
Problem
   > ```
   > 
   > The line is `return res.filter(x -> property.equals(x.getProperty()));`
   > 
   > 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](https://www.apache.org/licenses/contributor-agreements.html).
   
   although it works correctly (`Resource#equals` is used), `OntNamedProperty` 
should be replaced with `OntRelationalProperty`, since `OntAnnotationProperty` 
is not allowed for `OntNegativeAssertion`:
   ```
   +++ 
b/jena-ontapi/src/main/java/org/apache/jena/ontapi/model/OntIndividual.java     
 (date 1716741253610)
   @@ -182,10 +182,10 @@
        /**
         * Lists all negative property assertions for this individual and the 
given property.
         *
   -     * @param property {@link OntNamedProperty} or {@code null}
   +     * @param property {@link OntRelationalProperty} or {@code null}
         * @return {@code Stream} of {@link OntNegativeAssertion negative 
property assertion}s
         */
   -    default Stream<OntNegativeAssertion> 
negativeAssertions(OntNamedProperty property) {
   +    default Stream<OntNegativeAssertion> 
negativeAssertions(OntRelationalProperty property) {
            Stream<OntNegativeAssertion> res = negativeAssertions();
            if (property == null) {
                return res;
   @@ -402,7 +402,7 @@
         *                 can be {@code null} to remove all assertions for the 
predicate {@code property}
         * @return <b>this</b> instance to allow cascading calls
         */
   -    default OntIndividual removeNegativeAssertion(OntNamedProperty 
property, RDFNode value) {
   +    default OntIndividual removeNegativeAssertion(OntRelationalProperty 
property, RDFNode value) {
            negativeAssertions(property)
                    .filter(x -> value == null || value.equals(x.getTarget()))
                    .toList()
   ```
   
[GH-2498__OntIndividual.patch](https://github.com/apache/jena/files/15448223/GH-2498__OntIndividual.patch)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@jena.apache.org
For additional commands, e-mail: pr-h...@jena.apache.org

Reply via email to