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
feat(api-v2): Make inference optional in Gravsearch #1696
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
990fb05
fix(scripts): Change default Fuseki port.
154fb43
feat(gravsearch): Make inference optional.
fa15b2c
fix(gravsearch): Fix typos.
02d4d94
fix(OntologyConstants): Fix order-of-initialisation bug.
4295d27
Merge branch 'develop' into wip/DSP-534-gravsearch-inference
98b76d6
test(gravsearch): Add tests.
79362b9
test(gravsearch): Add tests.
3572b78
docs(gravsearch): Correct method name.
609dd75
docs(gravsearch): Correct formatting.
a7f3a1c
style(SparqlQuery): Clarify FromClause.
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benjamingeer question: why are using
lazy val
here in the following three cases? The initialization does not need any evaluation of an expression, it is just a set. In this case, it would not make any difference if the initialization happens immediately or is postponed to the first time the value is accessed.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great question! The problem is that
KnoraApiV2ResourceIris
is a static value (it's defined in anobject
rather than in aclass
), which refers to static values in anotherobject
. The order of initialisation of static values in the JVM depends on whichobject
is loaded first by the JVM's class loader at run time. Without thelazy
, ifobject KnoraApi
is initialised beforeobject KnoraApiV2Simple
andobject KnoraApiV2Complex
,KnoraApiV2ResourceIris
will just containnull
values. It took me a little while to figure this out yesterday. A test was failing, and it turned out that it was becauseKnoraApiV2ResourceIris
did not containOntologyConstants.KnoraApiV2Complex.Resource
, because it hadn't been initialised properly.In the earlier code, there was a method, which didn't access those constants until it was called, so it was fine.