Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
ValUnifer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IPIPAN
ValUnifer
Commits
8efeabb4
Commit
8efeabb4
authored
Sep 22, 2023
by
dcz
Browse files
Options
Downloads
Patches
Plain Diff
All preference adding constraint.
parent
70a6c2fb
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend/src/components/unification/Unification/SelectionalPreference.js
+1
-2
1 addition, 2 deletions
...mponents/unification/Unification/SelectionalPreference.js
unifier/views.py
+14
-8
14 additions, 8 deletions
unifier/views.py
with
15 additions
and
10 deletions
frontend/src/components/unification/Unification/SelectionalPreference.js
+
1
−
2
View file @
8efeabb4
...
...
@@ -352,8 +352,7 @@ export default class SelectionalPreference {
synset_hierarchy_conflict_alert
(
response
)
{
const
conflict_exists
=
response
.
conflict_exists
;
if
(
conflict_exists
!=
null
)
{
alert
(
'
Wybrana preferencja selekcyjna nie mogła zostać zapisana ponieważ widnieje już na liście preferencji selekcyjnych:
'
+
conflict_exists
)
alert
(
conflict_exists
)
}
else
{
const
conflict_hyponym
=
response
.
conflict_hyponym
;
const
conflict_hyperonym
=
response
.
conflict_hyperonym
;
...
...
This diff is collapsed.
Click to expand it.
unifier/views.py
+
14
−
8
View file @
8efeabb4
...
...
@@ -88,7 +88,7 @@ def check_sysnet_hierarchy_constraints(synset_preference_ids, unified_frame_argu
return
{
"
succ
"
:
False
,
"
conflict_hyponym
"
:
conflict_hyponym_lu_str
,
"
conflict_hyperonym
"
:
conflict_hyperonym_lu_str
,
"
conflict_exists
"
:
conflict_exists_lu_str
}
"
conflict_exists
"
:
"
Wybrana preferencja selekcyjna nie mogła zostać zapisana ponieważ widnieje już na liście preferencji selekcyjnych:
"
+
conflict_exists_lu_str
}
return
{
"
succ
"
:
True
}
...
...
@@ -111,7 +111,13 @@ def save_predefined_preference(request):
unified_frame_argument
=
UnifiedFrameArgument
.
objects
.
get
(
unified_frame_id
=
int
(
frame_id
),
id
=
int
(
complement_id
))
predefined_synset_ids
=
[]
get_predefined_preference_synsets
([
PredefinedSelectionalPreference
.
objects
.
get
(
id
=
predefined_preference_id
)],
predefined_synset_ids
)
pred_sel_pref
=
PredefinedSelectionalPreference
.
objects
.
get
(
id
=
predefined_preference_id
)
if
pred_sel_pref
.
name
==
'
ALL
'
and
len
(
unified_frame_argument
.
predefined
.
all
())
>
0
:
return
JsonResponse
({
"
succ
"
:
False
,
"
conflict_hyponym
"
:
None
,
"
conflict_hyperonym
"
:
None
,
"
conflict_exists
"
:
"
Predefiniowana preferencja selekcyjna ALL może być dodana tylko, gdy nie na liście nie widnieją inne preferencje selekcyjne.
"
})
else
:
get_predefined_preference_synsets
([
pred_sel_pref
],
predefined_synset_ids
)
check_sysnet_hierarchy_constraints_ret
=
check_sysnet_hierarchy_constraints
(
predefined_synset_ids
,
unified_frame_argument
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment