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

story/VOGRE-7 #15

Open
wants to merge 94 commits into
base: develop
Choose a base branch
from
Open

story/VOGRE-7 #15

wants to merge 94 commits into from

Conversation

Girik1105
Copy link
Contributor

@Girik1105 Girik1105 commented Nov 5, 2024

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]).

  • I have removed all code style changes that are not necessary (e.g. changing blanks across the whole file that don’t need to be changed, adding empty lines in parts other than your own code)
  • I am not making any changes to files that don’t have any effect (e.g. imports added that don’t need to be added)
  • I do not have any sysout statements in my code or commented out code that isn’t needed anymore
  • I am not reformatting any files in the wrong format or without cause.
  • I am not changing file encoding or line endings to something else than UTF-8, LF
  • My pull request does not show an insane amount of files being changed although my ticket only requires a few files being changed
  • I have added Javadoc/documentation where appropriate
  • I have added test cases where appropriate
  • I have explained any part of my code/implementation decisions that is not be self-explanatory

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?

Anything else the reviewer needs to know?

... describe here ...

Girik1105 and others added 30 commits August 9, 2024 17:59
…ory text import for importing and repository text for details
.env_app-example Outdated
BASE_URL=http://localhost:8000/
QUADRIGA_ENDPOINT=
QUADRIGA_COLLECTION_ID=
Copy link
Member

Choose a reason for hiding this comment

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

this is something that needs to be set for each project. Every project can have a different collection it submits quadruples to.


# Cache the last check time to reduce query frequency
last_check_time = None
check_interval = timedelta(minutes=5) # Adjust the interval as needed
Copy link
Member

Choose a reason for hiding this comment

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

needs to be configurable through settings

this field is to prevent duplicate submissions.
"""
STATUS_CHOICES = [
('not_ready', 'Not Ready'),
Copy link
Member

Choose a reason for hiding this comment

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

the first value here should be defined in constants, so the constants can be used elsewhere (see below)

if self.status != 'submitted': # Avoid overriding submitted status
self.status = 'ready_to_submit'
else:
self.status = 'not_ready'
Copy link
Member

Choose a reason for hiding this comment

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

in line 920 and 922 the constants defined above should be sued

},
"context": {
"creator": user.username,
"creationTime": timezone.now().strftime('%Y-%m-%d'),
Copy link
Member

Choose a reason for hiding this comment

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

this should be the time an appellation was created

"context": {
"creator": user.username,
"creationTime": timezone.now().strftime('%Y-%m-%d'),
"creationPlace": "phoenix",
Copy link
Member

Choose a reason for hiding this comment

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

let's leave that empty for now

"creator": user.username,
"creationTime": timezone.now().strftime('%Y-%m-%d'),
"creationPlace": "phoenix",
"sourceUri": concept.authority if hasattr(concept, 'authority') else ""
Copy link
Member

Choose a reason for hiding this comment

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

this needs to be the the uri of the text that has been annotated, so for now let's use the the url of the annotated text

Copy link
Member

Choose a reason for hiding this comment

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

the above comments apply to all contexts

}
}

def generate_graph_data(relationset, user):
Copy link
Member

Choose a reason for hiding this comment

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

is this the same function as above?

return Response({'error': 'You are not authorized to submit this RelationSet.'},
status=status.HTTP_403_FORBIDDEN)

if relationset.status != 'ready_to_submit':
Copy link
Member

Choose a reason for hiding this comment

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

use constant here

@jdamerow
Copy link
Member

jdamerow commented Nov 8, 2024

Also, there are conflicts

@jdamerow jdamerow closed this Nov 8, 2024
@Girik1105 Girik1105 reopened this Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants