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

Bump jena-core from 3.17.0 to 4.2.0 #134

Closed

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Sep 20, 2021

Bumps jena-core from 3.17.0 to 4.2.0.

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
  • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
  • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
  • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the Security Alerts page.

Bumps jena-core from 3.17.0 to 4.2.0.

---
updated-dependencies:
- dependency-name: org.apache.jena:jena-core
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
@dependabot dependabot bot added the dependencies Pull requests that update a dependency file label Sep 20, 2021
@mielvds
Copy link
Member

mielvds commented Sep 21, 2021

@afs any big hurdles to do this upgrade?

Seem to be missing:

symbol: class GraphStatisticsHandler
location: package org.apache.jena.graph

symbol: class RepeatApplyIterator
location: package org.apache.jena.atlas.iterator

@afs
Copy link
Contributor

afs commented Sep 21, 2021

Shouldn't be.

3->4 is because Java11 is required, not a major architecture change. We did make changes a little more freely given the opportunity.

Some IRI handling got pickier (a little less lenient) - can emit warnings.

GraphStatisticsHandler is no more - remove it.

RepeatApplyIterator was a duplicate - use Iter.flatMap

@mielvds
Copy link
Member

mielvds commented Sep 21, 2021

Okay, should be doable! I guess java 11 is not a issue for hdt users @D063520?

GraphStatisticsHandler is no more - remove it.

Is there another method to get a cardinality estimate of a triple pattern? (see https://github.com/rdfhdt/hdt-java/blob/master/hdt-jena/src/main/java/org/rdfhdt/hdtjena/solver/ReorderTransformationHDT.java#L108)

@D063520
Copy link
Contributor

D063520 commented Sep 21, 2021

I do not see a problem of forcing to use java 11 ...

@mielvds mielvds added this to the 3.0.0 milestone Sep 21, 2021
@afs
Copy link
Contributor

afs commented Sep 21, 2021

Is there another method to get a cardinality estimate of a triple pattern? (see https://github.com/rdfhdt/hdt-java/blob/master/hdt-jena/src/main/java/org/rdfhdt/hdtjena/solver/ReorderTransformationHDT.java#L108)

(Not knowing HDT deeply ...)

Given if(pt.subject.isNode() && pt.predicate.isNode() && pt.object.isNode()), and "isNode isn't ANY (variables, not wildcards) , then isn't that going to be zero or one and same as "graph.contains ? 1 : 0"?

@mielvds
Copy link
Member

mielvds commented Sep 21, 2021

Is there another method to get a cardinality estimate of a triple pattern? (see https://github.com/rdfhdt/hdt-java/blob/master/hdt-jena/src/main/java/org/rdfhdt/hdtjena/solver/ReorderTransformationHDT.java#L108)

(Not knowing HDT deeply ...)

Nobody knows unfortunately :)

Given if(pt.subject.isNode() && pt.predicate.isNode() && pt.object.isNode()), and "isNode isn't ANY (variables, not wildcards) , then isn't that going to be zero or one and same as "graph.contains ? 1 : 0"?

In this case, yes. However, the construct returns for estimating the count on triples containing a certain subject, predicate or object: https://github.com/rdfhdt/hdt-java/blob/master/hdt-jena/src/main/java/org/rdfhdt/hdtjena/solver/ReorderTransformationHDT.java#L131

But granted, this algorithm could definitely be implemented in a better, smarter way. It was inspired by inspired by Jena's FixedReorder. Is that still around?

@D063520
Copy link
Contributor

D063520 commented Sep 21, 2021

Is there another method to get a cardinality estimate of a triple pattern? (see https://github.com/rdfhdt/hdt-java/blob/master/hdt-jena/src/main/java/org/rdfhdt/hdtjena/solver/ReorderTransformationHDT.java#L108)

(Not knowing HDT deeply ...)

Given if(pt.subject.isNode() && pt.predicate.isNode() && pt.object.isNode()), and "isNode isn't ANY (variables, not wildcards) , then isn't that going to be zero or one and same as "graph.contains ? 1 : 0"?

hdt.search("","","uri").estimatedNumResults()

@afs
Copy link
Contributor

afs commented Sep 21, 2021

ReorderFixed is still around though it does not look in the data.
ReorderWeighted is the other reorder function.

@D063520 -- Not knowing HDT well enough, I don't understand hdt.search("","","uri").estimatedNumResults() - is that a replace for that line or more of this function?

@D063520
Copy link
Contributor

D063520 commented Sep 21, 2021

ReorderFixed is still around though it does not look in the data.
ReorderWeighted is the other reorder function.

@D063520 -- Not knowing HDT well enough, I don't understand hdt.search("","","uri").estimatedNumResults() - is that a replace for that line or more of this function?

It is an existing function in HDT

ResultEstimationType numResultEstimation();

@mielvds
Copy link
Member

mielvds commented Sep 21, 2021

Okay, done some quick digging and the HDT estimation is in fact already used, but in the implementation of HDTStatistics.java which implements the now missing GraphStatisticsHandler interface.
We could move this interface to the HDT repo.
Of perhaps an HDT implemetation of StatsMatcher in combination with ReorderWeighted is an option

@mielvds
Copy link
Member

mielvds commented Jan 13, 2022

Following up in https://github.com/rdfhdt/hdt-java/tree/jena4.

@afs there were more small changes than I thought. I tink I mitigated most of them:

  • removed many deprecated interface methods in Capabilities, BindingBase, Binding
  • testItem.getFileSyntax() --> Syntax.guessFileSyntax(testItem.getResultFile())
  • new QueryIterPlainWrapper(bindings.iterator()) --> QueryIterPlainWrapper.create(bindings.iterator())

But how do I replace BindingMap and BindingFactory.create() ?

@afs
Copy link
Contributor

afs commented Jan 13, 2022

Update to Jena 4.3.2 : 4.2.x to 4.3.x is not a huge jump.

While you aren't picking up log4j2 (the libs don't provide the choice logging for slf4j), users looking from the outside will see "old version". Plus security scanning software isn't very subtle sometimes.

But how do I replace BindingMap and BindingFactory.create() ?

There is now a builder pattern: Binding.builder(parent)....build(); -- example:
https://github.com/apache/jena/blob/main/jena-arq/src/main/java/org/apache/jena/sparql/engine/iterator/QueryIterAssign.java#L60

@mielvds
Copy link
Member

mielvds commented Jan 13, 2022

I'm actually migrating from 3 to 4.3.2, taking it one compliler complaint at a time :D

There is now a builder pattern: Binding.builder(parent)....build(); -- example:

got ya. But what did BindingMap used to do ? nvm, figured it out.

@mielvds
Copy link
Member

mielvds commented Jan 13, 2022

Syntax.guessFileSyntax(testItem.getResultFile()) doesn't seem right; I get null pointer exceptions. What did QueryTestItem.getFileSyntax() used to return? -> nvm, got that one too; it's getQueryFile()

@mielvds
Copy link
Member

mielvds commented Jan 13, 2022

Down to Fuseki errors. Trying to include #121 while we're at it.

@afs
Copy link
Contributor

afs commented Jan 13, 2022

BindingMap was beyond its sell-by date. New binding handling is for immutable bindings. Previously, it was by interface (BindingMap is mutable); now it is enforced by the builder pattern.

There are special implementations for the common cases of 1,2,3,4 slots. A Map has significant space overheads for small numbers of slots.

@mielvds mielvds closed this Feb 1, 2022
@dependabot @github
Copy link
Contributor Author

dependabot bot commented on behalf of github Feb 1, 2022

OK, I won't notify you again about this release, but will get in touch when a new version is available. If you'd rather skip all updates until the next major or minor version, let me know by commenting @dependabot ignore this major version or @dependabot ignore this minor version.

If you change your mind, just re-open this PR and I'll resolve any conflicts on it.

@dependabot dependabot bot deleted the dependabot/maven/org.apache.jena-jena-core-4.2.0 branch February 1, 2022 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants