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
a626feac4ea4
Commit
a626feac4ea4
authored
1 year ago
by
Fabien Amarger
Browse files
Options
Downloads
Patches
Plain Diff
feat(process): Use upload_graph_to_sparql_endpoint into the default process type
parent
4e4f83244752
No related branches found
No related tags found
1 merge request
!22
Export data into SPARQL endpoint
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cubicweb_rodolf/sobjects/process_type_registry.py
+20
-9
20 additions, 9 deletions
cubicweb_rodolf/sobjects/process_type_registry.py
with
20 additions
and
9 deletions
cubicweb_rodolf/sobjects/process_type_registry.py
+
20
−
9
View file @
a626feac
...
@@ -2,5 +2,4 @@
...
@@ -2,5 +2,4 @@
from
rdflib
import
Graph
from
rdflib
import
Graph
from
cubicweb.appobject
import
AppObject
from
cubicweb.appobject
import
AppObject
from
cubicweb
import
Binary
...
@@ -6,5 +5,8 @@
...
@@ -6,5 +5,8 @@
from
cubicweb_rodolf.process_helpers
import
get_graph_from_url
from
cubicweb_rodolf.process_helpers
import
(
get_graph_from_url
,
upload_graph_to_sparql_endpoint
,
)
from
cubicweb_rodolf.schema
import
ImportProcess
from
cubicweb_rodolf.schema
import
ImportProcess
...
@@ -14,5 +16,6 @@
...
@@ -14,5 +16,6 @@
def
__call__
(
self
,
import_process
:
ImportProcess
,
log
:
logging
.
Logger
)
->
Graph
:
def
__call__
(
self
,
import_process
:
ImportProcess
,
log
:
logging
.
Logger
)
->
Graph
:
import_recipe
=
import_process
.
import_recipe
[
0
]
import_recipe
=
import_process
.
import_recipe
[
0
]
import_procedure
=
import_process
.
import_procedure
[
0
]
dataservice
=
import_recipe
.
dataservice
[
0
]
dataservice
=
import_recipe
.
dataservice
[
0
]
graph
=
get_graph_from_url
(
dataservice
.
data_url
,
log
)
graph
=
get_graph_from_url
(
dataservice
.
data_url
,
log
)
...
@@ -17,3 +20,10 @@
...
@@ -17,3 +20,10 @@
dataservice
=
import_recipe
.
dataservice
[
0
]
dataservice
=
import_recipe
.
dataservice
[
0
]
graph
=
get_graph_from_url
(
dataservice
.
data_url
,
log
)
graph
=
get_graph_from_url
(
dataservice
.
data_url
,
log
)
dataset_file
=
self
.
_cw
.
create_entity
(
"
File
"
,
title
=
f
"
Graph file for ImportProcess#
{
import_process
.
eid
}
"
,
data
=
Binary
(
graph
.
serialize
(
format
=
"
ttl
"
).
encode
(
"
utf8
"
)),
data_name
=
f
"
data_ImportProcess_
{
import_process
.
eid
}
.ttl
"
,
data_format
=
"
text/turtle
"
,
)
import_process
.
cw_set
(
import_process
.
cw_set
(
...
@@ -19,10 +29,11 @@
...
@@ -19,10 +29,11 @@
import_process
.
cw_set
(
import_process
.
cw_set
(
has_output_dataset
=
self
.
_cw
.
create_entity
(
has_output_dataset
=
dataset_file
,
"
File
"
,
)
title
=
f
"
Graph file for ImportProcess#
{
import_process
.
eid
}
"
,
upload_graph_to_sparql_endpoint
(
data
=
Binary
(
graph
.
serialize
(
format
=
"
ttl
"
).
encode
(
"
utf8
"
)),
import_procedure
,
data_name
=
f
"
data_ImportProcess_
{
import_process
.
eid
}
.ttl
"
,
graph
,
data_format
=
"
text/turtle
"
,
import_recipe
.
graph_uri
,
)
dataset_file
.
data_name
,
log
,
)
)
return
graph
return
graph
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