oldaplib 0.2.9__tar.gz → 0.2.10__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.
- {oldaplib-0.2.9 → oldaplib-0.2.10}/PKG-INFO +1 -1
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/ontologies/oldap.trig +54 -13
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/ontologies/shared.trig +10 -10
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/datamodel.py +3 -3
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/owlpropertytype.py +2 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/propertyclassattr.py +1 -1
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/propertyclass.py +39 -9
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/resourceclass.py +3 -3
- oldaplib-0.2.10/oldaplib/src/version.py +1 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_connection.py +1 -1
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_datamodel.py +10 -2
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_propertyclass.py +34 -2
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/connection_test.trig +17 -17
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/datamodel_test.trig +1 -1
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/objectfactory_test.trig +18 -18
- {oldaplib-0.2.9 → oldaplib-0.2.10}/pyproject.toml +1 -1
- oldaplib-0.2.9/oldaplib/src/version.py +0 -1
- {oldaplib-0.2.9 → oldaplib-0.2.10}/README.md +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/__init__.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/apps/load_list.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/ontologies/admin-testing.trig +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/ontologies/admin.trig +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/ontologies/oldap.ttl +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/__init__.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/cachesingleton.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/connection.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/dtypes/__init__.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/dtypes/bnode.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/dtypes/languagein.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/dtypes/namespaceiri.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/dtypes/rdfset.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/dtypes/xsdset.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/__init__.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/action.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/adminpermissions.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/attributeclass.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/datapermissions.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/haspropertyattr.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/language.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/oldaplistattr.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/oldaplistnodeattr.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/permissionsetattr.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/projectattr.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/resourceclassattr.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/sparql_result_format.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/userattr.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/enums/xsd_datatypes.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/globalconfig.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/hasproperty.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/Notify.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/__init__.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/attributechange.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/context.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/convert2datatype.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/irincname.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/json_encoder.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/langstring.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/numeric.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/observable_dict.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/observable_set.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/oldaperror.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/query_processor.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/semantic_version.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/serializeableset.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/serializer.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/singletonmeta.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/helpers/tools.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/iconnection.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/in_project.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/model.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/objectfactory.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/oldaplist.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/oldaplist_helpers.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/oldaplistnode.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/oldaplogging.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/permissionset.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/project.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/user.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/userdataclass.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/__init__.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/floatingpoint.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/iri.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_anyuri.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_base64binary.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_boolean.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_byte.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_date.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_datetime.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_datetimestamp.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_decimal.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_double.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_duration.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_float.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_gday.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_gmonth.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_gmonthday.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_gyear.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_gyearmonth.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_hexbinary.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_id.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_idref.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_int.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_integer.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_language.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_long.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_name.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_ncname.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_negativeinteger.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_nmtoken.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_nonnegativeinteger.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_nonpositiveinteger.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_normalizedstring.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_positiveinteger.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_qname.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_short.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_string.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_time.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_token.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_unsignedbyte.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_unsignedint.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_unsignedlong.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/src/xsd/xsd_unsignedshort.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/__init__.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_cache.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_context.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_dtypes.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_hasproperty.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_in_project.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_langstring.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_language_in.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_objectfactory.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_observable_dict.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_observable_set.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_oldaplist.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_oldaplist_helpers.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_oldaplistnode.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_permissionset.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_project.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_resourceclass.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_semantic_version.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_user.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/test/test_xsd_datatypes.py +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/Gender.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/collections_type.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/event_type.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/hlist_schema.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/institution_or_building_type.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/language.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/location_type.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/means_of_transportation.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/playground_list.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/role.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/source_type-1.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/source_type.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/test_move_left_of_toL.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testdata/testlist.yaml +0 -0
- {oldaplib-0.2.9 → oldaplib-0.2.10}/oldaplib/testit.http +0 -0
|
@@ -14,7 +14,21 @@
|
|
|
14
14
|
|
|
15
15
|
:shacl {
|
|
16
16
|
|
|
17
|
-
:shapes
|
|
17
|
+
:shapes schema:version "0.1.0"^^xsd:string .
|
|
18
|
+
|
|
19
|
+
#
|
|
20
|
+
# Here we add some SHACL definition in order to indicate that a property is a "statement property"
|
|
21
|
+
# for RDF*star statements about statements.
|
|
22
|
+
#
|
|
23
|
+
:statementProperty a sh:Property ;
|
|
24
|
+
sh:annotationProperty :statementProperty .
|
|
25
|
+
|
|
26
|
+
:statementPropertyShape
|
|
27
|
+
a sh:PropertyShape ;
|
|
28
|
+
sh:path :statementProperty ;
|
|
29
|
+
sh:datatype xsd:boolean ;
|
|
30
|
+
sh:minCount 0 ;
|
|
31
|
+
sh:maxCount 1 .
|
|
18
32
|
|
|
19
33
|
#
|
|
20
34
|
# Define a SHACL property group for all system properties. This info can be used to hide these properties from
|
|
@@ -32,7 +46,7 @@
|
|
|
32
46
|
#
|
|
33
47
|
:AdminPermissionShape a sh:NodeShape, :AdminPermission ;
|
|
34
48
|
sh:targetClass :AdminPermission ;
|
|
35
|
-
|
|
49
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
36
50
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
37
51
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
38
52
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -46,9 +60,13 @@
|
|
|
46
60
|
sh:property rdfs:labelShape ;
|
|
47
61
|
sh:property rdfs:commentShape .
|
|
48
62
|
|
|
63
|
+
:hasAdminPermissionShape a sh:PropertyShape ;
|
|
64
|
+
sh:path :hasAdminPermission ;
|
|
65
|
+
sh:class :AdminPermission .
|
|
66
|
+
|
|
49
67
|
:DataPermissionShape a sh:NodeShape, :DataPermission ;
|
|
50
68
|
sh:targetClass :DataPermission ;
|
|
51
|
-
|
|
69
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
52
70
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
53
71
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
54
72
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -80,7 +98,7 @@
|
|
|
80
98
|
#
|
|
81
99
|
:PermissionSetShape a sh:NodeShape, :PermissionSet ;
|
|
82
100
|
sh:targetClass :PermissionSet ;
|
|
83
|
-
|
|
101
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
84
102
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
85
103
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
86
104
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -114,7 +132,7 @@
|
|
|
114
132
|
sh:property
|
|
115
133
|
[
|
|
116
134
|
sh:path :givesPermission ;
|
|
117
|
-
|
|
135
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
118
136
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
119
137
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
120
138
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -135,7 +153,7 @@
|
|
|
135
153
|
sh:property
|
|
136
154
|
[
|
|
137
155
|
sh:path :definedByProject ;
|
|
138
|
-
|
|
156
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
139
157
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
140
158
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
141
159
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -158,7 +176,7 @@
|
|
|
158
176
|
#
|
|
159
177
|
:ProjectShape a sh:NodeShape, :Project ;
|
|
160
178
|
sh:targetClass :Project ;
|
|
161
|
-
|
|
179
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
162
180
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
163
181
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
164
182
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -195,7 +213,7 @@
|
|
|
195
213
|
sh:property
|
|
196
214
|
[
|
|
197
215
|
sh:path :projectShortName ;
|
|
198
|
-
|
|
216
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
199
217
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
200
218
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
201
219
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -210,7 +228,7 @@
|
|
|
210
228
|
sh:property
|
|
211
229
|
[
|
|
212
230
|
sh:path :namespaceIri ;
|
|
213
|
-
|
|
231
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
214
232
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
215
233
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
216
234
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -225,7 +243,7 @@
|
|
|
225
243
|
sh:property
|
|
226
244
|
[
|
|
227
245
|
sh:path :projectStart ;
|
|
228
|
-
|
|
246
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
229
247
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
230
248
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
231
249
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -240,7 +258,7 @@
|
|
|
240
258
|
sh:property
|
|
241
259
|
[
|
|
242
260
|
sh:path :projectEnd ;
|
|
243
|
-
|
|
261
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
244
262
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
245
263
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
246
264
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -258,7 +276,7 @@
|
|
|
258
276
|
#
|
|
259
277
|
:UserShape a sh:NodeShape, :User ;
|
|
260
278
|
sh:targetClass :User ;
|
|
261
|
-
|
|
279
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
262
280
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
263
281
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
264
282
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -336,6 +354,7 @@
|
|
|
336
354
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
337
355
|
dcterms:modified "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
338
356
|
sh:class :Project ;
|
|
357
|
+
:statementShape :inProjectStatementShape ;
|
|
339
358
|
] ;
|
|
340
359
|
sh:property
|
|
341
360
|
[
|
|
@@ -359,6 +378,13 @@
|
|
|
359
378
|
] ;
|
|
360
379
|
sh:closed true .
|
|
361
380
|
|
|
381
|
+
:inProjectStatementShape a sh:NodeShape ;
|
|
382
|
+
sh:property
|
|
383
|
+
[
|
|
384
|
+
sh:path :hasAdminPermission ;
|
|
385
|
+
sh:class :AdminPermission ;
|
|
386
|
+
] .
|
|
387
|
+
|
|
362
388
|
#
|
|
363
389
|
# Hierarchical lists are implemented using :List's and :ListNodes. We will use some skos vocabulary
|
|
364
390
|
#
|
|
@@ -695,11 +721,26 @@
|
|
|
695
721
|
owl:versionInfo "0.1.0"^^xsd:string ;
|
|
696
722
|
owl:imports <http://www.w3.org/2004/02/skos/core>, <http://purl.org/dc/terms/> .
|
|
697
723
|
|
|
724
|
+
###############################################################################
|
|
725
|
+
# Extension (non-standard) for RDF*star
|
|
726
|
+
###############################################################################
|
|
727
|
+
:statementShape a owl:ObjectProperty ;
|
|
728
|
+
rdfs:label "statement shape for RDF-star annotation"@en ;
|
|
729
|
+
rdfs:comment "Links a sh:PropertyShape to a sh:NodeShape that constrains annotations on <<S P O>>."@en ;
|
|
730
|
+
rdfs:domain sh:PropertyShape ;
|
|
731
|
+
rdfs:range sh:NodeShape .
|
|
732
|
+
|
|
733
|
+
:statementProperty a owl:DatatypeProperty ;
|
|
734
|
+
rdfs:domain sh:PropertyShape ;
|
|
735
|
+
rdfs:range xsd:boolean ;
|
|
736
|
+
rdfs:label "Statement property flag"@en ;
|
|
737
|
+
rdfs:comment "Indicates whether the SHACL property is used as a statement-level (RDF-star) annotation property."@en .
|
|
698
738
|
|
|
699
739
|
###############################################################################
|
|
700
740
|
# Standard Properties that are used everywhere
|
|
701
741
|
###############################################################################
|
|
702
|
-
|
|
742
|
+
:hasAdminPermission a owl:ObjectProperty ;
|
|
743
|
+
rdfs:range :AdminPermission .
|
|
703
744
|
|
|
704
745
|
###############################################################################
|
|
705
746
|
# Properties that are used by skos,
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
@prefix : <http://oldap.org/shared#> .
|
|
16
16
|
|
|
17
17
|
shared:shacl {
|
|
18
|
-
shared:shapes
|
|
18
|
+
shared:shapes schema:version "0.1.0"^^xsd:string .
|
|
19
19
|
|
|
20
20
|
#
|
|
21
21
|
# Define the SHACL for OLAPDLIB's use of rdfs:label
|
|
22
22
|
#
|
|
23
23
|
rdfs:labelShape a sh:PropertyShape ;
|
|
24
24
|
sh:path rdfs:label ;
|
|
25
|
-
|
|
25
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
26
26
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
27
27
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
28
28
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -38,7 +38,7 @@ shared:shacl {
|
|
|
38
38
|
#
|
|
39
39
|
rdfs:commentShape a sh:PropertyShape ;
|
|
40
40
|
sh:path rdfs:comment ;
|
|
41
|
-
|
|
41
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
42
42
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
43
43
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
44
44
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -55,7 +55,7 @@ shared:shacl {
|
|
|
55
55
|
|
|
56
56
|
dcterms:descriptionShape a sh:PropertyShape ;
|
|
57
57
|
sh:path dcterms:description ;
|
|
58
|
-
|
|
58
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
59
59
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
60
60
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
61
61
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -69,7 +69,7 @@ shared:shacl {
|
|
|
69
69
|
|
|
70
70
|
dcterms:rightsShape a sh:PropertyShape ;
|
|
71
71
|
sh:path dcterms:rights ;
|
|
72
|
-
|
|
72
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
73
73
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
74
74
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
75
75
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -83,7 +83,7 @@ shared:shacl {
|
|
|
83
83
|
|
|
84
84
|
dcterms:abstractShape a sh:PropertyShape ;
|
|
85
85
|
sh:path dcterms:abstract ;
|
|
86
|
-
|
|
86
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
87
87
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
88
88
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
89
89
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -99,7 +99,7 @@ shared:shacl {
|
|
|
99
99
|
|
|
100
100
|
dcterms:accessRightsShape a sh:PropertyShape ;
|
|
101
101
|
sh:path dcterms:accessRights ;
|
|
102
|
-
|
|
102
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
103
103
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
104
104
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
105
105
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -119,7 +119,7 @@ shared:shacl {
|
|
|
119
119
|
#
|
|
120
120
|
dcterms:creatorShape a sh:PropertyShape ;
|
|
121
121
|
sh:path dcterms:creator ;
|
|
122
|
-
|
|
122
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
123
123
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
124
124
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
125
125
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -131,7 +131,7 @@ shared:shacl {
|
|
|
131
131
|
#
|
|
132
132
|
dcterms:createdShape a sh:PropertyShape ;
|
|
133
133
|
sh:path dcterms:created ;
|
|
134
|
-
|
|
134
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
135
135
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
136
136
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
137
137
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -143,7 +143,7 @@ shared:shacl {
|
|
|
143
143
|
#
|
|
144
144
|
dcterms:contributorShape a sh:PropertyShape ;
|
|
145
145
|
sh:path dcterms:contributor ;
|
|
146
|
-
|
|
146
|
+
schema:version "1.0.0"^^xsd:string ;
|
|
147
147
|
dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
|
|
148
148
|
dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
|
|
149
149
|
dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
|
|
@@ -372,7 +372,7 @@ class DataModel(Model):
|
|
|
372
372
|
SELECT ?version
|
|
373
373
|
FROM {cls.__graph}:shacl
|
|
374
374
|
WHERE {{
|
|
375
|
-
{cls.__graph}:shapes
|
|
375
|
+
{cls.__graph}:shapes schema:version ?version .
|
|
376
376
|
}}
|
|
377
377
|
"""
|
|
378
378
|
jsonobj = con.query(query)
|
|
@@ -490,7 +490,7 @@ class DataModel(Model):
|
|
|
490
490
|
|
|
491
491
|
sparql += f'{blank:{indent * indent_inc}}INSERT DATA {{\n'
|
|
492
492
|
sparql += f'{blank:{(indent + 1) * indent_inc}}GRAPH {self.__graph}:shacl {{\n'
|
|
493
|
-
sparql += f'{blank:{(indent + 2) * indent_inc}}{self.__graph}:shapes
|
|
493
|
+
sparql += f'{blank:{(indent + 2) * indent_inc}}{self.__graph}:shapes schema:version {self.__version.toRdf} .\n'
|
|
494
494
|
sparql += '\n'
|
|
495
495
|
|
|
496
496
|
for propiri, propclass in self.__propclasses.items():
|
|
@@ -644,7 +644,7 @@ class DataModel(Model):
|
|
|
644
644
|
f.write('\n')
|
|
645
645
|
f.write(context.turtle_context)
|
|
646
646
|
f.write(f'\n{blank:{indent * indent_inc}}{self.__graph}:shacl {{\n')
|
|
647
|
-
f.write(f'{blank:{(indent + 2) * indent_inc}}{self.__graph}:shapes
|
|
647
|
+
f.write(f'{blank:{(indent + 2) * indent_inc}}{self.__graph}:shapes schema:version {self.__version.toRdf} .\n')
|
|
648
648
|
f.write('\n')
|
|
649
649
|
for iri, prop in self.__propclasses.items():
|
|
650
650
|
if not prop.internal:
|
|
@@ -8,9 +8,11 @@ from oldaplib.src.helpers.serializer import serializer
|
|
|
8
8
|
class OwlPropertyType(Enum):
|
|
9
9
|
"""
|
|
10
10
|
Enumeration of the two types of RDF properties that OWL distinguishes
|
|
11
|
+
NOTE:
|
|
11
12
|
"""
|
|
12
13
|
OwlDataProperty = 'owl:DatatypeProperty'
|
|
13
14
|
OwlObjectProperty = 'owl:ObjectProperty'
|
|
15
|
+
StatementProperty = 'rdf:Property'
|
|
14
16
|
|
|
15
17
|
@property
|
|
16
18
|
def toRdf(self):
|
|
@@ -36,7 +36,7 @@ class PropClassAttr(AttributeClass):
|
|
|
36
36
|
"""
|
|
37
37
|
# order: (QName, mandatory, immutable, datatype)
|
|
38
38
|
SUBPROPERTY_OF = ('rdfs:subPropertyOf', False, False, Iri)
|
|
39
|
-
TYPE = ('rdf:type', False,
|
|
39
|
+
TYPE = ('rdf:type', False, True, OwlPropertyType)
|
|
40
40
|
CLASS = ('sh:class', False, False, Iri)
|
|
41
41
|
DATATYPE = ('sh:datatype', False, False, XsdDatatypes)
|
|
42
42
|
NAME = ('sh:name', False, False, LangString) # needs notifier
|
|
@@ -165,6 +165,7 @@ class PropertyClass(Model, Notify):
|
|
|
165
165
|
_projectShortName: Xsd_NCName
|
|
166
166
|
_projectIri: Iri
|
|
167
167
|
_property_class_iri: Iri | None
|
|
168
|
+
_statementProperty: bool
|
|
168
169
|
_internal: Iri | None
|
|
169
170
|
_force_external: bool
|
|
170
171
|
#_attributes: PropClassAttrContainer
|
|
@@ -194,6 +195,7 @@ class PropertyClass(Model, Notify):
|
|
|
194
195
|
property_class_iri: Iri | str | None = None,
|
|
195
196
|
notifier: Callable[[PropClassAttr], None] | None = None,
|
|
196
197
|
notify_data: PropClassAttr | None = None,
|
|
198
|
+
statement_property: bool = False,
|
|
197
199
|
_internal: Iri | None = None, # DO NOT USE!! Only for serialization!
|
|
198
200
|
_force_external: bool | None = None, # DO NOT USE!! Only for serialization!
|
|
199
201
|
_from_triplestore: bool = False,
|
|
@@ -234,6 +236,7 @@ class PropertyClass(Model, Notify):
|
|
|
234
236
|
validate=validate)
|
|
235
237
|
Notify.__init__(self, notifier, notify_data)
|
|
236
238
|
|
|
239
|
+
self._statementProperty = statement_property
|
|
237
240
|
if not isinstance(project, Project):
|
|
238
241
|
if not isinstance(project, (Iri, Xsd_NCName)):
|
|
239
242
|
project = IriOrNCName(project, validate=validate)
|
|
@@ -290,12 +293,15 @@ class PropertyClass(Model, Notify):
|
|
|
290
293
|
raise OldapErrorInconsistency(f'It\'s not possible to use both DATATYPE="{self._attributes[PropClassAttr.DATATYPE]}" and CLASS={self._attributes[PropClassAttr.CLASS]} restrictions.')
|
|
291
294
|
|
|
292
295
|
# setting property type for OWL which distinguished between Data- and Object-properties
|
|
293
|
-
if self.
|
|
294
|
-
self._attributes[PropClassAttr.TYPE] = OwlPropertyType.
|
|
295
|
-
if self._attributes.get(PropClassAttr.DATATYPE) is not None:
|
|
296
|
-
raise OldapError(f'Datatype "{self._attributes.get(PropClassAttr.DATATYPE)}" not possible for OwlObjectProperty')
|
|
296
|
+
if self._statementProperty:
|
|
297
|
+
self._attributes[PropClassAttr.TYPE] = OwlPropertyType.StatementProperty
|
|
297
298
|
else:
|
|
298
|
-
self._attributes
|
|
299
|
+
if self._attributes.get(PropClassAttr.CLASS) is not None:
|
|
300
|
+
self._attributes[PropClassAttr.TYPE] = OwlPropertyType.OwlObjectProperty
|
|
301
|
+
if self._attributes.get(PropClassAttr.DATATYPE) is not None:
|
|
302
|
+
raise OldapError(f'Datatype "{self._attributes.get(PropClassAttr.DATATYPE)}" not possible for OwlObjectProperty')
|
|
303
|
+
else:
|
|
304
|
+
self._attributes[PropClassAttr.TYPE] = OwlPropertyType.OwlDataProperty
|
|
299
305
|
|
|
300
306
|
#
|
|
301
307
|
# set the class properties
|
|
@@ -468,6 +474,7 @@ class PropertyClass(Model, Notify):
|
|
|
468
474
|
notifier=self._notifier,
|
|
469
475
|
data=deepcopy(self._notify_data, memo))
|
|
470
476
|
# Copy internals of Model:
|
|
477
|
+
instance._statementProperty = deepcopy(self._statementProperty, memo)
|
|
471
478
|
instance._attributes = deepcopy(self._attributes, memo)
|
|
472
479
|
instance._changset = deepcopy(self._changeset, memo)
|
|
473
480
|
# Copy remaining PropertyClass attributes
|
|
@@ -528,6 +535,15 @@ class PropertyClass(Model, Notify):
|
|
|
528
535
|
"""
|
|
529
536
|
return self._internal
|
|
530
537
|
|
|
538
|
+
@property
|
|
539
|
+
def statementProperty(self) -> bool:
|
|
540
|
+
"""
|
|
541
|
+
Return the statementProperty
|
|
542
|
+
:return: statementProperty
|
|
543
|
+
:rtype: bool
|
|
544
|
+
"""
|
|
545
|
+
return self._statementProperty
|
|
546
|
+
|
|
531
547
|
def force_external(self) -> None:
|
|
532
548
|
"""
|
|
533
549
|
Ensures that the property is created as a standalone property not tied to any resource.
|
|
@@ -712,11 +728,11 @@ class PropertyClass(Model, Notify):
|
|
|
712
728
|
self._property_class_iri = val
|
|
713
729
|
else:
|
|
714
730
|
raise OldapError(f'Inconsistency in SHACL "sh:path" of "{self._property_class_iri}" ->"{val}"')
|
|
715
|
-
elif key == '
|
|
731
|
+
elif key == 'schema:version':
|
|
716
732
|
if isinstance(val, Xsd_string):
|
|
717
733
|
self.__version = SemanticVersion.fromString(str(val))
|
|
718
734
|
else:
|
|
719
|
-
raise OldapError(f'Inconsistency in SHACL "
|
|
735
|
+
raise OldapError(f'Inconsistency in SHACL "schema:version"')
|
|
720
736
|
elif key == 'dcterms:creator':
|
|
721
737
|
if isinstance(val, Iri):
|
|
722
738
|
self._creator = val
|
|
@@ -737,6 +753,11 @@ class PropertyClass(Model, Notify):
|
|
|
737
753
|
self._modified = val
|
|
738
754
|
else:
|
|
739
755
|
raise OldapError(f'Inconsistency in SHACL "dcterms:modified"')
|
|
756
|
+
elif key == 'oldap:statementProperty':
|
|
757
|
+
if isinstance(val, Xsd_boolean):
|
|
758
|
+
self._statementProperty = val
|
|
759
|
+
else:
|
|
760
|
+
raise OldapError(f'Inconsistency in SHACL "oldap:statementProperty (type={type(val)}"')
|
|
740
761
|
elif key == 'sh:node':
|
|
741
762
|
if str(val).endswith("Shape"):
|
|
742
763
|
refprop = Iri(str(val)[:-5], validate=False)
|
|
@@ -806,6 +827,8 @@ class PropertyClass(Model, Notify):
|
|
|
806
827
|
self._attributes[PropClassAttr.TYPE] = OwlPropertyType.OwlDataProperty
|
|
807
828
|
elif obj == 'owl:ObjectProperty':
|
|
808
829
|
self._attributes[PropClassAttr.TYPE] = OwlPropertyType.OwlObjectProperty
|
|
830
|
+
elif obj == 'rdf:Property':
|
|
831
|
+
self._attributes[PropClassAttr.TYPE] = OwlPropertyType.StatementProperty
|
|
809
832
|
case 'owl:subPropertyOf':
|
|
810
833
|
self._attributes[PropClassAttr.SUBPROPERTY_OF] = obj
|
|
811
834
|
case 'rdfs:range':
|
|
@@ -832,6 +855,12 @@ class PropertyClass(Model, Notify):
|
|
|
832
855
|
#
|
|
833
856
|
# Consistency checks
|
|
834
857
|
#
|
|
858
|
+
if self._statementProperty:
|
|
859
|
+
if self._attributes.get(PropClassAttr.TYPE) != OwlPropertyType.StatementProperty:
|
|
860
|
+
raise OldapErrorInconsistency(f'Property "{self._property_class_iri}" is a statementProperty, but not an StatementProperty.')
|
|
861
|
+
else:
|
|
862
|
+
if self._attributes.get(PropClassAttr.TYPE) == OwlPropertyType.StatementProperty:
|
|
863
|
+
raise OldapErrorInconsistency(f'Property "{self._property_class_iri}" is not a statementProperty, but an StatementProperty.')
|
|
835
864
|
if self._attributes[PropClassAttr.TYPE] == OwlPropertyType.OwlDataProperty:
|
|
836
865
|
if not datatype:
|
|
837
866
|
raise OldapError(f'OwlDataProperty "{self._property_class_iri}" has no rdfs:range datatype defined!')
|
|
@@ -946,11 +975,13 @@ class PropertyClass(Model, Notify):
|
|
|
946
975
|
sparql += f'\n{blank:{(indent + 1) * indent_inc}} {bnode} sh:path {self._property_class_iri.toRdf}'
|
|
947
976
|
else:
|
|
948
977
|
sparql += f'\n{blank:{(indent + 1) * indent_inc}}sh:path {self._property_class_iri.toRdf}'
|
|
949
|
-
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}
|
|
978
|
+
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}schema:version {self.__version.toRdf}'
|
|
950
979
|
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:creator {self._con.userIri.toRdf}'
|
|
951
980
|
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:created {timestamp.toRdf}'
|
|
952
981
|
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:contributor {self._con.userIri.toRdf}'
|
|
953
982
|
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:modified {timestamp.toRdf}'
|
|
983
|
+
if self._statementProperty:
|
|
984
|
+
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}oldap:statementProperty true'
|
|
954
985
|
for prop, value in self._attributes.items():
|
|
955
986
|
if prop == PropClassAttr.TYPE:
|
|
956
987
|
continue
|
|
@@ -1114,7 +1145,6 @@ class PropertyClass(Model, Notify):
|
|
|
1114
1145
|
try:
|
|
1115
1146
|
self._con.transaction_update(sparql)
|
|
1116
1147
|
except OldapError as err:
|
|
1117
|
-
print(sparql)
|
|
1118
1148
|
self._con.transaction_abort()
|
|
1119
1149
|
raise
|
|
1120
1150
|
try:
|
|
@@ -719,7 +719,7 @@ class ResourceClass(Model, Notify):
|
|
|
719
719
|
for key, val in attributes.items():
|
|
720
720
|
if key == 'sh:targetClass':
|
|
721
721
|
continue
|
|
722
|
-
if key == '
|
|
722
|
+
if key == 'schema:version':
|
|
723
723
|
self.__version = SemanticVersion.fromString(val[0])
|
|
724
724
|
elif key == 'dcterms:creator':
|
|
725
725
|
self._creator = val[0]
|
|
@@ -1095,7 +1095,7 @@ class ResourceClass(Model, Notify):
|
|
|
1095
1095
|
sparql = ''
|
|
1096
1096
|
sparql += f'{blank:{(indent + 1)*indent_inc}}{self._owlclass_iri}Shape a sh:NodeShape, {self._owlclass_iri.toRdf}'
|
|
1097
1097
|
sparql += f' ;\n{blank:{(indent + 2) * indent_inc}}sh:targetClass {self._owlclass_iri.toRdf}'
|
|
1098
|
-
sparql += f' ;\n{blank:{(indent + 2) * indent_inc}}
|
|
1098
|
+
sparql += f' ;\n{blank:{(indent + 2) * indent_inc}}schema:version {self.__version.toRdf}'
|
|
1099
1099
|
self._created = timestamp
|
|
1100
1100
|
sparql += f' ;\n{blank:{(indent + 2) * indent_inc}}dcterms:created {timestamp.toRdf}'
|
|
1101
1101
|
sparql += f' ;\n{blank:{(indent + 2) * indent_inc}}dcterms:creator {self._creator.toRdf}'
|
|
@@ -1158,7 +1158,7 @@ class ResourceClass(Model, Notify):
|
|
|
1158
1158
|
sparql += hp.prop.create_owl_part1(timestamp, indent + 2) + '\n'
|
|
1159
1159
|
|
|
1160
1160
|
sparql += f'{blank:{(indent + 2) * indent_inc}}{self._owlclass_iri} rdf:type owl:Class ;\n'
|
|
1161
|
-
sparql += f'{blank:{(indent + 3) * indent_inc}}
|
|
1161
|
+
sparql += f'{blank:{(indent + 3) * indent_inc}}schema:version {self.__version.toRdf} ;\n'
|
|
1162
1162
|
sparql += f'{blank:{(indent + 3) * indent_inc}}dcterms:created {timestamp.toRdf} ;\n'
|
|
1163
1163
|
sparql += f'{blank:{(indent + 3) * indent_inc}}dcterms:creator {self._creator.toRdf} ;\n'
|
|
1164
1164
|
sparql += f'{blank:{(indent + 3) * indent_inc}}dcterms:modified {timestamp.toRdf} ;\n'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.10"
|
|
@@ -177,7 +177,7 @@ class TestBasicConnection(unittest.TestCase):
|
|
|
177
177
|
Iri("sh:property"): Xsd_QName("test:testShape"),
|
|
178
178
|
Iri("sh:closed"): Xsd_boolean(True),
|
|
179
179
|
Iri("sh:targetClass"): Xsd_QName("test:testMyRes"),
|
|
180
|
-
Iri("
|
|
180
|
+
Iri("schema:version"): '1.0.0',
|
|
181
181
|
Iri("dcterms:creator"): Iri("https://orcid.org/0000-0003-1681-4036"),
|
|
182
182
|
Iri("dcterms:created"): Xsd_dateTime(datetime(2023, 11, 4, 12, 0, tzinfo=timezone.utc)),
|
|
183
183
|
Iri("dcterms:contributor"): Iri("https://orcid.org/0000-0003-1681-4036"),
|
|
@@ -48,6 +48,7 @@ class TestDataModel(unittest.TestCase):
|
|
|
48
48
|
_project: Project
|
|
49
49
|
_dmproject: Project
|
|
50
50
|
_sysproject: Project
|
|
51
|
+
_sharedproject: Project
|
|
51
52
|
|
|
52
53
|
@classmethod
|
|
53
54
|
def setUp(cls):
|
|
@@ -114,6 +115,7 @@ class TestDataModel(unittest.TestCase):
|
|
|
114
115
|
cls._dmprojectH = Project.read(cls._connection, "dmtestH", ignore_cache=True)
|
|
115
116
|
cls._dmprojectI = Project.read(cls._connection, "dmtestI", ignore_cache=True)
|
|
116
117
|
cls._sysproject = Project.read(cls._connection, "oldap", ignore_cache=True)
|
|
118
|
+
cls._sharedproject = Project.read(cls._connection, "shared", ignore_cache=True)
|
|
117
119
|
|
|
118
120
|
|
|
119
121
|
def tearDown(self):
|
|
@@ -380,7 +382,9 @@ class TestDataModel(unittest.TestCase):
|
|
|
380
382
|
Iri("dcterms:accessRights"),
|
|
381
383
|
Iri("schema:givenName"),
|
|
382
384
|
Iri("schema:familyName"),
|
|
383
|
-
Iri("schema:email")
|
|
385
|
+
Iri("schema:email"),
|
|
386
|
+
Iri("oldap:hasAdminPermission"),
|
|
387
|
+
Iri("oldap:statementProperty")
|
|
384
388
|
})
|
|
385
389
|
self.assertEqual(set(model.get_resclasses()), {
|
|
386
390
|
Iri("oldap:Project"),
|
|
@@ -391,9 +395,13 @@ class TestDataModel(unittest.TestCase):
|
|
|
391
395
|
Iri("oldap:DataPermission"),
|
|
392
396
|
Iri("oldap:PermissionSet"),
|
|
393
397
|
Iri("oldap:Thing"),
|
|
394
|
-
Iri("oldap:OldapChronolgyStatement")
|
|
398
|
+
Iri("oldap:OldapChronolgyStatement"),
|
|
399
|
+
Iri("oldap:inProjectStatement")
|
|
395
400
|
})
|
|
396
401
|
|
|
402
|
+
def test_datamodel_read_shared(self):
|
|
403
|
+
model = DataModel.read(self._connection, self._sharedproject, ignore_cache=True)
|
|
404
|
+
|
|
397
405
|
def test_datamodel_cache(self):
|
|
398
406
|
start = time()
|
|
399
407
|
model = DataModel.read(self._connection, self._sysproject, ignore_cache=True)
|
|
@@ -91,6 +91,20 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
91
91
|
self.assertEqual(p.get(PropClassAttr.NAME), LangString(["Test property@en", "Testprädikat@de"]))
|
|
92
92
|
self.assertEqual(p.get(PropClassAttr.DESCRIPTION), LangString("A property for testing...@en", "Property für Tests@de"))
|
|
93
93
|
|
|
94
|
+
def test_star_propertyclass_constructor(self):
|
|
95
|
+
p = PropertyClass(con=self._connection,
|
|
96
|
+
project=self._project,
|
|
97
|
+
property_class_iri=Iri('test:testpropstar'),
|
|
98
|
+
statement_property=True,
|
|
99
|
+
datatype=XsdDatatypes.string,
|
|
100
|
+
name=LangString(["Test property@en", "Testprädikat@de"]),
|
|
101
|
+
description={"A property for testing...@en", "Property für Tests@de"})
|
|
102
|
+
self.assertEqual(p.property_class_iri, Iri('test:testpropstar'))
|
|
103
|
+
self.assertTrue(p.statementProperty)
|
|
104
|
+
self.assertEqual(p.get(PropClassAttr.DATATYPE), XsdDatatypes.string)
|
|
105
|
+
self.assertEqual(p.get(PropClassAttr.NAME), LangString(["Test property@en", "Testprädikat@de"]))
|
|
106
|
+
self.assertEqual(p.get(PropClassAttr.DESCRIPTION), LangString("A property for testing...@en", "Property für Tests@de"))
|
|
107
|
+
|
|
94
108
|
def test_propertyclass_inset_datatypes(self):
|
|
95
109
|
p = PropertyClass(con=self._connection,
|
|
96
110
|
project=self._project,
|
|
@@ -266,7 +280,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
266
280
|
RdfSet({Xsd_string("very good"), Xsd_string("good"), Xsd_string("fair"), Xsd_string("insufficient")}))
|
|
267
281
|
|
|
268
282
|
# @unittest.skip('Work in progress')
|
|
269
|
-
def
|
|
283
|
+
def test_propertyclass_create_A(self):
|
|
270
284
|
p1 = PropertyClass(
|
|
271
285
|
con=self._connection,
|
|
272
286
|
project=self._project,
|
|
@@ -288,6 +302,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
288
302
|
self.assertEqual(p1[PropClassAttr.IN],
|
|
289
303
|
RdfSet(Iri("http://www.test.org/comment1"), Iri("http://www.test.org/comment2")))
|
|
290
304
|
|
|
305
|
+
def test_propertyclass_create_B(self):
|
|
291
306
|
p2 = PropertyClass(
|
|
292
307
|
con=self._connection,
|
|
293
308
|
project=self._project,
|
|
@@ -309,6 +324,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
309
324
|
self.assertEqual(p2[PropClassAttr.LANGUAGE_IN],
|
|
310
325
|
LanguageIn(Language.EN, Language.DE, Language.FR, Language.IT))
|
|
311
326
|
|
|
327
|
+
def test_propertyclass_create_C(self):
|
|
312
328
|
p3 = PropertyClass(
|
|
313
329
|
con=self._connection,
|
|
314
330
|
project=self._project,
|
|
@@ -323,7 +339,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
323
339
|
ignore_cache=True)
|
|
324
340
|
self.assertEqual(p3.pattern, r"^[\w\.-]+@[a-zA-Z\d-]+(\.[a-zA-Z\d-]+)*\.[a-zA-Z]{2,}$")
|
|
325
341
|
|
|
326
|
-
|
|
342
|
+
def test_propertyclass_create_D(self):
|
|
327
343
|
pX = PropertyClass(
|
|
328
344
|
con=self._connection,
|
|
329
345
|
#graph=Xsd_NCName('test'),
|
|
@@ -335,6 +351,22 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
335
351
|
pX.create()
|
|
336
352
|
self.assertEqual(str(ex.exception), 'Property "test:testWrite" already exists.')
|
|
337
353
|
|
|
354
|
+
def test_propertyclass_create_E(self):
|
|
355
|
+
p = PropertyClass(
|
|
356
|
+
con=self._connection,
|
|
357
|
+
project=self._project,
|
|
358
|
+
property_class_iri=Iri('test:testWriteStar'),
|
|
359
|
+
statement_property=True,
|
|
360
|
+
datatype=XsdDatatypes.string,
|
|
361
|
+
)
|
|
362
|
+
p.create()
|
|
363
|
+
p = PropertyClass.read(con=self._connection,
|
|
364
|
+
project=self._project,
|
|
365
|
+
property_class_iri=Iri('test:testWriteStar'),
|
|
366
|
+
ignore_cache=True)
|
|
367
|
+
self.assertTrue(p.statementProperty)
|
|
368
|
+
self.assertEqual(p.get(PropClassAttr.DATATYPE), XsdDatatypes.string)
|
|
369
|
+
|
|
338
370
|
def test_propertyclass_create_nopermission(self):
|
|
339
371
|
p1 = PropertyClass(
|
|
340
372
|
con=self._unpriv,
|