-
Notifications
You must be signed in to change notification settings - Fork 2
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
Bugfix 48 creator query too narrow #124
base: main
Are you sure you want to change the base?
Conversation
If these queries test ok, I can also add a PR for DataONEorg/dataone-cn-index#1 with the same changes. |
I reviewed this PR, but please note caveats:
I agree there doesn't seem to be a schema field for author email (see these entries) - maybe @taojing2002 can help us out with this question?
|
String id = schemaOrgTestCreatorRoleListPid; | ||
indexObjectToSolr(id, schemaOrgTestCreatorRoleList); | ||
|
||
Thread.sleep(2*SLEEPTIME); |
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.
(I understand you copied this from an existing test method, but...) is this definitely needed? In the best case this test will take a minimum of 18 seconds to run (2 * SLEEPTIME + SLEEP). The whole class will take nearly 2 minutes, best case.
Suggested solution is to remove Thread.sleep(2*SLEEPTIME)
altogether, and then edit your loop (on line 582) as follows:
- Reduce the
SLEEP
time in that loop to, say, 500mS. - Increase the value of
TIMES
to make the loop duration the same as it is now (i.e. 2 * 8 + 10 * 2), given the new shorter sleep time.
That way, flow will continue as soon as the test passes, with the potential to be a lot quicker.
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.
(FYI, this is an approach we're gradually moving to in the metacat codebase, too)
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.
Added in aab0578.
String id = schemaOrgTestCreatorRolePid; | ||
indexObjectToSolr(id, schemaOrgTestCreatorRole); | ||
|
||
Thread.sleep(2*SLEEPTIME); |
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.
same comment as line 579
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.
Added in 3151375.
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.
Don't forget to add your "schema_org_creator_role_name"
and "schema_org_creator_list_role_name"
beans to the application-context-json-ld.xml
file.
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.
Added in 87881f0.
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.
both these new tests fail for me:
+++++++++++++++++++The value of the field authorGivenName from Solr is null
The expected value of the field authorGivenName is Ian
Sorry for the weekend ping. This PR attempts to broaden support for the types of creator role that can be defined in Schema.org JSON-LD metadata. I'm having trouble getting all of the pieces running on my machine, so these changes have not been tested.
Notes:
I added two sparql queries, one for the creator role definition without a list (sometimes used when there is only one creator) and one for the creator role definition WITH an ordered list. I commented with examples of each, and added tests and systemmetadata for each.
I did not add a query for author email as Matt Matt demoed here, as I did not see a field for author email defined in the Solr schema. If someone can suggest what Solr field to use for email and/or ORCiD, I will add those to the query.
I'm adding @artntek to the list of reviewers since I imagine he has a working setup and can test the changes.