cmem-cmemc 24.3.2__py3-none-any.whl → 24.3.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -21,6 +21,7 @@ from cmem_cmemc.migrations.shapes_widget_integrations_243 import (
21
21
  TableReportPropertyShapesToWidgetIntegrations,
22
22
  WorkflowTriggerPropertyShapesToWidgetIntegrations,
23
23
  )
24
+ from cmem_cmemc.migrations.sparql_query_texts_242 import SparqlDatatypesToXsdString
24
25
  from cmem_cmemc.migrations.workspace_configurations import MigrateWorkspaceConfiguration
25
26
  from cmem_cmemc.object_list import (
26
27
  DirectListPropertyFilter,
@@ -56,6 +57,7 @@ def get_migrations(ctx: click.Context) -> list[dict]: # noqa: ARG001
56
57
  ChartsOnPropertyShapesToWidgetIntegrations(),
57
58
  WorkflowTriggerPropertyShapesToWidgetIntegrations(),
58
59
  TableReportPropertyShapesToWidgetIntegrations(),
60
+ SparqlDatatypesToXsdString(),
59
61
  ]
60
62
  ]
61
63
  data.sort(key=lambda x: x["first_version"])
@@ -26,6 +26,7 @@ class MigrationRecipe(ABC):
26
26
  "sh": "http://www.w3.org/ns/shacl#",
27
27
  "auth": "https://vocab.eccenca.com/auth/",
28
28
  "shui": "https://vocab.eccenca.com/shui/",
29
+ "xsd": "http://www.w3.org/2001/XMLSchema#",
29
30
  }
30
31
 
31
32
  @abstractmethod
@@ -0,0 +1,53 @@
1
+ """Migration: Chart and Workflow Property Shapes to Widget Integration"""
2
+
3
+ from typing import ClassVar
4
+
5
+ from cmem_cmemc.migrations.abc import MigrationRecipe, components
6
+
7
+
8
+ class SparqlDatatypesToXsdString(MigrationRecipe):
9
+ """24.2 Migrate shui:sparqlQuery|sparqlUpdate datatype literals to xsd:string literals"""
10
+
11
+ id = "sparql-query-datatypes-24.2"
12
+ description = "Migrate shui SPARQL datatype literals to xsd:string literals"
13
+ component: components = "explore"
14
+ first_version = "24.2"
15
+ tags: ClassVar[list[str]] = ["shapes", "user"]
16
+ check_query = """{{DEFAULT_PREFIXES}}
17
+ SELECT DISTINCT ?query
18
+ WHERE {
19
+ GRAPH ?shapeOrQueryGraph {
20
+ ?query shui:queryText ?text .
21
+ FILTER ( datatype(?text) IN (shui:sparqlQuery, shui:sparqlUpdate) )
22
+ }
23
+ }
24
+ """
25
+ move_query = """{{DEFAULT_PREFIXES}}
26
+ DELETE {
27
+ GRAPH ?shapeOrQueryGraph {
28
+ ?query shui:queryText ?oldLiteral .
29
+ }
30
+ }
31
+ INSERT {
32
+ GRAPH ?shapeOrQueryGraph {
33
+ ?query shui:queryText ?newLiteral .
34
+ }
35
+ }
36
+ # SELECT DISTINCT ?query
37
+ WHERE {
38
+ GRAPH ?shapeOrQueryGraph {
39
+ ?query shui:queryText ?oldLiteral .
40
+ FILTER ( datatype(?oldLiteral) IN (shui:sparqlQuery, shui:sparqlUpdate) )
41
+ BIND (STRDT(STR(?oldLiteral), xsd:string) AS ?newLiteral)
42
+ }
43
+ }
44
+ """
45
+
46
+ def is_applicable(self) -> bool:
47
+ """Test if the recipe can be applied."""
48
+ queries_with_old_literals = self._select(self.check_query)
49
+ return len(queries_with_old_literals) > 0
50
+
51
+ def apply(self) -> None:
52
+ """Apply the recipe to the current version."""
53
+ self._update(self.move_query)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cmem-cmemc
3
- Version: 24.3.2
3
+ Version: 24.3.3
4
4
  Summary: Command line client for eccenca Corporate Memory
5
5
  License: Apache-2.0
6
6
  Author: eccenca
@@ -10,7 +10,7 @@ cmem_cmemc/commands/config.py,sha256=j0zc9EFWW7Kw9bzSb_r16m-A0LZersKbZ9j5GE0mGcQ
10
10
  cmem_cmemc/commands/dataset.py,sha256=xsIUiC2aMDiESjnZvjDY5Mh2fvSooOijQmo5A7RvY40,30397
11
11
  cmem_cmemc/commands/graph.py,sha256=OHBMHLU5PNrbnxinvjE5Z7FQv8bU8WW-0RCfdoovXl0,32412
12
12
  cmem_cmemc/commands/metrics.py,sha256=zsyHezoYwig6jIdn7g9NZMqt9DxG6dQRoO0vP3Eu0Rc,12176
13
- cmem_cmemc/commands/migration.py,sha256=IubT8uA-cyn5frofUcknMWEBLMPeEoKMb0xNbJRXNn4,9412
13
+ cmem_cmemc/commands/migration.py,sha256=SFmEeUP744oJMdbz3RXA-zPtqeV6iWcBKiaKhWsMZe0,9538
14
14
  cmem_cmemc/commands/project.py,sha256=1BwAAZvupImqkW3Q3dXdkMir8-wnWRMsewnOyVui3QY,20545
15
15
  cmem_cmemc/commands/python.py,sha256=80k-z6AcL1Ibp5CqVHATjvK0t9wv24QsepDB0vrfDFU,10760
16
16
  cmem_cmemc/commands/query.py,sha256=KUck4w7PD0e5JYg5Eykf2QAMBfpwmgskEiIA-X_PqZs,26973
@@ -32,10 +32,11 @@ cmem_cmemc/manual_helper/graph.py,sha256=qDchHdjRRDW2oZ66by81NxhoDgNxXaAUxq2keew
32
32
  cmem_cmemc/manual_helper/multi_page.py,sha256=5nvN1P7zTgzrnuoT7yA7abyT7EOVa24Jvp3Q2xZmXro,12236
33
33
  cmem_cmemc/manual_helper/single_page.py,sha256=sVSeaZmPa-Cs6dtp27MqyiO6rIrskY9BtDyeAZhBWXM,1477
34
34
  cmem_cmemc/migrations/__init__.py,sha256=i6Ri7qN58ou_MwOzm2KibPkXOD7u-1ELky-nUE5LjAA,24
35
- cmem_cmemc/migrations/abc.py,sha256=Q4G0tRiFruawm6qvvSC_02FkDTC-Jav4VP2Suoy5hzE,3512
35
+ cmem_cmemc/migrations/abc.py,sha256=UGJzrvMzUFdp2-sosp49ObRI-SrUSzLJqLEhvB4QTzg,3564
36
36
  cmem_cmemc/migrations/access_conditions_243.py,sha256=IXcvSuo9pLaTTo4XNBB6_ln-2TzOV5PU5ugti0BWbxA,5083
37
37
  cmem_cmemc/migrations/bootstrap_data.py,sha256=RF0vyFTGUQ_RcpTTWZmm3XLAJAJX2gSYcGwcBmRmU8A,963
38
38
  cmem_cmemc/migrations/shapes_widget_integrations_243.py,sha256=jRWtTFeMom-xUI7UaoTa3DoLmmdwFmaw9XYxvnelxMo,8746
39
+ cmem_cmemc/migrations/sparql_query_texts_242.py,sha256=K_GbxaX5-kkQKDZMq8UvT1vHazde53htwdDHGyB0b9s,1568
39
40
  cmem_cmemc/migrations/workspace_configurations.py,sha256=tFmCdfEL10ICjqMXQEIf-9fveE41HBQ_jaWNQJENz50,998
40
41
  cmem_cmemc/object_list.py,sha256=NYArisZxCV4pws_Tgk_xyltLN6TStkxQAgy-WLlzOxc,14712
41
42
  cmem_cmemc/parameter_types/__init__.py,sha256=Jqhwnw5a2oPNMClzUyovWiieK60RCl3rvSNr-t3wP84,36
@@ -46,8 +47,8 @@ cmem_cmemc/smart_path/clients/http.py,sha256=3clZu2v4uuOvPY4MY_8SVSy7hIXJDNooahF
46
47
  cmem_cmemc/string_processor.py,sha256=kSVePdgFmf2ekurKj6TbDJn6ur82VGLwCsTJ9ODfBEU,2879
47
48
  cmem_cmemc/title_helper.py,sha256=7frjAR54_Xc1gszOWXfzSmKFTawNJQ7kkXhZcHmQLyw,1250
48
49
  cmem_cmemc/utils.py,sha256=DXcJo6F2rYP1xeaI3wSvUVlS6GXbGTDJZLci7T5Rgd4,12220
49
- cmem_cmemc-24.3.2.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
50
- cmem_cmemc-24.3.2.dist-info/METADATA,sha256=6_dKhAqyFK1a62Ju8ZyLDfMAXENC-ARAo05Oc2SK5fc,5641
51
- cmem_cmemc-24.3.2.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
52
- cmem_cmemc-24.3.2.dist-info/entry_points.txt,sha256=znWUTG-zgDITu6Frsd-OtNxBxj6Uo8Fa7bz6gaZYMrA,41
53
- cmem_cmemc-24.3.2.dist-info/RECORD,,
50
+ cmem_cmemc-24.3.3.dist-info/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
51
+ cmem_cmemc-24.3.3.dist-info/METADATA,sha256=SwZmHE0rxwd7XEA1ag86JS0GMyOIP-YLt89jBHa3d9Y,5641
52
+ cmem_cmemc-24.3.3.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
53
+ cmem_cmemc-24.3.3.dist-info/entry_points.txt,sha256=znWUTG-zgDITu6Frsd-OtNxBxj6Uo8Fa7bz6gaZYMrA,41
54
+ cmem_cmemc-24.3.3.dist-info/RECORD,,