IQSS / IQSS/dataverse-client-javascript

Extend GetCollectionItems use case: add show_relevance

Đang mở
#464 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

GREI Re-arch SPA
Ngôn ngữ chính
TypeScript
Star
20
Fork
11
Merge trung bình
2 ngày 5 giờ
Pull request đã merge (30 ngày)
1

Mô tả

In the Collections page, when a term is entered in the search bar, the collection items should show snippets with the search term highlighted. To do this, we need to update GetCollectionItems to call the Dataverse search api with show_relevance=true.

For example, when searching for 'King' in Dataverse, the snippets of metadata that contain king are shown, and for the description field, 'King' is highlighted.
In the JSF, we are only highlighting the search term in the description, but using the API we could also highlight the term in other metadata.

The API for this example:
https://dataverse.harvard.edu/api/v1/search?show_relevance=true&q=king&show_facets=true&sort=score&order=desc&subtree=harvard&per_page=10&type=dataverse&type=dataset&type=file

In the response, the matches array contains the snippets to be displayed:

{
  "status": "OK",
  "data": {
    "q": "king",
    "total_count": 3019,
    "start": 0,
    "spelling_alternatives": {

    },
    "items": [
      {
        "name": "Replication data for: Empirical vs. Theoretical Claims about Extreme Counterfactuals: A Response",
        "type": "dataset",
        "url": "https://doi.org/10.7910/DVN/VL7QMO",
        "image_url": "https://dataverse.harvard.edu/api/datasets/53129/logo",
        "global_id": "doi:10.7910/DVN/VL7QMO",
        "description": "A response to Sambanis and Michaelides, \"A Comment on Diagnostic Tools for Counterfactual Inference\", which was a comment on: Gary King and Langche Zeng. 2006. \" The Dangers of Extreme Counterfactuals,\" Political Analysis, 14, 2, Pp. 131-159. In response to the data-based measures of model dependence proposed in King and Zeng (2006), Sambanis and Michaelides (2008) propose alternative measures that rely upon assumptions untestable in observational data. If these assumptions are correct, then their measures are appropriate and ours, based solely on the empirical data, may be too conser vative. If instead and as is usually the case, the researcher is not certain of the precise functional form of the data generating process, the distribution from whic h the data are drawn, and the applicability of these modeling assumptions to new counterfactuals, then the data-based measures proposed in King and Zeng (2006) are much preferred. After all, the point of model dependence checks is to verify empirically, rather than to stipulate by assumption, the effects of modeling assumptions on counterfactual inferences.",
        "published_at": "2014-08-07T00:00:00Z",
        "publisher": "Gary King Dataverse",
        "citationHtml": "King, Gary; Zeng, Langche, 2009, \"Replication data for: Empirical vs. Theoretical Claims about Extreme Counterfactuals: A Response\", \u003Ca href=\"https://doi.org/10.7910/DVN/VL7QMO\" target=\"_blank\"\u003Ehttps://doi.org/10.7910/DVN/VL7QMO\u003C/a\u003E, Harvard Dataverse, V5",
        "identifier_of_dataverse": "king",
        "name_of_dataverse": "Gary King Dataverse",
        "citation": "King, Gary; Zeng, Langche, 2009, \"Replication data for: Empirical vs. Theoretical Claims about Extreme Counterfactuals: A Response\", https://doi.org/10.7910/DVN/VL7QMO, Harvard Dataverse, V5",
        "matches": [
          {
            "dsDescriptionValue": {
              "snippets": [
                "A response to Sambanis and Michaelides, \"A Comment on Diagnostic Tools for Counterfactual Inference\", which was a comment on: Gary \u003Cspan class=\"search-term-match\"\u003EKing\u003C/span\u003E and Langche Zeng. 2006. \" The Dangers of Extreme Counterfactuals,\" Political Analysis, 14, 2, Pp. 131-159. In response to the data-based measures of model dependence proposed in \u003Cspan class=\"search-term-match\"\u003EKing\u003C/span\u003E and Zeng (2006), Sambanis and Michaelides (2008) propose alternative measures that rely upon assumptions untestable in observational data. "
              ]
            }
          },
          {
            "publicationCitation": {
              "snippets": [
                "\u003Cspan class=\"search-term-match\"\u003EKing\u003C/span\u003E, Gary, and Langche Zeng. 2009. Empirical versus Theoretical Claims about Extreme Counterfactuals: A Response. Political Analysis 17: 107-112: Link to article"
              ]
            }
          },
          {
            "authorName": {
              "snippets": [
                "\u003Cspan class=\"search-term-match\"\u003EKing\u003C/span\u003E, Gary"
              ]
            }
          }
        ],
        "score": 7039.38525390625,
        "publicationStatuses": [
          "Published"
        ],
        "storageIdentifier": "s3://1902.1/11903",
        "subjects": [
          ""
        ],
        "fileCount": 13,
        "versionId": 428465,
        "versionState": "RELEASED",
        "majorVersion": 5,
        "minorVersion": 2,
        "createdAt": "2008-09-06T16:35:54Z",
        "updatedAt": "2024-09-20T15:10:46Z",
        "contacts": [
          {
            "name": "",
            "affiliation": ""
          }
        ],
        "publications": [
          {
            "citation": "King, Gary, and Langche Zeng. 2009. Empirical versus Theoretical Claims about Extreme Counterfactuals: A Response. Political Analysis 17: 107-112: \u003Ca href=\"http://j.mp/pr0WRJ\" target=\"_blank\" rel=\"nofollow\"\u003ELink to article\u003C/a\u003E"
          }
        ],
        "authors": [
          "King, Gary",
          "Zeng, Langche"
        ]
      },
Image

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu từ use case GetCollectionItems và theo dõi cách trang Collections xây dựng request tìm kiếm Dataverse cũng như render kết quả. Xác minh rằng request có chứa show_relevance=true khi một search term được nhập, sau đó xác nhận rằng các snippet từ mảng matches trong response được hiển thị với các term được highlight trong các trường metadata.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
typescript
Lĩnh vực
frontend
Loại issue
Tính năng
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Ít trao đổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
66/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.