oldaplib 0.3.27__tar.gz → 0.3.28__tar.gz

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.
Files changed (165) hide show
  1. {oldaplib-0.3.27 → oldaplib-0.3.28}/PKG-INFO +1 -1
  2. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/ontologies/shared.trig +122 -1
  3. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/connection.py +43 -71
  4. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/datamodel.py +49 -47
  5. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/context.py +3 -1
  6. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/objectfactory.py +19 -2
  7. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/oldaplist.py +2 -0
  8. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/permissionset.py +26 -10
  9. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/project.py +36 -20
  10. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/user.py +74 -26
  11. oldaplib-0.3.28/oldaplib/src/version.py +1 -0
  12. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_anyuri.py +4 -4
  13. oldaplib-0.3.28/oldaplib/test/XXX_test_fasnacht.py +17 -0
  14. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_connection.py +0 -1
  15. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_context.py +4 -2
  16. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_datamodel.py +2 -5
  17. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_externalontologies.py +0 -1
  18. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_hasproperty.py +0 -1
  19. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_objectfactory.py +3 -3
  20. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_oldaplist.py +1 -1
  21. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_oldaplist_helpers.py +1 -1
  22. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_oldaplistnode.py +0 -1
  23. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_permissionset.py +2 -1
  24. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_project.py +0 -1
  25. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_propertyclass.py +0 -1
  26. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_resourceclass.py +1 -1
  27. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_user.py +0 -1
  28. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_xsd_datatypes.py +1 -1
  29. {oldaplib-0.3.27 → oldaplib-0.3.28}/pyproject.toml +1 -1
  30. oldaplib-0.3.27/oldaplib/apps/load_list.py +0 -45
  31. oldaplib-0.3.27/oldaplib/src/version.py +0 -1
  32. {oldaplib-0.3.27 → oldaplib-0.3.28}/README.md +0 -0
  33. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/__init__.py +0 -0
  34. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/ontologies/admin-testing.trig +0 -0
  35. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/ontologies/admin.trig +0 -0
  36. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/ontologies/example.trig +0 -0
  37. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/ontologies/oldap.trig +0 -0
  38. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/ontologies/oldap.ttl +0 -0
  39. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/ontologies/standard/.gitsave +0 -0
  40. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/__init__.py +0 -0
  41. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/cachesingleton.py +0 -0
  42. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/dtypes/__init__.py +0 -0
  43. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/dtypes/bnode.py +0 -0
  44. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/dtypes/languagein.py +0 -0
  45. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/dtypes/namespaceiri.py +0 -0
  46. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/dtypes/rdfset.py +0 -0
  47. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/dtypes/xsdset.py +0 -0
  48. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/__init__.py +0 -0
  49. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/action.py +0 -0
  50. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/adminpermissions.py +0 -0
  51. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/attributeclass.py +0 -0
  52. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/datapermissions.py +0 -0
  53. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/externalontologyattr.py +0 -0
  54. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/haspropertyattr.py +0 -0
  55. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/language.py +0 -0
  56. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/oldaplistattr.py +0 -0
  57. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/oldaplistnodeattr.py +0 -0
  58. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/owlpropertytype.py +0 -0
  59. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/permissionsetattr.py +0 -0
  60. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/projectattr.py +0 -0
  61. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/propertyclassattr.py +0 -0
  62. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/resourceclassattr.py +0 -0
  63. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/sparql_result_format.py +0 -0
  64. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/userattr.py +0 -0
  65. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/enums/xsd_datatypes.py +0 -0
  66. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/externalontology.py +0 -0
  67. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/globalconfig.py +0 -0
  68. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/hasproperty.py +0 -0
  69. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/Notify.py +0 -0
  70. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/__init__.py +0 -0
  71. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/attributechange.py +0 -0
  72. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/convert2datatype.py +0 -0
  73. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/irincname.py +0 -0
  74. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/json_encoder.py +0 -0
  75. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/langstring.py +0 -0
  76. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/numeric.py +0 -0
  77. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/observable_dict.py +0 -0
  78. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/observable_set.py +0 -0
  79. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/oldaperror.py +0 -0
  80. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/query_processor.py +0 -0
  81. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/semantic_version.py +0 -0
  82. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/serializeableset.py +0 -0
  83. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/serializer.py +0 -0
  84. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/singletonmeta.py +0 -0
  85. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/helpers/tools.py +0 -0
  86. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/iconnection.py +0 -0
  87. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/in_project.py +0 -0
  88. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/model.py +0 -0
  89. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/oldaplist_helpers.py +0 -0
  90. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/oldaplistnode.py +0 -0
  91. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/oldaplogging.py +0 -0
  92. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/propertyclass.py +0 -0
  93. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/resourceclass.py +0 -0
  94. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/userdataclass.py +0 -0
  95. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/__init__.py +0 -0
  96. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/floatingpoint.py +0 -0
  97. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/iri.py +0 -0
  98. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd.py +0 -0
  99. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_base64binary.py +0 -0
  100. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_boolean.py +0 -0
  101. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_byte.py +0 -0
  102. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_date.py +0 -0
  103. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_datetime.py +0 -0
  104. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_datetimestamp.py +0 -0
  105. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_decimal.py +0 -0
  106. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_double.py +0 -0
  107. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_duration.py +0 -0
  108. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_float.py +0 -0
  109. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_gday.py +0 -0
  110. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_gmonth.py +0 -0
  111. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_gmonthday.py +0 -0
  112. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_gyear.py +0 -0
  113. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_gyearmonth.py +0 -0
  114. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_hexbinary.py +0 -0
  115. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_id.py +0 -0
  116. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_idref.py +0 -0
  117. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_int.py +0 -0
  118. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_integer.py +0 -0
  119. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_language.py +0 -0
  120. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_long.py +0 -0
  121. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_name.py +0 -0
  122. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_ncname.py +0 -0
  123. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_negativeinteger.py +0 -0
  124. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_nmtoken.py +0 -0
  125. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_nonnegativeinteger.py +0 -0
  126. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_nonpositiveinteger.py +0 -0
  127. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_normalizedstring.py +0 -0
  128. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_positiveinteger.py +0 -0
  129. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_qname.py +0 -0
  130. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_short.py +0 -0
  131. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_string.py +0 -0
  132. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_time.py +0 -0
  133. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_token.py +0 -0
  134. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_unsignedbyte.py +0 -0
  135. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_unsignedint.py +0 -0
  136. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_unsignedlong.py +0 -0
  137. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/src/xsd/xsd_unsignedshort.py +0 -0
  138. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/__init__.py +0 -0
  139. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_cache.py +0 -0
  140. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_dtypes.py +0 -0
  141. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_in_project.py +0 -0
  142. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_langstring.py +0 -0
  143. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_language_in.py +0 -0
  144. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_observable_dict.py +0 -0
  145. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_observable_set.py +0 -0
  146. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/test/test_semantic_version.py +0 -0
  147. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/Gender.yaml +0 -0
  148. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/collections_type.yaml +0 -0
  149. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/connection_test.trig +0 -0
  150. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/datamodel_test.trig +0 -0
  151. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/event_type.yaml +0 -0
  152. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/hlist_schema.yaml +0 -0
  153. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/instances_test.trig +0 -0
  154. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/institution_or_building_type.yaml +0 -0
  155. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/language.yaml +0 -0
  156. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/location_type.yaml +0 -0
  157. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/means_of_transportation.yaml +0 -0
  158. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/objectfactory_test.trig +0 -0
  159. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/playground_list.yaml +0 -0
  160. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/role.yaml +0 -0
  161. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/source_type-1.yaml +0 -0
  162. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/source_type.yaml +0 -0
  163. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/test_move_left_of_toL.yaml +0 -0
  164. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testdata/testlist.yaml +0 -0
  165. {oldaplib-0.3.27 → oldaplib-0.3.28}/oldaplib/testit.http +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oldaplib
3
- Version: 0.3.27
3
+ Version: 0.3.28
4
4
  Summary: Open Media Access Server Library (Linked Open Data middleware/RESTApi)
5
5
  License: GNU Affero General Public License version 3
6
6
  Author: Lukas Rosenthaler
@@ -4,6 +4,7 @@
4
4
  @prefix sh: <http://www.w3.org/ns/shacl#> .
5
5
  @prefix owl: <http://www.w3.org/2002/07/owl#> .
6
6
  @prefix dcterms: <http://purl.org/dc/terms/> .
7
+ @prefix dcmitype: <http://purl.org/dc/dcmitype/> .
7
8
  @prefix schema: <http://schema.org/> .
8
9
  @prefix oldap: <http://oldap.org/base#> .
9
10
 
@@ -109,6 +110,90 @@ shared:shacl {
109
110
  # Media object
110
111
  ###############################################################################
111
112
 
113
+ # dcmitype:CollectionShape a sh:NodeShape ;
114
+ # sh:targetClass shared:Collection ;
115
+ # dcterms:created "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
116
+ # dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
117
+ # dcterms:modified "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
118
+ # dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
119
+ # oldap:externalOntology "true"^^xsd:boolean ;
120
+ # rdfs:label "Collection"@en, "Sammlung"@de, "Collection"@fr, "Collezione"@it ;
121
+ # sh:property [
122
+ # sh:path rdf:type ;
123
+ # ] .
124
+ #
125
+ # dcmitype:DatasetShape a sh:NodeShape ;
126
+ # sh:targetClass shared:Dataset ;
127
+ # dcterms:created "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
128
+ # dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
129
+ # dcterms:modified "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
130
+ # dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
131
+ # oldap:externalOntology "true"^^xsd:boolean ;
132
+ # rdfs:label "Dataset"@en, "Dataset"@de, "Dataset"@fr, "Dataset"@it ;
133
+ # sh:property [
134
+ # sh:path rdf:type ;
135
+ # ] .
136
+ #
137
+ # dcmitype:StillImageShape a sh:NodeShape ;
138
+ # sh:targetClass shared:StillImage ;
139
+ # dcterms:created "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
140
+ # dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
141
+ # dcterms:modified "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
142
+ # dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
143
+ # oldap:externalOntology "true"^^xsd:boolean ;
144
+ # rdfs:label "StillImage"@en, "Standbild"@de, "Image fixe"@fr, "Immagine fissa"@it ;
145
+ # sh:property [
146
+ # sh:path rdf:type ;
147
+ # ] .
148
+ #
149
+ # dcmitype:ImageShape a sh:NodeShape ;
150
+ # sh:targetClass shared:Image ;
151
+ # dcterms:created "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
152
+ # dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
153
+ # dcterms:modified "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
154
+ # dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
155
+ # oldap:externalOntology "true"^^xsd:boolean ;
156
+ # rdfs:label "Image"@en, "Bild"@de, "Image"@fr, "Immagine"@it ;
157
+ # sh:property [
158
+ # sh:path rdf:type ;
159
+ # ] .
160
+ #
161
+ # dcmitype:MovingImageShape a sh:NodeShape ;
162
+ # sh:targetClass shared:MovingImage ;
163
+ # dcterms:created "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
164
+ # dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
165
+ # dcterms:modified "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
166
+ # dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
167
+ # oldap:externalOntology "true"^^xsd:boolean ;
168
+ # rdfs:label "MovingImage"@en, "Bewegtbild"@de, "Image animée"@fr, "Immagine in movimento"@it ;
169
+ # sh:property [
170
+ # sh:path rdf:type ;
171
+ # ] .
172
+ #
173
+ # dcmitype:SoundShape a sh:NodeShape ;
174
+ # sh:targetClass shared:Sound ;
175
+ # dcterms:created "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
176
+ # dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
177
+ # dcterms:modified "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
178
+ # dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
179
+ # oldap:externalOntology "true"^^xsd:boolean ;
180
+ # rdfs:label "Sound"@en, "Ton"@de, "Son"@fr, "Sound"@it ;
181
+ # sh:property [
182
+ # sh:path rdf:type ;
183
+ # ] .
184
+ #
185
+ # dcmitype:TextShape a sh:NodeShape ;
186
+ # sh:targetClass shared:Text ;
187
+ # dcterms:created "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
188
+ # dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
189
+ # dcterms:modified "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
190
+ # dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
191
+ # oldap:externalOntology "true"^^xsd:boolean ;
192
+ # rdfs:label "Text"@en, "Text"@de, "Texte"@fr, "Testo"@it ;
193
+ # sh:property [
194
+ # sh:path rdf:type ;
195
+ # ] .
196
+
112
197
  shared:MediaObjectShape a sh:NodeShape ;
113
198
  sh:targetClass shared:MediaObject ;
114
199
  dcterms:created "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
@@ -117,12 +202,33 @@ shared:shacl {
117
202
  dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
118
203
  oldap:externalOntology "false"^^xsd:boolean ;
119
204
  rdfs:label "MediaObject"@en, "Medienobjekt"@de, "MediaObject"@fr, "MediaObject"@it ;
120
- rdfs:comment "Page of a book"@en, "Seite eines Buches"@de ;
121
205
  sh:closed "true"^^xsd:boolean ;
122
206
  sh:node oldap:ThingShape ;
123
207
  sh:property [
124
208
  sh:path rdf:type ;
125
209
  ] ;
210
+ sh:property [
211
+ sh:path dcterms:type ;
212
+ dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
213
+ dcterms:created "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
214
+ dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
215
+ dcterms:modified "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
216
+ oldap:statementProperty "false"^^xsd:boolean ;
217
+ oldap:externalOntology "false"^^xsd:boolean ;
218
+ sh:nodeKind sh:IRI ;
219
+ sh:in (
220
+ dcmitype:Collection
221
+ dcmitype:Dataset
222
+ dcmitype:StillImage
223
+ dcmitype:Image
224
+ dcmitype:MovingImage
225
+ dcmitype:Sound
226
+ dcmitype:Text
227
+ ) ;
228
+ sh:minCount 1 ;
229
+ sh:maxCount 1 ;
230
+ sh:order "0.5"^^xsd:decimal ;
231
+ ] ;
126
232
  sh:property [
127
233
  sh:path shared:originalName ;
128
234
  schema:version "0.1.0"^^xsd:string ;
@@ -344,6 +450,15 @@ shared:onto {
344
450
  # Media object
345
451
  ###########################################################################
346
452
 
453
+ # shared:mediaType rdf:type owl:ObjectProperty ;
454
+ # dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
455
+ # dcterms:created "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime ;
456
+ # dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
457
+ # dcterms:modified "2025-11-21T00:15:09.037880+01:00"^^xsd:dateTime .
458
+ # #owl:subPropertyOf dcterms:type ;
459
+ # rdfs:domain shared:MediaObject ;
460
+ # rdfs:range rdfs:Class ;
461
+
347
462
  shared:originalName rdf:type owl:DatatypeProperty ;
348
463
  rdfs:domain shared:MediaObject ;
349
464
  rdfs:range xsd:string ;
@@ -401,6 +516,12 @@ shared:onto {
401
516
  rdfs:label "MediaObject"@en, "Medienobjekt"@de, "MediaObject"@fr, "MediaObject"@it ;
402
517
  rdfs:comment "Page of a book"@en, "Seite eines Buches"@de ;
403
518
  rdfs:subClassOf oldap:Thing ,
519
+ [
520
+ rdf:type owl:Restriction ;
521
+ owl:onProperty dcterms:type ;
522
+ owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger ;
523
+ owl:onClass rdfs:Class ;
524
+ ] ,
404
525
  [
405
526
  rdf:type owl:Restriction ;
406
527
  owl:onProperty shared:originalName ;
@@ -1,6 +1,6 @@
1
1
  import json
2
2
  import os
3
- from time import sleep
3
+ import time
4
4
 
5
5
  import bcrypt
6
6
  import jwt
@@ -338,80 +338,52 @@ class Connection(IConnection):
338
338
  if not req.ok:
339
339
  raise OldapError(req.text)
340
340
 
341
+
342
+
341
343
  def upload_turtle(self, filename: str, graphname: Optional[str] = None) -> None:
342
344
  """
343
- Uploads a turtle or trig file to the specified repository. This function sends the file to the triplestore for
344
- import and does not wait for the completion of the import process. The process itself may continue for some time
345
- after the command is issued.
346
-
347
- :param filename: Name of the file to be uploaded.
348
- :type filename: str
349
- :param graphname: Optional; the name of the RDF-graph into which the data is to be imported.
350
- :type graphname: str or None
351
- :return: None
352
- :rtype: None
353
- :raises OldapError: Raised when there are issues with the repository or during the HTTP request.
354
- """
355
- # if not self._userdata:
356
- # raise OldapErrorNoPermission("No permission")
357
- # actor = self._userdata
358
- # sysperms = actor.inProject.get(QName('oldap:SystemProject'))
359
- # is_root: bool = False
360
- # if sysperms and AdminPermission.ADMIN_OLDAP in sysperms:
361
- # is_root = True
362
- # if not is_root:
363
- # raise OldapErrorNoPermission("No permission")
345
+ Upload a TTL/TRiG file to GraphDB using the RDF4J /statements endpoint.
364
346
 
347
+ This call is synchronous: when it returns without error, the data is loaded.
348
+ """
365
349
  logger = get_logger()
366
- with open(filename, encoding="utf-8") as f:
367
- content = f.read()
368
- ext = Path(filename).suffix
369
- mime = ""
370
- if ext == ".ttl":
371
- mime = "text/turtle"
372
- elif ext == ".trig":
373
- mime = "application/x-trig"
374
-
375
- ct = datetime.now().astimezone()
376
- ts = ct.timestamp()
377
- data = {
378
- "name": f'Data from "{filename}"',
379
- "status": None,
380
- "message": "",
381
- "context": graphname,
382
- "replaceGraphs": [],
383
- "baseURI": None,
384
- "forceSerial": False,
385
- "type": "text",
386
- "format": mime,
387
- "data": content,
388
- "timestamp": ts,
389
- "parserSettings": {
390
- "preserveBNodeIds": False,
391
- "failOnUnknownDataTypes": False,
392
- "verifyDataTypeValues": False,
393
- "normalizeDataTypeValues": False,
394
- "failOnUnknownLanguageTags": False,
395
- "verifyLanguageTags": True,
396
- "normalizeLanguageTags": True,
397
- "stopOnError": True
398
- }
399
- }
400
- jsondata = json.dumps(data)
401
- headers = {
402
- "Accept": "application/json, text/plain, */*",
403
- "Content-Type": "application/json; charset=utf-8"
404
- }
405
- url = f"{self._server}/rest/repositories/{self._repo}/import/upload/text"
406
- auth = HTTPBasicAuth(self._dbuser, self._dbpassword) if self._dbuser and self._dbpassword else None
407
- req = requests.post(url,
408
- headers=headers,
409
- data=jsondata,
410
- auth=auth)
411
- if not req.ok:
412
- logger.error(f'Upload of file "{filename}" failed: {req.text}')
413
- raise OldapError(req.text)
414
- logger.info(f'File "{filename}" uploaded.')
350
+
351
+ ext = Path(filename).suffix.lower()
352
+ if ext == ".ttl":
353
+ mime = "text/turtle"
354
+ elif ext == ".trig":
355
+ # use the standard MIME type for TriG
356
+ mime = "application/trig"
357
+ else:
358
+ raise OldapError(f"Unsupported RDF extension: {ext}")
359
+
360
+ with open(filename, "rb") as f:
361
+ data = f.read()
362
+
363
+ # RDF4J / GraphDB statements endpoint
364
+ url = f"{self._server.rstrip('/')}/repositories/{self._repo}/statements"
365
+
366
+ # Optional context: only use this if you really want to force
367
+ # all triples into a single named graph. For TriG you usually
368
+ # leave this empty so the quads' graph IRIs are respected.
369
+ params = {}
370
+ if graphname:
371
+ # GraphDB expects the context IRI wrapped in < > and URL-encoded
372
+ params["context"] = f"<{graphname}>"
373
+
374
+ auth = HTTPBasicAuth(self._dbuser, self._dbpassword) if self._dbuser and self._dbpassword else None
375
+ headers = {
376
+ "Content-Type": mime,
377
+ "Accept": "text/plain" # or */*, result body is usually empty
378
+ }
379
+
380
+ resp = requests.post(url, params=params, headers=headers, data=data, auth=auth)
381
+
382
+ if not resp.ok:
383
+ logger.error(f'Upload of file "{filename}" failed: {resp.status_code} {resp.text}')
384
+ raise OldapError(resp.text)
385
+
386
+ logger.info(f'File "{filename}" uploaded synchronously via /statements.')
415
387
 
416
388
  def query(self, query: str, format: SparqlResultFormat = SparqlResultFormat.JSON) -> Any:
417
389
  """
@@ -1,7 +1,8 @@
1
+ import io
1
2
  from copy import deepcopy
2
3
  from dataclasses import dataclass
3
4
  from datetime import datetime
4
- from typing import Dict, List, Optional, Union, Any, Self
5
+ from typing import Dict, List, Optional, Union, Any, Self, TextIO
5
6
 
6
7
  from oldaplib.src.cachesingleton import CacheSingleton, CacheSingletonRedis
7
8
  from oldaplib.src.dtypes.namespaceiri import NamespaceIRI
@@ -723,57 +724,58 @@ class DataModel(Model):
723
724
  cache = CacheSingletonRedis()
724
725
  cache.delete(Xsd_QName(self._project.projectShortName, 'shacl'))
725
726
 
726
-
727
- def write_as_trig(self, filename: str, indent: int = 0, indent_inc: int = 4) -> None:
727
+ def __to_trig_format(self, f: TextIO, indent: int = 0, indent_inc: int = 4) -> None:
728
728
  """
729
- Write the complete datamodel in the trig format to a file.
730
-
731
- This method serializes the complete datamodel, including its SHACL
732
- shapes and OWL ontology, and writes the resulting data in the trig
733
- format to the specified file.
734
-
735
- :param filename: The path of the file where the trig data will be
736
- written
737
- :type filename: str
738
- :param indent: Start level of indentation for serialized data. Defaults
739
- to 0
740
- :type indent: int
741
- :param indent_inc: Number of characters to increment for each indent
742
- level. Defaults to 4
743
- :type indent_inc: int
729
+ Generates and writes TriG-formatted RDF data to the given TextIO object. The method constructs
730
+ SHACL and OWL ontology representations based on the internal state and configuration of the
731
+ object. SHACL validation shapes, ontology metadata, and RDF structure are included. This
732
+ method is primarily used for exporting RDF data in a standard, compliant format.
733
+
734
+ :param f: The output stream (e.g., a file or any TextIO object) where the generated TriG
735
+ data will be written.
736
+ :param indent: The base indentation level applied when formatting the output.
737
+ :param indent_inc: The number of spaces added for each level of indentation to format
738
+ nested structures cleanly.
744
739
  :return: None
745
740
  """
741
+ timestamp = Xsd_dateTime.now()
742
+ blank = ''
743
+ context = Context(name=self._con.context_name)
744
+ f.write('\n')
745
+ f.write(context.turtle_context)
746
+ f.write(f'\n{blank:{indent * indent_inc}}{self.__graph}:shacl {{\n')
747
+ f.write(f'{blank:{(indent + 1) * indent_inc}}{self.__graph}:shapes schema:version {self.__version.toRdf} .\n')
748
+ f.write('\n')
749
+ for qname, onto in self.__extontos.items():
750
+ f.write(onto.create_shacl(timestamp=timestamp, indent=1))
751
+ f.write('\n\n')
752
+ for iri, prop in self.__propclasses.items():
753
+ if not prop.internal:
754
+ f.write(prop.create_shacl(timestamp=timestamp, indent=1))
755
+ f.write('\n\n')
756
+ for iri, resclass in self.__resclasses.items():
757
+ f.write(resclass.create_shacl(timestamp=timestamp, indent=1))
758
+ f.write('\n\n')
759
+ f.write(f'\n{blank:{indent * indent_inc}}}}\n')
760
+
761
+ f.write(f'{blank:{indent * indent_inc}}{self.__graph}:onto {{\n')
762
+ f.write(f'{blank:{(indent + 2) * indent_inc}}{self.__graph}:ontology owl:type owl:Ontology ;\n')
763
+ f.write(f'{blank:{(indent + 2) * indent_inc}}owl:versionInfo {self.__version.toRdf} .\n')
764
+ f.write('\n')
765
+ for iri, prop in self.__propclasses.items():
766
+ f.write(prop.create_owl_part1(timestamp=timestamp, indent=2))
767
+ for iri, resclass in self.__resclasses.items():
768
+ f.write(resclass.create_owl(timestamp=timestamp))
769
+ f.write(f'{blank:{indent * indent_inc}}}}\n')
770
+
771
+ def write_as_trig(self, filename: str, indent: int = 0, indent_inc: int = 4) -> None:
746
772
  with open(filename, 'w') as f:
747
- timestamp = Xsd_dateTime.now()
748
- blank = ''
749
- context = Context(name=self._con.context_name)
750
- f.write('\n')
751
- f.write(context.turtle_context)
752
- f.write(f'\n{blank:{indent * indent_inc}}{self.__graph}:shacl {{\n')
753
- f.write(f'{blank:{(indent + 1) * indent_inc}}{self.__graph}:shapes schema:version {self.__version.toRdf} .\n')
754
- f.write('\n')
755
- for qname, onto in self.__extontos.items():
756
- f.write(onto.create_shacl(timestamp=timestamp, indent=1))
757
- f.write('\n\n')
758
- for iri, prop in self.__propclasses.items():
759
- if not prop.internal:
760
- f.write(prop.create_shacl(timestamp=timestamp, indent=1))
761
- f.write('\n\n')
762
- for iri, resclass in self.__resclasses.items():
763
- f.write(resclass.create_shacl(timestamp=timestamp, indent=1))
764
- f.write('\n\n')
765
- f.write(f'\n{blank:{indent * indent_inc}}}}\n')
766
-
767
- f.write(f'{blank:{indent * indent_inc}}{self.__graph}:onto {{\n')
768
- f.write(f'{blank:{(indent + 2) * indent_inc}}{self.__graph}:ontology owl:type owl:Ontology ;\n')
769
- f.write(f'{blank:{(indent + 2) * indent_inc}}owl:versionInfo {self.__version.toRdf} .\n')
770
- f.write('\n')
771
- for iri, prop in self.__propclasses.items():
772
- f.write(prop.create_owl_part1(timestamp=timestamp, indent=2))
773
- for iri, resclass in self.__resclasses.items():
774
- f.write(resclass.create_owl(timestamp=timestamp))
775
- f.write(f'{blank:{indent * indent_inc}}}}\n')
773
+ self.__to_trig_format(f, indent=indent, indent_inc=indent_inc)
776
774
 
775
+ def write_as_str(self, indent: int = 0, indent_inc: int = 4) -> str:
776
+ f = io.StringIO()
777
+ self.__to_trig_format(f, indent=indent, indent_inc=indent_inc)
778
+ return f.getvalue()
777
779
 
778
780
 
779
781
 
@@ -48,6 +48,7 @@ class ContextSingleton(type):
48
48
  Xsd_NCName('schema'): NamespaceIRI('http://schema.org/'),
49
49
  #Xsd_NCName('dc'): NamespaceIRI('http://purl.org/dc/elements/1.1/'),
50
50
  Xsd_NCName('dcterms'): NamespaceIRI('http://purl.org/dc/terms/'),
51
+ Xsd_NCName('dcmitype'): NamespaceIRI('http://purl.org/dc/dcmitype/'),
51
52
  #Xsd_NCName('foaf'): NamespaceIRI('http://xmlns.com/foaf/0.1/'),
52
53
  Xsd_NCName('oldap'): NamespaceIRI('http://oldap.org/base#'),
53
54
  Xsd_NCName('shared'): NamespaceIRI('http://oldap.org/shared#')
@@ -63,6 +64,7 @@ class ContextSingleton(type):
63
64
  NamespaceIRI('http://schema.org/'): Xsd_NCName('schema'),
64
65
  #NamespaceIRI('http://purl.org/dc/elements/1.1/'): Xsd_NCName('dc'),
65
66
  NamespaceIRI('http://purl.org/dc/terms/'): Xsd_NCName('dcterms'),
67
+ NamespaceIRI('http://purl.org/dc/dcmitype/'): Xsd_NCName('dcmitype'),
66
68
  #NamespaceIRI('http://xmlns.com/foaf/0.1/'): Xsd_NCName('foaf'),
67
69
  NamespaceIRI('http://oldap.org/base#'): Xsd_NCName('oldap'),
68
70
  NamespaceIRI('http://oldap.org/shared#'): Xsd_NCName('shared'),
@@ -237,7 +239,7 @@ class Context(metaclass=ContextSingleton):
237
239
  return Xsd_QName(prefix, fragment, validate=validate)
238
240
  return None
239
241
 
240
- def qname2iri(self, qname: Xsd_QName | str, validate: bool = True) -> NamespaceIRI:
242
+ def qname2iri(self, qname: Xsd_QName | str, validate: bool = True) -> Xsd_anyURI:
241
243
  """
242
244
  Convert a QName into a IRI string.
243
245
 
@@ -231,8 +231,25 @@ class ResourceInstance:
231
231
  return # TODO: LangString does not yet allow multiple entries of the same language...
232
232
  if property.get(PropClassAttr.IN):
233
233
  #for val in values:
234
- if not values in property[PropClassAttr.IN]:
235
- raise OldapErrorValue(f'Property {property} with IN={property[PropClassAttr.IN]} has invalid value "{val}"')
234
+ if property.datatype is None: # no defined datatype, e.h.sh:IRI
235
+ tmpinset = {str(x) for x in property[PropClassAttr.IN]}
236
+ if isinstance(values, (list, tuple, set, ObservableSet)):
237
+ for val in values:
238
+ if not str(val) in tmpinset:
239
+ raise OldapErrorValue(
240
+ f'Property {property} with IN={property[PropClassAttr.IN]} has invalid value "{val}"')
241
+ else:
242
+ if not str(values) in tmpinset:
243
+ raise OldapErrorValue(f'Property {property.property_class_iri} with IN={property[PropClassAttr.IN]} has invalid value "{values}"')
244
+ else:
245
+ if isinstance(values, (list, tuple, set, ObservableSet)):
246
+ for val in values:
247
+ if not val in property[PropClassAttr.IN]:
248
+ raise OldapErrorValue(
249
+ f'Property {property} with IN={property[PropClassAttr.IN]} has invalid value "{val}"')
250
+ else:
251
+ if not values in property[PropClassAttr.IN]:
252
+ raise OldapErrorValue(f'Property {property.property_class_iri} with IN={property[PropClassAttr.IN]} has invalid value "{values}"')
236
253
  if property.get(PropClassAttr.MIN_LENGTH):
237
254
  for val in values:
238
255
  l = 0
@@ -725,6 +725,7 @@ class OldapList(Model):
725
725
  self.clear_changeset()
726
726
 
727
727
  cache = CacheSingletonRedis()
728
+ cache.delete(Xsd_QName(self.project.projectShortName, 'shacl'))
728
729
  cache.set(self.__iri, self)
729
730
 
730
731
  def update(self, indent: int = 0, indent_inc: int = 4) -> None:
@@ -798,6 +799,7 @@ class OldapList(Model):
798
799
  #
799
800
  cache = CacheSingletonRedis()
800
801
  cache.delete(self.__iri)
802
+ cache.delete(Xsd_QName(self.project.projectShortName, 'shacl'))
801
803
 
802
804
 
803
805
  def in_use_queries(self) -> (str, str):
@@ -190,6 +190,21 @@ class PermissionSet(Model):
190
190
  def qname(self) -> Xsd_QName:
191
191
  return self.__permset_iri
192
192
 
193
+ def trig_to_str(self, created: Xsd_dateTime, modified: Xsd_dateTime, indent: int = 0, indent_inc: int = 4):
194
+ blank = ''
195
+ sparql = ''
196
+ sparql += f'{blank:{indent * indent_inc}} {self.__permset_iri.toRdf} a oldap:PermissionSet'
197
+ sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:creator {self._con.userIri.toRdf}'
198
+ sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:created {created.toRdf}'
199
+ sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:contributor {self._con.userIri.toRdf}'
200
+ sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:modified {modified.toRdf}'
201
+ for attr, value in self._attributes.items():
202
+ if attr.value.prefix == 'virtual' or not value:
203
+ continue
204
+ sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}{attr.value.toRdf} {value.toRdf}'
205
+ return sparql
206
+
207
+
193
208
  def create(self, indent: int = 0, indent_inc: int = 4) -> None:
194
209
  """
195
210
  Creates and stores a permission set in the triple store.
@@ -236,15 +251,16 @@ class PermissionSet(Model):
236
251
  sparql += f'{blank:{indent * indent_inc}}INSERT DATA {{\n'
237
252
  sparql += f'{blank:{(indent + 1) * indent_inc}}GRAPH oldap:admin {{\n'
238
253
 
239
- sparql += f'{blank:{(indent + 2) * indent_inc}} {self.__permset_iri.toRdf} a oldap:PermissionSet'
240
- sparql += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:creator {self._con.userIri.toRdf}'
241
- sparql += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:created {timestamp.toRdf}'
242
- sparql += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:contributor {self._con.userIri.toRdf}'
243
- sparql += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:modified {timestamp.toRdf}'
244
- for attr, value in self._attributes.items():
245
- if attr.value.prefix == 'virtual' or not value:
246
- continue
247
- sparql += f' ;\n{blank:{(indent + 3) * indent_inc}}{attr.value.toRdf} {value.toRdf}'
254
+ sparql += self.trig_to_str(created=timestamp, modified=timestamp, indent=indent + 2, indent_inc=indent_inc)
255
+ # sparql += f'{blank:{(indent + 2) * indent_inc}} {self.__permset_iri.toRdf} a oldap:PermissionSet'
256
+ # sparql += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:creator {self._con.userIri.toRdf}'
257
+ # sparql += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:created {timestamp.toRdf}'
258
+ # sparql += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:contributor {self._con.userIri.toRdf}'
259
+ # sparql += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:modified {timestamp.toRdf}'
260
+ # for attr, value in self._attributes.items():
261
+ # if attr.value.prefix == 'virtual' or not value:
262
+ # continue
263
+ # sparql += f' ;\n{blank:{(indent + 3) * indent_inc}}{attr.value.toRdf} {value.toRdf}'
248
264
  sparql += f'\n{blank:{(indent + 1) * indent_inc}}}}\n'
249
265
  sparql += f'{blank:{indent * indent_inc}}}}\n'
250
266
 
@@ -307,6 +323,7 @@ class PermissionSet(Model):
307
323
  :raises OldapErrorInconsistency: Raised if the permission set contains inconsistencies
308
324
  in its data during retrieval.
309
325
  """
326
+ context = Context(name=con.context_name)
310
327
  if qname:
311
328
  permset_iri = Xsd_QName(qname, validate=True)
312
329
  elif permissionSetId and definedByProject:
@@ -325,7 +342,6 @@ class PermissionSet(Model):
325
342
  if tmp is not None:
326
343
  tmp.update_notifier()
327
344
  return tmp
328
- context = Context(name=con.context_name)
329
345
  sparql = context.sparql_context
330
346
  sparql += f"""
331
347
  SELECT ?permset ?p ?o
@@ -426,6 +426,21 @@ class Project(Model):
426
426
  projects.append(ProjectSearchResult(r['project'], r['shortname']))
427
427
  return projects
428
428
 
429
+
430
+ def trig_to_str(self, created: Xsd_dateTime, modified: Xsd_dateTime,indent: int = 0, indent_inc: int = 4):
431
+ blank = ''
432
+ sparql = ''
433
+ sparql += f'\n{blank:{indent * indent_inc}}{self.projectIri.toRdf} a oldap:Project'
434
+ sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:creator {self._con.userIri.toRdf}'
435
+ sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:created {created.toRdf}'
436
+ sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:contributor {self._con.userIri.toRdf}'
437
+ sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:modified {modified.toRdf}'
438
+ for attr, value in self._attributes.items():
439
+ if not value:
440
+ continue
441
+ sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}{attr.value.toRdf} {value.toRdf}'
442
+ return sparql
443
+
429
444
  def create(self, indent: int = 0, indent_inc: int = 4) -> None:
430
445
  """
431
446
  Creates a new project in the triple store. The function starts by
@@ -459,11 +474,14 @@ class Project(Model):
459
474
  raise OldapErrorNoPermission(message)
460
475
 
461
476
  timestamp = Xsd_dateTime.now()
462
- indent: int = 0
463
- indent_inc: int = 4
477
+ #indent: int = 0
478
+ #indent_inc: int = 4
464
479
 
465
480
  context = Context(name=self._con.context_name)
466
481
 
482
+ #
483
+ # SPARQL to check if project with the given projectShortName already exists
484
+ #
467
485
  sparql0 = context.sparql_context
468
486
  sparql0 += f"""
469
487
  ASK {{
@@ -475,15 +493,9 @@ class Project(Model):
475
493
  }}
476
494
  """
477
495
 
478
- sparql1 = context.sparql_context
479
- sparql1 += f"""
480
- SELECT ?project
481
- FROM oldap:admin
482
- WHERE {{
483
- ?project a oldap:Project .
484
- FILTER(?project = {self.projectIri.toRdf})
485
- }}
486
- """
496
+ #
497
+ # SPARQL to check if the given namespaceIri is already used by another project
498
+ #
487
499
  sparql1a = context.sparql_context
488
500
  sparql1a += f"""
489
501
  ASK {{
@@ -493,6 +505,9 @@ class Project(Model):
493
505
  }}
494
506
  """
495
507
 
508
+ #
509
+ # SPARQL to check if project with the given projectIri already exists
510
+ #
496
511
  sparql1b = context.sparql_context
497
512
  sparql1b += f"""
498
513
  ASK {{
@@ -506,15 +521,16 @@ class Project(Model):
506
521
  sparql2 = context.sparql_context
507
522
  sparql2 += f'{blank:{indent * indent_inc}}INSERT DATA {{'
508
523
  sparql2 += f'\n{blank:{(indent + 1) * indent_inc}}GRAPH oldap:admin {{'
509
- sparql2 += f'\n{blank:{(indent + 2) * indent_inc}}{self.projectIri.toRdf} a oldap:Project'
510
- sparql2 += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:creator {self._con.userIri.toRdf}'
511
- sparql2 += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:created {timestamp.toRdf}'
512
- sparql2 += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:contributor {self._con.userIri.toRdf}'
513
- sparql2 += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:modified {timestamp.toRdf}'
514
- for attr, value in self._attributes.items():
515
- if not value:
516
- continue
517
- sparql2 += f' ;\n{blank:{(indent + 3) * indent_inc}}{attr.value.toRdf} {value.toRdf}'
524
+ sparql2 += self.trig_to_str(created=timestamp, modified=timestamp, indent=indent + 2, indent_inc=indent_inc)
525
+ # sparql2 += f'\n{blank:{(indent + 2) * indent_inc}}{self.projectIri.toRdf} a oldap:Project'
526
+ # sparql2 += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:creator {self._con.userIri.toRdf}'
527
+ # sparql2 += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:created {timestamp.toRdf}'
528
+ # sparql2 += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:contributor {self._con.userIri.toRdf}'
529
+ # sparql2 += f' ;\n{blank:{(indent + 3) * indent_inc}}dcterms:modified {timestamp.toRdf}'
530
+ # for attr, value in self._attributes.items():
531
+ # if not value:
532
+ # continue
533
+ # sparql2 += f' ;\n{blank:{(indent + 3) * indent_inc}}{attr.value.toRdf} {value.toRdf}'
518
534
  sparql2 += f' .\n{blank:{(indent + 1) * indent_inc}}}}\n'
519
535
  sparql2 += f'{blank:{indent * indent_inc}}}}\n'
520
536