You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@jena.apache.org by "afs (via GitHub)" <gi...@apache.org> on 2024/05/26 15:59:33 UTC

[PR] GH-2497: Clean warnings in jena-ontapi [jena]

afs opened a new pull request, #2498:
URL: https://github.com/apache/jena/pull/2498

   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).
   


-- 
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-unsubscribe@jena.apache.org

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


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


Re: [PR] GH-2497: Clean warnings in jena-ontapi [jena]

Posted by "afs (via GitHub)" <gi...@apache.org>.
afs merged PR #2498:
URL: https://github.com/apache/jena/pull/2498


-- 
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-unsubscribe@jena.apache.org

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


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


Re: [PR] GH-2497: Clean warnings in jena-ontapi [jena]

Posted by "sszuev (via GitHub)" <gi...@apache.org>.
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-unsubscribe@jena.apache.org

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


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


Re: [PR] GH-2497: Clean warnings in jena-ontapi [jena]

Posted by "afs (via GitHub)" <gi...@apache.org>.
afs commented on PR #2498:
URL: https://github.com/apache/jena/pull/2498#issuecomment-2132368931

   Thanks - patch applied.
   
   For all the others, I hope it does not mess up in your IntelliJ configuration.


-- 
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-unsubscribe@jena.apache.org

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


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