CenterForDigitalHumanities / TPEN-services

Services required by TPEN interfaces in order to interact with data
1 stars 0 forks source link

WIP on Issue 94-add-remove-update-lines-in-the-databases #105

Closed BhanuKandula5030 closed 3 months ago

BhanuKandula5030 commented 4 months ago

What was changed?

BhanuKandula5030 commented 4 months ago

These are the Postman Screenshots of the response for the page requests append and prepend line

pagepm1 pagepm2
BhanuKandula5030 commented 4 months ago

These are the postman screenshots for the line requests

linepm1 linepm2 linepm3
BhanuKandula5030 commented 4 months ago

Hi @thehabes I have updated the failing tests and addressed the tests for few new added functions .

thehabes commented 4 months ago

I had gotten the scope a little wrong. After some conversation with @BhanuKandula5030 here's what we came up with for the scenario I was testing here.

{
  "@context": "http://www.w3.org/ns/anno.jsonld",
  "@id": "https://devstore.rerum.io/v1/id/6627fc13a1162cbdb9d34a5d",
  "type": "AnnotationCollection",
  "label": "Project - Layer Title",
  "creator": "thehabes",
  "total": 1,
  "first": "https://devstore.rerum.io/v1/id/6627fc3d5cc3848690279f7c",
  "last": "https://devstore.rerum.io/v1/id/6627fc3d5cc3848690279f7c",
  "partOf": "https://static.t-pen.org/6621c63a8168b7592a0bc627/project.json"
}

{
  "@context": "http://www.w3.org/ns/anno.jsonld",
  "@id": "https://devstore.rerum.io/v1/id/6628169f496553f03ae35d25",
  "type": "AnnotationCollection",
  "label": "Layer in another project",
  "creator": "thehabes",
  "total": 1,
  "first":{
      "@context": "http://www.w3.org/ns/anno.jsonld",
      "@id":"https://devstore.rerum.io/v1/id/6627fc3d5cc3848690279f7c",
      "type": "AnnotationPage",
      "target" : "https://manifest/canvas/1",
      "next": "https://store.rerum.io/v1/id/page2",
      "items": [],
      "partOf": "https://devstore.rerum.io/v1/id/6627fc13a1162cbdb9d34a5d",
      "creator": "thehabes"
  }, 
  "partOf": "https://static.t-pen.org/7723d63a8168b7592a0bc791/project.json"
}

{
    "@context": "http://www.w3.org/ns/anno.jsonld",
    "@id":"https://devstore.rerum.io/v1/id/6627fc3d5cc3848690279f7c",
    "type": "AnnotationPage",
    "target" : "https://manifest/canvas/1",
    "next": "https://store.rerum.io/v1/id/page2",
    "items": [],
    "partOf": "https://devstore.rerum.io/v1/id/6627fc13a1162cbdb9d34a5d",
    "creator": "thehabes"
}

{
  "@context": "http://www.w3.org/ns/anno.jsonld",
  "@id": "https://devstore.rerum.io/v1/id/662801cbe8afc731e3b58e50",
  "creator": "thehabes",
  "type": "Annotation",
  "motivation": "supplementing",
  "body": {
    "type": "TextualBody",
    "value": "hello world",
    "format": "text/plain",
    "language": "la"
  },
  "target": "https://manifest/canvas/4#xywh=10,20,145,55"
}

What you have is an existing Annotation Page and an existing Annotation and they need to be put together. Be aware of how a PUT update works as you are not "overwriting" the object in place, but rather generating history. This is important because it means you will have to do upstream changes to the Annotation Collection as well, but that will come next. First, make sure /appendLine works with the provided Annotation Page and Annotation.

BhanuKandula5030 commented 4 months ago

Hi @thehabes

I have made the failing test for the check in the previous code .Now I made the syntax corrections and made it pass .I am Attaching the test case check .All the tests are passing.

image
BhanuKandula5030 commented 4 months ago

I have updated the append and prepend lone logics and used the https://devstore.rerum.io/v1/id/6627fc3d5cc3848690279f7c real annotation page provided and performed the tests. attaching the get requests of before POST append line request and after POST append line request screenshots where you see before as empty items and it got updated after append request which in corresponds updated in the next in get requests.

before append after append

BhanuKandula5030 commented 4 months ago

I have updated prepend line logics and used the https://devstore.rerum.io/v1/id/6627fc3d5cc3848690279f7c real annotation page provided and performed the tests. attaching the get requests of before POST prepend line request and after POST prepend line request screenshots before prepend after prepend