CAKES-coding / swe574-group2

This repo is created to demonstrate the skills develop a software as a team.
5 stars 1 forks source link

Annotation selector is ambiguous #166

Closed semihsolmaz closed 2 years ago

semihsolmaz commented 2 years ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to an article detail page
  2. Tag the article
  3. See annotation JSON from db record

Expected behavior Target selector should specify that the text position we give are n the abstract text only

Additional context refine annotation selector to specify abstract text

{
    "id": "http://www.wikode.com/wikode/tag/49",
    "body": "https://www.wikidata.org/wiki/Q54560095",
    "type": "Annotation",
    "target": {
        "source": "http://www.wikode.com/wikode/articleDetail/245", --> this is whole article page
        "selector": {
            "end": "301",
            "type": "TextPositionSelector", --> but this position is relative to beginning of abstract text
            "start": "298"
        }
    },
    "@context": "http://www.w3.org/ns/anno.jsonld"
}
kenankural commented 2 years ago

TextPositionSelector yerine Xpath selector kullanılacak.

semihsolmaz commented 2 years ago

https://github.com/CAKES-coding/swe574-group2/pull/188

Annotation JSON's selector is changed to XPathSelector refined by a TextPositionSelector

{
    "id": "http://www.wikode.com/wikode/tag/79",
    "body": "https://www.wikidata.org/wiki/Q12798054",
    "type": "Annotation",
    "target": {
        "source": "http://www.wikode.com/wikode/articleDetail/245",
        "selector": {
            "type": "XPathSelector",
            "value": "//*[@id=\"abstract-text\"]/text()",
            "refinedBy": {
                "end": "9",
                "type": "TextPositionSelector",
                "start": "0"
            }
        }
    },
    "@context": "http://www.w3.org/ns/anno.jsonld"
}