Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Rodolf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cubicweb
cubes
Rodolf
Commits
77c6b264f1c3
Commit
77c6b264f1c3
authored
1 year ago
by
Alexandre Richardson
Browse files
Options
Downloads
Patches
Plain Diff
feat: save input data associated to an import process
parent
ba4990d7978b
No related branches found
No related tags found
1 merge request
!30
Topic/default/save input data
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cubicweb_rodolf/import_data.py
+10
-0
10 additions, 0 deletions
cubicweb_rodolf/import_data.py
test/test_rodolf.py
+6
-0
6 additions, 0 deletions
test/test_rodolf.py
with
16 additions
and
0 deletions
cubicweb_rodolf/import_data.py
+
10
−
0
View file @
77c6b264
...
@@ -91,6 +91,16 @@
...
@@ -91,6 +91,16 @@
)
)
rdf_graph
=
process_to_apply
(
import_process
,
log
)
rdf_graph
=
process_to_apply
(
import_process
,
log
)
log
.
info
(
f
"
Data was successfully downloaded from
{
dataservice
.
dc_title
()
}
"
)
log
.
info
(
f
"
Data was successfully downloaded from
{
dataservice
.
dc_title
()
}
"
)
import_process
.
cw_set
(
has_input_dataset
=
cnx
.
create_entity
(
"
File
"
,
title
=
f
"
Input dataset for ImportProcess#
{
import_process_eid
}
"
,
data
=
Binary
(
rdf_graph
.
serialize
(
format
=
"
ttl
"
).
encode
(
"
utf8
"
)),
data_name
=
f
"
Input_dataset_
{
import_process
.
eid
}
.ttl
"
,
data_format
=
"
text/turtle
"
,
)
)
log
.
info
(
f
"
Input data was successfully saved for
{
dataservice
.
dc_title
()
}
"
)
valid_rdf
,
shacl_errors
=
check_rdf_graph
(
rdf_graph
,
import_procedure
)
valid_rdf
,
shacl_errors
=
check_rdf_graph
(
rdf_graph
,
import_procedure
)
if
not
valid_rdf
:
if
not
valid_rdf
:
...
...
This diff is collapsed.
Click to expand it.
test/test_rodolf.py
+
6
−
0
View file @
77c6b264
...
@@ -131,6 +131,12 @@
...
@@ -131,6 +131,12 @@
import_process
=
task
.
reverse_rq_task
[
0
]
import_process
=
task
.
reverse_rq_task
[
0
]
wf
=
import_process
.
cw_adapt_to
(
"
IWorkflowable
"
)
wf
=
import_process
.
cw_adapt_to
(
"
IWorkflowable
"
)
self
.
assertEqual
(
wf
.
state
,
"
successful
"
)
self
.
assertEqual
(
wf
.
state
,
"
successful
"
)
self
.
assertEqual
(
len
(
import_process
.
has_input_dataset
),
1
)
input_dataset
=
import_process
.
has_input_dataset
[
0
]
self
.
assertEqual
(
input_dataset
.
data_name
,
f
"
Input_dataset_
{
import_process
.
eid
}
.ttl
"
)
@requests_mock.mock
()
@requests_mock.mock
()
def
test_shacl_nok
(
self
,
mock
):
def
test_shacl_nok
(
self
,
mock
):
...
...
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