Skip to content
Snippets Groups Projects
Commit 8937d974 authored by Claudiu Cristea's avatar Claudiu Cristea
Browse files

Merge branch 'ISAICP-7163' into 'master'

ISAICP-7163: Orphaned triples and wrong predicates.

See merge request !46
parents 98359a75 e07b8daa
No related branches found
Tags v1.81.1
1 merge request!46ISAICP-7163: Orphaned triples and wrong predicates.
......@@ -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);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment