-
Notifications
You must be signed in to change notification settings - Fork 0
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
story/VOGRE-7 #15
story/VOGRE-7 #15
Conversation
…ngo inlinecss) and added collectstatic
…to fix import for text tor repository
…ory text import for importing and repository text for details
annotations/middleware.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right approach. It is likely to cause memory issues once there are sufficiently many relationsets. It also seems unnecessary. The only time we care about the readiness of a relation to be submitted is when we want to submit them or maybe when we look at a text. So it really only needs to be checked when the page shows all relations, and then only the relations that are relevant (not all of them).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is the right approach. It is likely to cause memory issues once there are sufficiently many relationsets. It also seems unnecessary. The only time we care about the readiness of a relation to be submitted is when we want to submit them or maybe when we look at a text. So it really only needs to be checked when the page shows all relations, and then only the relations that are relevant (not all of them).
If we only show the relations that can be submitted, then the user will not be able to see all relations that they have created on the text. Can we still show the relations that cannot be submitted with the disabled checkbox? I'll change the way we check for ready relations.
annotations/utils.py
Outdated
} | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two functions are specific to the quadriga api, aren't they? They should not be in the annotations util file.
annotations/views/rest_views.py
Outdated
return Response({'error': 'You are not authorized to submit this RelationSet.'}, | ||
status=status.HTTP_403_FORBIDDEN) | ||
|
||
if relationset.status != 'ready_to_submit': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this still
annotations/views/rest_views.py
Outdated
return Response({'error': 'You are not authorized to submit this RelationSet.'}, | ||
status=status.HTTP_403_FORBIDDEN) | ||
|
||
if relationset.status != 'ready_to_submit': |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and everywhere else where these strings are used
concepts/tasks.py
Outdated
# logger.debug("Resolve concept failed: %s" % str(E)) | ||
# return | ||
# logger.debug("Resolved concept %s" % manager.instance.uri) | ||
pass |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove commented out code
@@ -1,5 +1,4 @@ | |||
from __future__ import absolute_import | |||
|
|||
# This will make sure the app is always imported when | |||
# Django starts so that shared_task will use this app. | |||
from .celery import app as celery_app | |||
# Django starts so that shared_task will use this app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these comments still valid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
Resolve conflicts please |
… Remove middleware, complete get queryset method
Can one of the admins verify this patch? |
Resolve conflicts please |
@@ -15,3 +15,5 @@ export BASE_URL="http://localhost:8000/" | |||
# Make sure APP_ROOT variable ends with a / | |||
# this is the prefix that vogon will be deployed under (e.g. "vogon-2" for deployment at my-server.org/vogon-2) | |||
export APP_ROOT= | |||
|
|||
export QUADRIGA_ENDPOINT= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to have an example (as a comment), e.g http://quadriga.instance/quadriga/...whatever else needs to be here/
from annotations.models import TextCollection, VogonUserDefaultProject, Text | ||
from urllib.parse import urlparse | ||
import chardet | ||
from annotations.models import TextCollection, Text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this needed here?
"metadata": { | ||
"type": "appellation_event", | ||
"interpretation": concept.uri, | ||
"termParts": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there should be one term part for every piece of annotated text in an appellation (I think currently there can only be one term part as vogon doesn't allow highlighting multiple parts that are not together for one appellation). Position needs to be the position of the first character of the term part.
"termParts": [ | ||
{ | ||
"position": 1, | ||
"expression": concept.label or "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
expresssion is the annotated text
|
||
if obj and obj.uri not in nodes: | ||
obj_id = get_node_id() | ||
nodes[obj_id] = build_concept_node(obj, user, creation_time, source_uri) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about nested relations, in which subject or object are a relation?
graph_data = generate_graph_data(relationset, user) | ||
|
||
response = requests.post(endpoint, json=graph_data, headers=headers) | ||
response.raise_for_status() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
all the quadriga related things should happen in a quadriga file or class
@@ -1,5 +1,4 @@ | |||
from __future__ import absolute_import | |||
|
|||
# This will make sure the app is always imported when | |||
# Django starts so that shared_task will use this app. | |||
from .celery import app as celery_app | |||
# Django starts so that shared_task will use this app. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
Guidelines for Pull Requests
If you haven't yet read our code review guidelines, please do so, You can find them here.
Please confirm the following by adding an x for each item (turn
[ ]
into[x]
).Please provide a brief description of your ticket
Get rid of celery and submit quaduples on request
Description
Currently, quadruples are submitted via Celery on a cron job. Celery should be completely removed. Instead a project should have a button that will submit quadrupes to Quadriga. This ticket includes multiple tasks:
Quadruples need to have a flag (if they don’t already) that indicates if they ahve been submitted or not
Quaduples need to be submitted to the new Quadriga 2.0
Only quadruples with complete relationships (in which concepts have been resolved and added to conceptpower) should be submitted.
VOGRE-7
Are there any other pull requests that this one depends on?
VOGRE-14
Anything else the reviewer needs to know?
Since VOGRE-14 has url changes which also affect
annotator
andannotator factory
this PR will require changes once VOGRE-14 merged.