oldaplib 0.3.8__tar.gz → 0.3.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.3.8 → oldaplib-0.3.10}/PKG-INFO +1 -1
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/observable_set.py +28 -18
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/objectfactory.py +50 -44
- oldaplib-0.3.10/oldaplib/src/version.py +1 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_objectfactory.py +3 -1
- {oldaplib-0.3.8 → oldaplib-0.3.10}/pyproject.toml +1 -1
- oldaplib-0.3.8/oldaplib/src/version.py +0 -1
- {oldaplib-0.3.8 → oldaplib-0.3.10}/README.md +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/__init__.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/apps/load_list.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/ontologies/admin-testing.trig +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/ontologies/admin.trig +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/ontologies/example.trig +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/ontologies/oldap.trig +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/ontologies/oldap.ttl +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/ontologies/shared.trig +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/ontologies/standard/.gitsave +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/__init__.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/cachesingleton.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/connection.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/datamodel.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/dtypes/__init__.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/dtypes/bnode.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/dtypes/languagein.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/dtypes/namespaceiri.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/dtypes/rdfset.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/dtypes/xsdset.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/__init__.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/action.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/adminpermissions.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/attributeclass.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/datapermissions.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/externalontologyattr.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/haspropertyattr.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/language.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/oldaplistattr.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/oldaplistnodeattr.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/owlpropertytype.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/permissionsetattr.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/projectattr.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/propertyclassattr.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/resourceclassattr.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/sparql_result_format.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/userattr.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/enums/xsd_datatypes.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/externalontology.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/globalconfig.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/hasproperty.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/Notify.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/__init__.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/attributechange.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/context.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/convert2datatype.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/irincname.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/json_encoder.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/langstring.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/numeric.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/observable_dict.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/oldaperror.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/query_processor.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/semantic_version.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/serializeableset.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/serializer.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/singletonmeta.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/helpers/tools.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/iconnection.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/in_project.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/model.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/oldaplist.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/oldaplist_helpers.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/oldaplistnode.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/oldaplogging.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/permissionset.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/project.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/propertyclass.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/resourceclass.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/user.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/userdataclass.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/__init__.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/floatingpoint.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/iri.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_anyuri.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_base64binary.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_boolean.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_byte.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_date.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_datetime.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_datetimestamp.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_decimal.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_double.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_duration.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_float.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_gday.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_gmonth.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_gmonthday.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_gyear.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_gyearmonth.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_hexbinary.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_id.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_idref.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_int.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_integer.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_language.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_long.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_name.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_ncname.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_negativeinteger.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_nmtoken.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_nonnegativeinteger.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_nonpositiveinteger.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_normalizedstring.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_positiveinteger.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_qname.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_short.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_string.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_time.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_token.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_unsignedbyte.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_unsignedint.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_unsignedlong.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/src/xsd/xsd_unsignedshort.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/__init__.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_cache.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_connection.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_context.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_datamodel.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_dtypes.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_externalontologies.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_hasproperty.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_in_project.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_langstring.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_language_in.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_observable_dict.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_observable_set.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_oldaplist.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_oldaplist_helpers.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_oldaplistnode.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_permissionset.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_project.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_propertyclass.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_resourceclass.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_semantic_version.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_user.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/test/test_xsd_datatypes.py +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/Gender.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/collections_type.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/connection_test.trig +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/datamodel_test.trig +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/event_type.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/hlist_schema.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/institution_or_building_type.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/language.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/location_type.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/means_of_transportation.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/objectfactory_test.trig +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/playground_list.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/role.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/source_type-1.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/source_type.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/test_move_left_of_toL.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testdata/testlist.yaml +0 -0
- {oldaplib-0.3.8 → oldaplib-0.3.10}/oldaplib/testit.http +0 -0
|
@@ -80,7 +80,7 @@ class ObservableSet(Notify):
|
|
|
80
80
|
def __str__(self) -> str:
|
|
81
81
|
return str(self._setdata)
|
|
82
82
|
|
|
83
|
-
def __eq__(self, other: Iterable) -> bool:
|
|
83
|
+
def __eq__(self, other: Iterable[Any]) -> bool:
|
|
84
84
|
if isinstance(other, ObservableSet):
|
|
85
85
|
return self._setdata == other._setdata
|
|
86
86
|
elif isinstance(other, set):
|
|
@@ -90,7 +90,7 @@ class ObservableSet(Notify):
|
|
|
90
90
|
else:
|
|
91
91
|
raise OldapErrorNotImplemented(f'Set.__eq__() not implemented for {type(other).__name__}')
|
|
92
92
|
|
|
93
|
-
def __or__(self, other: Iterable) -> Self:
|
|
93
|
+
def __or__(self, other: Iterable[Any]) -> Self:
|
|
94
94
|
if isinstance(other, ObservableSet):
|
|
95
95
|
return ObservableSet(self._setdata.__or__(other._setdata), self._notifier, self._notify_data)
|
|
96
96
|
elif isinstance(other, set):
|
|
@@ -100,25 +100,24 @@ class ObservableSet(Notify):
|
|
|
100
100
|
else:
|
|
101
101
|
raise OldapErrorNotImplemented(f'Set.__or__() not implemented for {type(other).__name__}')
|
|
102
102
|
|
|
103
|
-
def __ror__(self, other:
|
|
104
|
-
|
|
103
|
+
def __ror__(self, other: Iterable[Any]) -> Self:
|
|
104
|
+
return ObservableSet(set(other).__or__(self._setdata), self._notifier, self._notify_data)
|
|
105
|
+
|
|
106
|
+
def __rsub__(self, other: Iterable[Any]) -> Self:
|
|
107
|
+
return ObservableSet(set(other).__sub__(self._setdata), self._notifier, self._notify_data)
|
|
105
108
|
|
|
106
|
-
def __ior__(self, other: Iterable) -> Self:
|
|
109
|
+
def __ior__(self, other: Iterable[Any]) -> Self:
|
|
107
110
|
tmp_copy = deepcopy(self)
|
|
108
111
|
if isinstance(other, ObservableSet):
|
|
109
112
|
self._setdata.__ior__(other._setdata)
|
|
110
|
-
elif isinstance(other, set):
|
|
111
|
-
self._setdata.__ior__(other)
|
|
112
|
-
elif isinstance(other, Iterable):
|
|
113
|
-
return ObservableSet(self._setdata.__ior__(set(other)), self._notifier, self._notify_data)
|
|
114
113
|
else:
|
|
115
|
-
|
|
114
|
+
self._setdata.__ior__(set(other))
|
|
116
115
|
if not self._old_value:
|
|
117
116
|
self._old_value = tmp_copy
|
|
118
117
|
self.notify()
|
|
119
118
|
return self
|
|
120
119
|
|
|
121
|
-
def __and__(self, other: Iterable) -> Self:
|
|
120
|
+
def __and__(self, other: Iterable[Any]) -> Self:
|
|
122
121
|
if isinstance(other, ObservableSet):
|
|
123
122
|
return ObservableSet(self._setdata.__and__(other._setdata), self._notifier, self._notify_data)
|
|
124
123
|
elif isinstance(other, set):
|
|
@@ -128,7 +127,7 @@ class ObservableSet(Notify):
|
|
|
128
127
|
else:
|
|
129
128
|
raise OldapErrorNotImplemented(f'Set.__and__() not implemented for {type(other).__name__}')
|
|
130
129
|
|
|
131
|
-
def __iand__(self, other: Iterable) -> Self:
|
|
130
|
+
def __iand__(self, other: Iterable[Any]) -> Self:
|
|
132
131
|
tmp_copy = deepcopy(self)
|
|
133
132
|
if isinstance(other, ObservableSet):
|
|
134
133
|
self._setdata.__iand__(other._setdata)
|
|
@@ -146,7 +145,7 @@ class ObservableSet(Notify):
|
|
|
146
145
|
def __rsub__(self, other: Self) -> Self:
|
|
147
146
|
pass
|
|
148
147
|
|
|
149
|
-
def __sub__(self, other: Iterable) -> Self:
|
|
148
|
+
def __sub__(self, other: Iterable[Any]) -> Self:
|
|
150
149
|
if isinstance(other, ObservableSet):
|
|
151
150
|
return ObservableSet(self._setdata.__sub__(other._setdata), self.notify, self._notify_data)
|
|
152
151
|
elif isinstance(other, set):
|
|
@@ -156,7 +155,7 @@ class ObservableSet(Notify):
|
|
|
156
155
|
else:
|
|
157
156
|
raise OldapErrorNotImplemented(f'Set.__sub__() not implemented for {type(other).__name__}')
|
|
158
157
|
|
|
159
|
-
def __isub__(self, other: Iterable) -> Self:
|
|
158
|
+
def __isub__(self, other: Iterable[Any]) -> Self:
|
|
160
159
|
tmp_copy = deepcopy(self)
|
|
161
160
|
if isinstance(other, ObservableSet):
|
|
162
161
|
self._setdata.__isub__(other._setdata)
|
|
@@ -171,34 +170,45 @@ class ObservableSet(Notify):
|
|
|
171
170
|
self.notify()
|
|
172
171
|
return self
|
|
173
172
|
|
|
174
|
-
|
|
173
|
+
@classmethod
|
|
174
|
+
def coerce(cls, value: Iterable[Any], *, notifier=None, notify_data=None) -> "ObservableSet":
|
|
175
|
+
return value if isinstance(value, cls) else cls(value, notifier=notifier, notify_data=notify_data)
|
|
176
|
+
|
|
177
|
+
def update(self, items: Iterable[Any]):
|
|
175
178
|
tmp_copy = deepcopy(self)
|
|
176
179
|
self._setdata.update(items)
|
|
177
180
|
if not self._old_value:
|
|
178
181
|
self._old_value = tmp_copy
|
|
179
182
|
self.notify()
|
|
180
183
|
|
|
181
|
-
def intersection_update(self, items: Iterable):
|
|
184
|
+
def intersection_update(self, items: Iterable[Any]):
|
|
182
185
|
tmp_copy = deepcopy(self)
|
|
183
186
|
self._setdata.intersection_update(items)
|
|
184
187
|
if not self._old_value:
|
|
185
188
|
self._old_value = tmp_copy
|
|
186
189
|
self.notify()
|
|
187
190
|
|
|
188
|
-
def difference_update(self, items: Iterable):
|
|
191
|
+
def difference_update(self, items: Iterable[Any]):
|
|
189
192
|
tmp_copy = deepcopy(self)
|
|
190
193
|
self._setdata.difference_update(items)
|
|
191
194
|
if not self._old_value:
|
|
192
195
|
self._old_value = tmp_copy
|
|
193
196
|
self.notify()
|
|
194
197
|
|
|
195
|
-
def symmetric_difference_update(self, items: Iterable):
|
|
198
|
+
def symmetric_difference_update(self, items: Iterable[Any]):
|
|
196
199
|
tmp_copy = deepcopy(self)
|
|
197
200
|
self._setdata.symmetric_difference_update(items)
|
|
198
201
|
if not self._old_value:
|
|
199
202
|
self._old_value = tmp_copy
|
|
200
203
|
self.notify()
|
|
201
204
|
|
|
205
|
+
def replace(self, items: Iterable[Any]) -> None:
|
|
206
|
+
tmp_copy = deepcopy(self)
|
|
207
|
+
self._setdata = set(items)
|
|
208
|
+
if not self._old_value:
|
|
209
|
+
self._old_value = tmp_copy
|
|
210
|
+
self.notify()
|
|
211
|
+
|
|
202
212
|
def add(self, item: Any) -> None:
|
|
203
213
|
tmp_copy = deepcopy(self)
|
|
204
214
|
self._setdata.add(item)
|
|
@@ -443,33 +443,24 @@ class ResourceInstance:
|
|
|
443
443
|
|
|
444
444
|
def get_data_permission(self, context: Context, permission: DataPermission) -> bool:
|
|
445
445
|
permission_query = context.sparql_context
|
|
446
|
-
# language=sparql
|
|
447
446
|
permission_query += f'''
|
|
448
|
-
|
|
449
|
-
FROM oldap:onto
|
|
450
|
-
FROM shared:onto
|
|
451
|
-
FROM {self._graph}:onto
|
|
452
|
-
FROM NAMED oldap:admin
|
|
453
|
-
FROM NAMED {self._graph}:data
|
|
454
|
-
WHERE {{
|
|
455
|
-
BIND({self._iri.toRdf} as ?iri)
|
|
447
|
+
ASK {{
|
|
456
448
|
GRAPH {self._graph}:data {{
|
|
457
|
-
|
|
449
|
+
{self._iri.toRdf} oldap:grantsPermission ?permset .
|
|
458
450
|
}}
|
|
459
|
-
BIND({self._con.userIri.toRdf} as ?user)
|
|
460
451
|
GRAPH oldap:admin {{
|
|
461
|
-
|
|
452
|
+
{self._con.userIri.toRdf} oldap:hasPermissions ?permset .
|
|
462
453
|
?permset oldap:givesPermission ?DataPermission .
|
|
463
454
|
?DataPermission oldap:permissionValue ?permval .
|
|
464
455
|
}}
|
|
465
456
|
FILTER(?permval >= {permission.numeric.toRdf})
|
|
466
457
|
}}'''
|
|
458
|
+
|
|
467
459
|
if self._con.in_transaction():
|
|
468
|
-
|
|
460
|
+
result = self._con.transaction_query(permission_query)
|
|
469
461
|
else:
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
return res[0]['numOfPermsets'] > 0
|
|
462
|
+
result = self._con.query(permission_query)
|
|
463
|
+
return result['boolean']
|
|
473
464
|
|
|
474
465
|
def create(self, indent: int = 0, indent_inc: int = 4) -> str:
|
|
475
466
|
result, message = self.check_for_permissions(AdminPermission.ADMIN_CREATE)
|
|
@@ -707,12 +698,13 @@ class ResourceInstance:
|
|
|
707
698
|
|
|
708
699
|
context = Context(name=self._con.context_name)
|
|
709
700
|
inuse = context.sparql_context
|
|
710
|
-
inuse
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
701
|
+
inuse += f"""
|
|
702
|
+
ASK {{
|
|
703
|
+
GRAPH ?g {{
|
|
704
|
+
?res ?prop {self._iri.toRdf} .
|
|
705
|
+
}}
|
|
714
706
|
}}
|
|
715
|
-
|
|
707
|
+
"""
|
|
716
708
|
|
|
717
709
|
context = Context(name=self._con.context_name)
|
|
718
710
|
sparql = context.sparql_context
|
|
@@ -730,9 +722,8 @@ class ResourceInstance:
|
|
|
730
722
|
self._con.transaction_abort()
|
|
731
723
|
raise OldapErrorNoPermission(f'No permission to update resource "{self._iri}"')
|
|
732
724
|
try:
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
if res[0]['nres'] > 0:
|
|
725
|
+
result = self._con.transaction_query(inuse)
|
|
726
|
+
if result['boolean']:
|
|
736
727
|
raise OldapErrorInUse(f'Resource "{self._iri}" is in use and cannot be deleted.')
|
|
737
728
|
except OldapError:
|
|
738
729
|
self._con.transaction_abort()
|
|
@@ -791,9 +782,6 @@ class ResourceInstanceFactory:
|
|
|
791
782
|
|
|
792
783
|
self._datamodel = DataModel.read(con=self._con, project=self._project, ignore_cache=True)
|
|
793
784
|
|
|
794
|
-
#self._oldap_project = Project.read(self._con, "oldap")
|
|
795
|
-
#self._oldap_datamodel = DataModel.read(con=self._con, project=self._oldap_project)
|
|
796
|
-
|
|
797
785
|
def createObjectInstance(self, name: Xsd_NCName | str) -> Type: ## ToDo: Get name automatically from IRI
|
|
798
786
|
classiri = Xsd_QName(self._project.projectShortName, name)
|
|
799
787
|
resclass = self._datamodel.get(classiri)
|
|
@@ -849,7 +837,6 @@ class ResourceInstanceFactory:
|
|
|
849
837
|
raise OldapErrorNotFound(f'Resource with iri <{iri}> not found.')
|
|
850
838
|
return data
|
|
851
839
|
|
|
852
|
-
|
|
853
840
|
def read(self, iri: Iri | str) -> ResourceInstance:
|
|
854
841
|
if not isinstance(iri, Iri):
|
|
855
842
|
iri = Iri(iri, validate=True)
|
|
@@ -901,9 +888,18 @@ class ResourceInstanceFactory:
|
|
|
901
888
|
Instance = self.createObjectInstance(objtype)
|
|
902
889
|
return Instance(iri=iri, **kwargs)
|
|
903
890
|
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
891
|
+
@staticmethod
|
|
892
|
+
def search_fulltext(con: IConnection,
|
|
893
|
+
projectShortName: Xsd_NCName | str,
|
|
894
|
+
s: str,
|
|
895
|
+
count_only: bool = False,
|
|
896
|
+
limit: int = 100,
|
|
897
|
+
offset: int = 0) -> int | dict[Iri, dict[str, Xsd]]:
|
|
898
|
+
if not isinstance(projectShortName, Xsd_NCName):
|
|
899
|
+
graph = Xsd_NCName(projectShortName)
|
|
900
|
+
else:
|
|
901
|
+
graph = projectShortName
|
|
902
|
+
context = Context(name=con.context_name)
|
|
907
903
|
sparql = context.sparql_context
|
|
908
904
|
if (count_only):
|
|
909
905
|
sparql += "SELECT (COUNT(DISTINCT ?s) as ?numResult)"
|
|
@@ -920,7 +916,7 @@ class ResourceInstanceFactory:
|
|
|
920
916
|
(datatype(?o) = xsd:string || datatype(?o) = rdf:langString || lang(?o) != ""))
|
|
921
917
|
FILTER(CONTAINS(LCASE(STR(?o)), "{s}")) # case-insensitive substring match
|
|
922
918
|
GRAPH oldap:admin {{
|
|
923
|
-
{
|
|
919
|
+
{con.userIri.toRdf} oldap:hasPermissions ?permset .
|
|
924
920
|
?permset oldap:givesPermission ?DataPermission .
|
|
925
921
|
?DataPermission oldap:permissionValue ?permval .
|
|
926
922
|
}}
|
|
@@ -929,21 +925,31 @@ class ResourceInstanceFactory:
|
|
|
929
925
|
'''
|
|
930
926
|
if not count_only:
|
|
931
927
|
sparql += f'LIMIT {limit} OFFSET {offset}'
|
|
932
|
-
|
|
928
|
+
try:
|
|
929
|
+
jsonres = con.query(sparql)
|
|
930
|
+
except OldapError:
|
|
931
|
+
print(sparql)
|
|
932
|
+
raise
|
|
933
933
|
res = QueryProcessor(context, jsonres)
|
|
934
934
|
if count_only:
|
|
935
|
-
|
|
936
|
-
tmp = cast(Xsd_integer, res[0]['numResult'])
|
|
937
|
-
return int(tmp)
|
|
938
|
-
else:
|
|
939
|
-
raise OldapErrorInconsistency(f'Expected integer as value, got "{res[0]["numResult"]}"')
|
|
935
|
+
return res[0]['numResult']
|
|
940
936
|
else:
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
937
|
+
return {Iri(r['s']): {r['p']: r['o']} for r in res}
|
|
938
|
+
# jsonres = con.query(sparql)
|
|
939
|
+
# res = QueryProcessor(context, jsonres)
|
|
940
|
+
# if count_only:
|
|
941
|
+
# if isinstance(res[0]['numResult'], Xsd_integer):
|
|
942
|
+
# tmp = cast(Xsd_integer, res[0]['numResult'])
|
|
943
|
+
# return int(tmp)
|
|
944
|
+
# else:
|
|
945
|
+
# raise OldapErrorInconsistency(f'Expected integer as value, got "{res[0]["numResult"]}"')
|
|
946
|
+
# else:
|
|
947
|
+
# result: dict[Iri, dict[str, Xsd]] = {}
|
|
948
|
+
# for r in res:
|
|
949
|
+
# iri = cast(Iri, r['s'])
|
|
950
|
+
# resclass = cast(Iri, r['t'])
|
|
951
|
+
# result[iri] = {'resclass': resclass, 'property': r['p'], 'value': r['o']}
|
|
952
|
+
# return result
|
|
947
953
|
|
|
948
954
|
|
|
949
955
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.10"
|
|
@@ -645,7 +645,9 @@ class TestObjectFactory(unittest.TestCase):
|
|
|
645
645
|
pubDate="1995-09-27",
|
|
646
646
|
grantsPermission=Iri('oldap:GenericView'))
|
|
647
647
|
b.create()
|
|
648
|
-
res =
|
|
648
|
+
res = ResourceInstanceFactory.search_fulltext(con=self._connection,
|
|
649
|
+
projectShortName='test',
|
|
650
|
+
s='tales')
|
|
649
651
|
|
|
650
652
|
for x, y in res.items():
|
|
651
653
|
print(x, y)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[tool.poetry]
|
|
2
2
|
name = "oldaplib"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.10"
|
|
4
4
|
description = "Open Media Access Server Library (Linked Open Data middleware/RESTApi)"
|
|
5
5
|
authors = ["Lukas Rosenthaler <lukas.rosenthaler@unibas.ch>"]
|
|
6
6
|
license = "GNU Affero General Public License version 3"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.8"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|