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.
(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
SLEEPtime in that loop to, say, 500mS. - Increase the value of
TIMESto 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.
(FYI, this is an approach we're gradually moving to in the metacat codebase, too)
| String id = schemaOrgTestCreatorRolePid; | ||
| indexObjectToSolr(id, schemaOrgTestCreatorRole); | ||
|
|
||
| Thread.sleep(2*SLEEPTIME); |
There was a problem hiding this comment.
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.
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.