@@ -765,6 +765,23 @@ public void testCreateReview() {
765765 String datasetCitationHtml = JsonPath .from (getCitation .getBody ().asString ()).getString ("data.message" );
766766 String datasetCitationText = StringUtil .html2text (datasetCitationHtml );
767767
768+ /**
769+ * We are added the HTML version of a Related Dataset. We like the HTML
770+ * version because both JSF and the SPA render the DOI link as a
771+ * clickable link.
772+ *
773+ * The tooltip for Related Dataset says "Information, such as a
774+ * persistent ID or citation, about a related dataset, such as previous
775+ * research on the Dataset's subject".
776+ *
777+ * We are aware that there is a custom metadata block called
778+ * "relatedDatasetsV2" at https://github.com/vera/related-datasets-cvoc
779+ * that we have been playing with. We especially like that relationships
780+ * can be expressed between the current object (a review) and the
781+ * related dataset. This is simlar to how "Related Publication" works.
782+ * See also discussion at
783+ * https://dataverse.zulipchat.com/#narrow/channel/379673-dev/topic/Improved.20.22Related.20datasets.22/near/534969036
784+ */
768785 JsonObjectBuilder jsonForCreatingReview = Json .createObjectBuilder ()
769786 /**
770787 * See above where this type is added to the installation and
@@ -838,151 +855,14 @@ public void testCreateReview() {
838855 .add ("multiple" , true )
839856 .add ("typeName" , "subject" )
840857 )
841- /**
842- * Related Dataset.
843- *
844- * The tooltip for Related
845- * Dataset says "Information,
846- * such as a persistent ID or
847- * citation, about a related
848- * dataset, such as previous
849- * research on the Dataset's
850- * subject".
851- *
852- * For now we'll add multiple
853- * forms so we can discuss and
854- * decide which one to use.
855- *
856- * Also, we are well aware that
857- * there is a custom metadata
858- * block called
859- * "relatedDatasetsV2" at
860- * https://github.com/vera/related-datasets-cvoc
861- * that we hope to play with
862- * soon.
863- */
864858 .add (Json .createObjectBuilder ()
865859 .add ("value" , Json .createArrayBuilder ()
866- .add (datasetPid )
867- .add (datasetPidUrl )
868- .add (datasetCitationText )
869860 .add (datasetCitationHtml )
870861 )
871862 .add ("typeClass" , "primitive" )
872863 .add ("multiple" , true )
873864 .add ("typeName" , "relatedDatasets" )
874865 )
875- /**
876- * Related Publication.
877- *
878- * Related Dataset is more
879- * appropriate than Related
880- * Publication but we're adding
881- * Related Publication (twice,
882- * with plain text and HTML
883- * citations) because unlike
884- * Related Dataset, Related
885- * Publication lets us send
886- * publicationRelationType,
887- * which gets sent to DataCite
888- * as "References" or "Cites" or
889- * whatever.
890- *
891- * (Ideally, we'd send "Reviews"
892- * but we get this error:
893- *
894- * "Error parsing Json: Invalid
895- * controlled vocabulary in
896- * compound field Value
897- * 'Reviews' does not exist in
898- * type
899- * 'publicationRelationType';")
900- */
901- .add (Json .createObjectBuilder ()
902- .add ("value" , Json .createArrayBuilder ()
903- // Plain text citation version
904- .add (Json .createObjectBuilder ()
905- .add ("publicationRelationType" ,
906- Json .createObjectBuilder ()
907- .add ("value" , "References" )
908- // .add("value", "Reviews")
909- .add ("typeClass" , "controlledVocabulary" )
910- .add ("multiple" , false )
911- .add ("typeName" , "publicationRelationType" )
912- )
913- .add ("publicationCitation" ,
914- Json .createObjectBuilder ()
915- .add ("value" , datasetCitationHtml )
916- .add ("typeClass" , "primitive" )
917- .add ("multiple" , false )
918- .add ("typeName" , "publicationCitation" )
919- )
920- .add ("publicationIDType" ,
921- Json .createObjectBuilder ()
922- .add ("value" , datasetPidProtocol )
923- .add ("typeClass" , "controlledVocabulary" )
924- .add ("multiple" , false )
925- .add ("typeName" , "publicationIDType" )
926- )
927- .add ("publicationIDNumber" ,
928- Json .createObjectBuilder ()
929- .add ("value" , datasetPidWithoutProtocol )
930- .add ("typeClass" , "primitive" )
931- .add ("multiple" , false )
932- .add ("typeName" , "publicationIDNumber" )
933- )
934- .add ("publicationURL" ,
935- Json .createObjectBuilder ()
936- .add ("value" , datasetPidUrl )
937- .add ("typeClass" , "primitive" )
938- .add ("multiple" , false )
939- .add ("typeName" , "publicationURL" )
940- )
941- )
942- // HTML citation version
943- .add (Json .createObjectBuilder ()
944- .add ("publicationRelationType" ,
945- Json .createObjectBuilder ()
946- .add ("value" , "References" )
947- // .add("value", "Reviews")
948- .add ("typeClass" , "controlledVocabulary" )
949- .add ("multiple" , false )
950- .add ("typeName" , "publicationRelationType" )
951- )
952- .add ("publicationCitation" ,
953- Json .createObjectBuilder ()
954- .add ("value" , datasetCitationText )
955- .add ("typeClass" , "primitive" )
956- .add ("multiple" , false )
957- .add ("typeName" , "publicationCitation" )
958- )
959- .add ("publicationIDType" ,
960- Json .createObjectBuilder ()
961- .add ("value" , datasetPidProtocol )
962- .add ("typeClass" , "controlledVocabulary" )
963- .add ("multiple" , false )
964- .add ("typeName" , "publicationIDType" )
965- )
966- .add ("publicationIDNumber" ,
967- Json .createObjectBuilder ()
968- .add ("value" , datasetPidWithoutProtocol )
969- .add ("typeClass" , "primitive" )
970- .add ("multiple" , false )
971- .add ("typeName" , "publicationIDNumber" )
972- )
973- .add ("publicationURL" ,
974- Json .createObjectBuilder ()
975- .add ("value" , datasetPidUrl )
976- .add ("typeClass" , "primitive" )
977- .add ("multiple" , false )
978- .add ("typeName" , "publicationURL" )
979- )
980- )
981- )
982- .add ("typeClass" , "compound" )
983- .add ("multiple" , true )
984- .add ("typeName" , "publication" )
985- )
986866 )
987867 )
988868 ));
0 commit comments