Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
ec-europa
digit-joinup-reference
Commits
8937d974
Commit
8937d974
authored
Jun 14, 2022
by
Claudiu Cristea
Browse files
Merge branch 'ISAICP-7163' into 'master'
ISAICP-7163: Orphaned triples and wrong predicates. See merge request
!46
parents
98359a75
e07b8daa
Pipeline
#437990
passed with stages
in 2 minutes and 2 seconds
Changes
1
Pipelines
28
Hide whitespace changes
Inline
Side-by-side
web/modules/custom/joinup_core/joinup_core.deploy.php
View file @
8937d974
...
...
@@ -20,3 +20,28 @@
function
joinup_core_deploy_108200
():
void
{
\
Drupal
::
database
()
->
schema
()
->
dropTable
(
'site_verify'
);
}
/**
* Update the predicates for field 'test_resource_type'.
*/
function
joinup_core_deploy_108201
()
{
/** @var \Drupal\Core\Database\Connection $query */
$query
=
\
Drupal
::
service
(
'sparql.endpoint'
);
$test_resource_type_query
=
<<<QUERY
DELETE { GRAPH ?g { ?subject <http://purl.org/dc/terms/DCMIType> ?object } }
INSERT { GRAPH ?g { ?subject <http://joinup.eu/test_resource_type> ?object } }
USING <http://joinup.eu/asset_release/draft>
USING <http://joinup.eu/asset_release/published>
WHERE { GRAPH ?g { ?subject <http://purl.org/dc/terms/DCMIType> ?object } }
QUERY;
$query
->
query
(
$test_resource_type_query
);
$orphaned_triples_query
=
<<<QUERY
DELETE { GRAPH ?g { ?s <http://joinup.eu/test_resource_type> ?o } }
WHERE { ?s <http://joinup.eu/test_resource_type> ?o
. VALUES ?g {<http://joinup.eu/asset_release/published> <http://joinup.eu/asset_release/draft> }
. FILTER NOT EXISTS { ?s a ?type }
}
QUERY;
$query
->
query
(
$orphaned_triples_query
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment