marktani / pdl-cts-server

A CTS server for the Persian Digital Library (PDL) project
MIT License
0 stars 0 forks source link

GetPassagePlus and GetPrevNextUrn throw error #1

Open marktani opened 1 year ago

marktani commented 1 year ago

GetPassagePlus

curl "http://localhost:8000/cts?request=GetPassagePlus&urn=urn:cts:perslit:forooghi.divan"
127.0.0.1 - - [30/Mar/2023 00:42:08] "GET /cts?request=GetPassagePlus&urn=urn:cts:perslit:forooghi.divan HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/flask/app.py", line 2551, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/flask/app.py", line 2531, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/flask/app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/Users/nilan/projects/pdl-cts-server/Nautilus/capitains_nautilus/flask_ext.py", line 212, in r
    val = getattr(self._extensions[extension_name], function_name)(*x, **y)
  File "/Users/nilan/projects/pdl-cts-server/Nautilus/capitains_nautilus/apis/cts.py", line 42, in r_cts
    return self._get_passage_plus(
  File "/Users/nilan/projects/pdl-cts-server/Nautilus/capitains_nautilus/apis/cts.py", line 143, in _get_passage_plus
    prev_urn=node.prevId,
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/MyCapytain/resources/texts/local/capitains/cts.py", line 407, in prevId
    return self.siblingsId[0]
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/MyCapytain/resources/texts/local/capitains/cts.py", line 424, in siblingsId
    if self.reference.is_range():
AttributeError: 'NoneType' object has no attribute 'is_range'

GetPrevNextUrn

curl "http://localhost:8000/cts?request=GetPrevNextUrn&urn=urn:cts:perslit:forooghi.divan"
127.0.0.1 - - [30/Mar/2023 00:44:51] "GET /cts?request=GetPrevNextUrn&urn=urn:cts:perslit:forooghi.divan HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/flask/app.py", line 2551, in __call__
    return self.wsgi_app(environ, start_response)
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/flask/app.py", line 2531, in wsgi_app
    response = self.handle_exception(e)
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/flask/app.py", line 2528, in wsgi_app
    response = self.full_dispatch_request()
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/flask/app.py", line 1825, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/flask/app.py", line 1823, in full_dispatch_request
    rv = self.dispatch_request()
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/flask/app.py", line 1799, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/Users/nilan/projects/pdl-cts-server/Nautilus/capitains_nautilus/flask_ext.py", line 212, in r
    val = getattr(self._extensions[extension_name], function_name)(*x, **y)
  File "/Users/nilan/projects/pdl-cts-server/Nautilus/capitains_nautilus/apis/cts.py", line 54, in r_cts
    return self._get_prev_next(
  File "/Users/nilan/projects/pdl-cts-server/Nautilus/capitains_nautilus/apis/cts.py", line 189, in _get_prev_next
    previous, nextious = self.resolver.getSiblings(textId=textId, subreference=subreference)
  File "/Users/nilan/projects/pdl-cts-server/Nautilus/capitains_nautilus/cts/resolver/base.py", line 260, in getSiblings
    siblings = passage.siblingsId
  File "/Users/nilan/projects/pdl-cts-server/venv/lib/python3.9/site-packages/MyCapytain/resources/texts/local/capitains/cts.py", line 424, in siblingsId
    if self.reference.is_range():
AttributeError: 'NoneType' object has no attribute 'is_range'
marktani commented 1 year ago

Need to check if this is due to the corpus data, or due to an issue in Nautilus itself