Skip to content
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

[Backend] Annotation Data Model and Endpoints #454

Merged
merged 7 commits into from
Dec 18, 2022

Conversation

mehmetemreakbulut
Copy link
Contributor

@mehmetemreakbulut mehmetemreakbulut commented Dec 18, 2022

Description:
We started to implement annotation and an API is needed to handle the annotation schema that comes from Frontend. For Posts and Articles we have to store Annotations. Create, Update, Delete and Get functionalities of Annotation will be imlemented.

Tasks Done:

  • Annotation Create and Get Methods
  • Annotation Update and Delete Methods
  • Annotation Schema mapper
  • Unit Tests added

Example Schema for Text Annotation:

{
    "@context": "http://www.w3.org/ns/anno.jsonld",
    "body": [
        {
            "created": "2022-12-17T21:01:59.693Z",
            "creator": {
                "id": "http://3.91.54.225:3000/profile/61",
                "displayName": "Mehmet Emre Akbulut"
            },
            "modified": "2022-12-17T21:01:59.693Z",
            "purpose": "commenting",
            "type": "TextualBody",
            "value": "Content of The Annotation"
        }
    ],
    "id": "#id",
    "target": {
        "selector": [
            {
                "exact": "Exact String Selected",
                "type": "TextQuoteSelector"
            },
            {
                "start": 222,
                "end": 234,
                "type": "TextPositionSelector"
            }
        ]
    },
    "type": "Annotation"
}

Example Schema for Image Annotation:

{
    "@context": "http://www.w3.org/ns/anno.jsonld",
    "body": [
        {
            "created": "2022-12-17T21:01:59.693Z",
            "creator": {
                "id": "http://3.91.54.225:3000/profile/61",
                "displayName": "Mehmet Emre Akbulut"
            },
            "modified": "2022-12-17T21:01:59.693Z",
            "purpose": "commenting",
            "type": "TextualBody",
            "value": "Content of The Annotation"
        }
    ],
    "id": "#b3343k4klRANDOM3434fdfd",
    "target": {
        "selector": {
            "conformsTo": "http://www.w3.org/TR/media-frags/",
            "type": "FragmentSelector",
            "value": "xywh=pixel:491.23232,323.23232,436.8787, 123.4343"
        },
        "source": "URL OF PHOTO"
    },
    "type": "Annotation"
}

Reviewer: @irfanbozkurt

@mehmetemreakbulut mehmetemreakbulut self-assigned this Dec 18, 2022
@mehmetemreakbulut mehmetemreakbulut added Prio: High Importance of Issue: High Type: To Do Our tasks are labeled with this label. Status: In Progress Issue is worked on, currently Team: Backend Backend based work - for backend team labels Dec 18, 2022
Copy link
Member

@irfanbozkurt irfanbozkurt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I love that you added unit tests. I feel like we're close to our goals. Thanks!

@irfanbozkurt irfanbozkurt merged commit 4204404 into master Dec 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prio: High Importance of Issue: High Status: In Progress Issue is worked on, currently Team: Backend Backend based work - for backend team Type: To Do Our tasks are labeled with this label.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants