oldaplib 0.3.16__py3-none-any.whl → 0.3.18__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- oldaplib/src/helpers/observable_set.py +2 -2
- oldaplib/src/propertyclass.py +76 -30
- oldaplib/src/version.py +1 -1
- oldaplib/test/test_propertyclass.py +116 -13
- {oldaplib-0.3.16.dist-info → oldaplib-0.3.18.dist-info}/METADATA +1 -1
- {oldaplib-0.3.16.dist-info → oldaplib-0.3.18.dist-info}/RECORD +7 -7
- {oldaplib-0.3.16.dist-info → oldaplib-0.3.18.dist-info}/WHEEL +0 -0
|
@@ -290,10 +290,10 @@ class ObservableSet(Notify):
|
|
|
290
290
|
field: Iri,
|
|
291
291
|
ignoreitems: Set[Any] | None = None,
|
|
292
292
|
indent: int = 0, indent_inc: int = 4) -> list[str]:
|
|
293
|
-
items_to_add = self._setdata - self._old_value.to_set()
|
|
293
|
+
items_to_add = self._setdata - self._old_value.to_set() if self._old_value else self._setdata
|
|
294
294
|
if ignoreitems:
|
|
295
295
|
items_to_add = items_to_add - ignoreitems
|
|
296
|
-
items_to_delete = self._old_value.to_set() - self._setdata
|
|
296
|
+
items_to_delete = self._old_value.to_set() - self._setdata if self._old_value else set()
|
|
297
297
|
if ignoreitems:
|
|
298
298
|
items_to_delete = items_to_delete - ignoreitems
|
|
299
299
|
blank = ''
|
oldaplib/src/propertyclass.py
CHANGED
|
@@ -166,7 +166,7 @@ class PropertyClass(Model, Notify):
|
|
|
166
166
|
_projectShortName: Xsd_NCName
|
|
167
167
|
_projectIri: Iri
|
|
168
168
|
_property_class_iri: Xsd_QName | None
|
|
169
|
-
|
|
169
|
+
__statementProperty: Xsd_boolean
|
|
170
170
|
_externalOntology: Xsd_boolean
|
|
171
171
|
_internal: Xsd_QName | None
|
|
172
172
|
_force_external: bool
|
|
@@ -197,7 +197,6 @@ class PropertyClass(Model, Notify):
|
|
|
197
197
|
property_class_iri: Xsd_QName | str | None = None,
|
|
198
198
|
notifier: Callable[[PropClassAttr], None] | None = None,
|
|
199
199
|
notify_data: PropClassAttr | None = None,
|
|
200
|
-
_statementProperty: bool | Xsd_boolean= False,
|
|
201
200
|
_externalOntology: bool | Xsd_boolean = False,
|
|
202
201
|
_internal: Xsd_QName | None = None, # DO NOT USE!! Only for serialization!
|
|
203
202
|
_force_external: bool | None = None, # DO NOT USE!! Only for serialization!
|
|
@@ -256,7 +255,7 @@ class PropertyClass(Model, Notify):
|
|
|
256
255
|
validate=validate)
|
|
257
256
|
Notify.__init__(self, notifier, notify_data)
|
|
258
257
|
|
|
259
|
-
self.
|
|
258
|
+
#self.__statementProperty = _statementProperty if isinstance(_statementProperty, Xsd_boolean) else Xsd_boolean(_statementProperty, validate=True)
|
|
260
259
|
self._externalOntology = _externalOntology if isinstance(_externalOntology, Xsd_boolean) else Xsd_boolean(_externalOntology, validate=True)
|
|
261
260
|
if self._externalOntology:
|
|
262
261
|
self._force_external = True
|
|
@@ -321,10 +320,10 @@ class PropertyClass(Model, Notify):
|
|
|
321
320
|
#
|
|
322
321
|
# process the statement property stuff
|
|
323
322
|
#
|
|
324
|
-
if
|
|
325
|
-
self.
|
|
326
|
-
|
|
327
|
-
self.
|
|
323
|
+
if OwlPropertyType.StatementProperty in self._attributes[PropClassAttr.TYPE]:
|
|
324
|
+
self.__statementProperty = Xsd_boolean(True)
|
|
325
|
+
else:
|
|
326
|
+
self.__statementProperty = Xsd_boolean(False)
|
|
328
327
|
|
|
329
328
|
#
|
|
330
329
|
# setting property type for OWL which distinguished between Data- and Object-properties
|
|
@@ -383,7 +382,7 @@ class PropertyClass(Model, Notify):
|
|
|
383
382
|
**({'_internal': self._internal} if self._internal else {}),
|
|
384
383
|
**({'_force_external': self._force_external} if self._force_external else {}),
|
|
385
384
|
**({'_externalOntology': self._externalOntology} if self._externalOntology else {}),
|
|
386
|
-
**({'
|
|
385
|
+
**({'__statementProperty': self.__statementProperty} if self.__statementProperty else {}),
|
|
387
386
|
'_from_triplestore': self.__from_triplestore,
|
|
388
387
|
}
|
|
389
388
|
|
|
@@ -478,6 +477,15 @@ class PropertyClass(Model, Notify):
|
|
|
478
477
|
self._changeset[PropClassAttr.DATATYPE] = AttributeChange(None, Action.CREATE)
|
|
479
478
|
self._attributes[PropClassAttr.DATATYPE] = value
|
|
480
479
|
|
|
480
|
+
def _del_value(self, attr: PropClassAttr) -> None:
|
|
481
|
+
if attr == PropClassAttr.TYPE:
|
|
482
|
+
remaining = self._attributes.get(attr) & {OwlPropertyType.OwlObjectProperty, OwlPropertyType.OwlDataProperty}
|
|
483
|
+
to_delete = self._attributes.get(attr) - remaining
|
|
484
|
+
for x in to_delete:
|
|
485
|
+
self._attributes[attr].discard(x)
|
|
486
|
+
return
|
|
487
|
+
super()._del_value(attr)
|
|
488
|
+
|
|
481
489
|
def _change_setter(self: Self, attr: PropClassAttr, value: PropTypes) -> None:
|
|
482
490
|
"""
|
|
483
491
|
INTERNAL USE ONLY! Overrides the method _change_setter from the Model class.
|
|
@@ -490,6 +498,25 @@ class PropertyClass(Model, Notify):
|
|
|
490
498
|
"""
|
|
491
499
|
if not isinstance(attr, PropClassAttr):
|
|
492
500
|
raise OldapError(f'Unsupported prop {attr}')
|
|
501
|
+
if attr == PropClassAttr.TYPE:
|
|
502
|
+
if value is None:
|
|
503
|
+
remaining = self._attributes.get(attr) & {OwlPropertyType.OwlObjectProperty, OwlPropertyType.OwlDataProperty}
|
|
504
|
+
to_delete = self._attributes.get(attr) - remaining
|
|
505
|
+
for x in to_delete:
|
|
506
|
+
self._attributes[attr].discard(x)
|
|
507
|
+
return
|
|
508
|
+
else:
|
|
509
|
+
to_add = set(value) - set(self._attributes.get(attr))
|
|
510
|
+
to_delete = set(self._attributes.get(attr)) - set(value)
|
|
511
|
+
if OwlPropertyType.OwlObjectProperty in to_delete:
|
|
512
|
+
to_delete.remove(OwlPropertyType.OwlObjectProperty)
|
|
513
|
+
if OwlPropertyType.OwlDataProperty in to_delete:
|
|
514
|
+
to_delete.remove(OwlPropertyType.OwlDataProperty)
|
|
515
|
+
for x in to_delete:
|
|
516
|
+
self._attributes[attr].discard(x)
|
|
517
|
+
for x in to_add:
|
|
518
|
+
self._attributes[attr].add(x)
|
|
519
|
+
return
|
|
493
520
|
if self._attributes.get(attr) == value:
|
|
494
521
|
return
|
|
495
522
|
super()._change_setter(attr, value)
|
|
@@ -519,7 +546,7 @@ class PropertyClass(Model, Notify):
|
|
|
519
546
|
notifier=self._notifier,
|
|
520
547
|
data=deepcopy(self._notify_data, memo))
|
|
521
548
|
# Copy internals of Model:
|
|
522
|
-
instance.
|
|
549
|
+
instance.__statementProperty = deepcopy(self.__statementProperty, memo)
|
|
523
550
|
instance._externalOntology = deepcopy(self._externalOntology, memo)
|
|
524
551
|
instance._attributes = deepcopy(self._attributes, memo)
|
|
525
552
|
instance._changset = deepcopy(self._changeset, memo)
|
|
@@ -581,14 +608,14 @@ class PropertyClass(Model, Notify):
|
|
|
581
608
|
"""
|
|
582
609
|
return self._internal
|
|
583
610
|
|
|
584
|
-
@property
|
|
585
|
-
def statementProperty(self) -> Xsd_boolean:
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
611
|
+
# @property
|
|
612
|
+
# def statementProperty(self) -> Xsd_boolean:
|
|
613
|
+
# """
|
|
614
|
+
# Return the statementProperty
|
|
615
|
+
# :return: statementProperty
|
|
616
|
+
# :rtype: bool
|
|
617
|
+
# """
|
|
618
|
+
# return self.__statementProperty
|
|
592
619
|
|
|
593
620
|
@property
|
|
594
621
|
def externalOntology(self) -> Xsd_boolean:
|
|
@@ -816,7 +843,7 @@ class PropertyClass(Model, Notify):
|
|
|
816
843
|
raise OldapError(f'Inconsistency in SHACL "dcterms:modified (type={type(val)})"')
|
|
817
844
|
elif key == 'oldap:statementProperty':
|
|
818
845
|
if isinstance(val, Xsd_boolean):
|
|
819
|
-
self.
|
|
846
|
+
self.__statementProperty = val
|
|
820
847
|
else:
|
|
821
848
|
raise OldapError(f'Inconsistency in SHACL "oldap:statementProperty (type={type(val)})"')
|
|
822
849
|
elif key == 'oldap:externalOntology':
|
|
@@ -934,12 +961,12 @@ class PropertyClass(Model, Notify):
|
|
|
934
961
|
#
|
|
935
962
|
# Consistency checks
|
|
936
963
|
#
|
|
937
|
-
if self.
|
|
964
|
+
if self.__statementProperty:
|
|
938
965
|
if OwlPropertyType.StatementProperty not in self._attributes.get(PropClassAttr.TYPE):
|
|
939
|
-
raise OldapErrorInconsistency(f'Property "{self._property_class_iri}"
|
|
966
|
+
raise OldapErrorInconsistency(f'Property "{self._property_class_iri}" has SHACL oldap:statementProperty, but missing rdf:type rdf:Property.')
|
|
940
967
|
else:
|
|
941
968
|
if OwlPropertyType.StatementProperty in self._attributes.get(PropClassAttr.TYPE):
|
|
942
|
-
raise OldapErrorInconsistency(f'Property "{self._property_class_iri}"
|
|
969
|
+
raise OldapErrorInconsistency(f'Property "{self._property_class_iri}" has no SHACL oldap:statementProperty, but a rdf:type rdf:Property.')
|
|
943
970
|
if OwlPropertyType.OwlDataProperty in self._attributes[PropClassAttr.TYPE]:
|
|
944
971
|
if not datatype:
|
|
945
972
|
raise OldapError(f'OwlDataProperty "{self._property_class_iri}" has no rdfs:range datatype defined!')
|
|
@@ -1061,7 +1088,7 @@ class PropertyClass(Model, Notify):
|
|
|
1061
1088
|
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:created {timestamp.toRdf}'
|
|
1062
1089
|
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:contributor {self._con.userIri.toRdf}'
|
|
1063
1090
|
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}dcterms:modified {timestamp.toRdf}'
|
|
1064
|
-
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}oldap:statementProperty {self.
|
|
1091
|
+
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}oldap:statementProperty {self.__statementProperty.toRdf}'
|
|
1065
1092
|
sparql += f' ;\n{blank:{(indent + 1) * indent_inc}}oldap:externalOntology {self._externalOntology.toRdf}'
|
|
1066
1093
|
for prop, value in self._attributes.items():
|
|
1067
1094
|
if not prop.in_shacl:
|
|
@@ -1333,14 +1360,32 @@ class PropertyClass(Model, Notify):
|
|
|
1333
1360
|
indent=indent, indent_inc=indent_inc)
|
|
1334
1361
|
elif prop.datatype == ObservableSet:
|
|
1335
1362
|
if prop == PropClassAttr.TYPE:
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1363
|
+
if self._attributes[prop].old_value:
|
|
1364
|
+
added = set(self._attributes[PropClassAttr.TYPE]) - set(self._attributes[prop].old_value)
|
|
1365
|
+
else:
|
|
1366
|
+
added = set(self._attributes[PropClassAttr.TYPE])
|
|
1367
|
+
if OwlPropertyType.StatementProperty in added:
|
|
1368
|
+
self.__statementProperty = Xsd_boolean(True)
|
|
1369
|
+
ele = RdfModifyItem(Xsd_QName('oldap:statementProperty'), Xsd_boolean(False), Xsd_boolean(True))
|
|
1370
|
+
sparql += RdfModifyProp.shacl(action=change.action,
|
|
1371
|
+
graph=self._graph,
|
|
1372
|
+
owlclass_iri=owlclass_iri,
|
|
1373
|
+
pclass_iri=self._property_class_iri,
|
|
1374
|
+
ele=ele,
|
|
1375
|
+
last_modified=self._modified)
|
|
1376
|
+
if self._attributes[prop].old_value:
|
|
1377
|
+
removed = set(self._attributes[prop].old_value) - set(self._attributes[PropClassAttr.TYPE])
|
|
1378
|
+
else:
|
|
1379
|
+
removed = set()
|
|
1380
|
+
if OwlPropertyType.StatementProperty in removed:
|
|
1381
|
+
self.__statementProperty = Xsd_boolean(False)
|
|
1382
|
+
ele = RdfModifyItem(Xsd_QName('oldap:statementProperty'), Xsd_boolean(True), Xsd_boolean(False))
|
|
1383
|
+
sparql += RdfModifyProp.shacl(action=change.action,
|
|
1384
|
+
graph=self._graph,
|
|
1385
|
+
owlclass_iri=owlclass_iri,
|
|
1386
|
+
pclass_iri=self._property_class_iri,
|
|
1387
|
+
ele=ele,
|
|
1388
|
+
last_modified=self._modified)
|
|
1344
1389
|
else:
|
|
1345
1390
|
raise OldapError(f'SHACL property {prop.value} should not have update action "MODIFY" ({prop.datatype}).')
|
|
1346
1391
|
sparql_list.append(sparql)
|
|
@@ -1632,6 +1677,7 @@ class PropertyClass(Model, Notify):
|
|
|
1632
1677
|
try:
|
|
1633
1678
|
self._con.transaction_update(sparql)
|
|
1634
1679
|
except OldapError as e:
|
|
1680
|
+
print(sparql)
|
|
1635
1681
|
self._con.transaction_abort()
|
|
1636
1682
|
raise
|
|
1637
1683
|
|
oldaplib/src/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.3.
|
|
1
|
+
__version__ = "0.3.18"
|
|
@@ -100,12 +100,12 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
100
100
|
p = PropertyClass(con=self._connection,
|
|
101
101
|
project=self._project,
|
|
102
102
|
property_class_iri=Xsd_QName('test:testpropstar'),
|
|
103
|
-
|
|
103
|
+
type={OwlPropertyType.StatementProperty},
|
|
104
104
|
datatype=XsdDatatypes.string,
|
|
105
105
|
name=LangString(["Test property@en", "Testprädikat@de"]),
|
|
106
106
|
description={"A property for testing...@en", "Property für Tests@de"})
|
|
107
107
|
self.assertEqual(p.property_class_iri, Xsd_QName('test:testpropstar'))
|
|
108
|
-
self.assertTrue(p.
|
|
108
|
+
self.assertTrue(OwlPropertyType.StatementProperty in p.type)
|
|
109
109
|
self.assertEqual(p.get(PropClassAttr.DATATYPE), XsdDatatypes.string)
|
|
110
110
|
self.assertEqual(p.get(PropClassAttr.NAME), LangString(["Test property@en", "Testprädikat@de"]))
|
|
111
111
|
self.assertEqual(p.get(PropClassAttr.DESCRIPTION), LangString("A property for testing...@en", "Property für Tests@de"))
|
|
@@ -457,7 +457,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
457
457
|
con=self._connection,
|
|
458
458
|
project=self._project,
|
|
459
459
|
property_class_iri=Xsd_QName('test:testWriteStar'),
|
|
460
|
-
|
|
460
|
+
type={OwlPropertyType.StatementProperty},
|
|
461
461
|
datatype=XsdDatatypes.string,
|
|
462
462
|
)
|
|
463
463
|
p.create()
|
|
@@ -465,7 +465,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
465
465
|
project=self._project,
|
|
466
466
|
property_class_iri=Xsd_QName('test:testWriteStar'),
|
|
467
467
|
ignore_cache=True)
|
|
468
|
-
self.assertTrue(p.
|
|
468
|
+
self.assertTrue(OwlPropertyType.StatementProperty in p.type)
|
|
469
469
|
self.assertEqual(p.get(PropClassAttr.DATATYPE), XsdDatatypes.string)
|
|
470
470
|
|
|
471
471
|
def test_propertyclass_create_F(self):
|
|
@@ -654,7 +654,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
654
654
|
|
|
655
655
|
|
|
656
656
|
# @unittest.skip('Work in progress')
|
|
657
|
-
def
|
|
657
|
+
def test_propertyclass_update_01(self):
|
|
658
658
|
p1 = PropertyClass(
|
|
659
659
|
con=self._connection,
|
|
660
660
|
project=self._project,
|
|
@@ -698,7 +698,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
698
698
|
self.assertFalse(p2[PropClassAttr.UNIQUE_LANG])
|
|
699
699
|
|
|
700
700
|
# @unittest.skip('Work in progress')
|
|
701
|
-
def
|
|
701
|
+
def test_propertyclass_update_02(self):
|
|
702
702
|
p1 = PropertyClass(
|
|
703
703
|
con=self._connection,
|
|
704
704
|
project=self._project,
|
|
@@ -739,7 +739,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
739
739
|
self.assertEqual(p2.inSet, RdfSet(Xsd_string("gaga"), Xsd_string("is was")))
|
|
740
740
|
self.assertFalse(p2.uniqueLang)
|
|
741
741
|
|
|
742
|
-
def
|
|
742
|
+
def test_propertyclass_update_03(self):
|
|
743
743
|
p1 = PropertyClass(
|
|
744
744
|
con=self._connection,
|
|
745
745
|
project=self._project,
|
|
@@ -784,7 +784,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
784
784
|
self.assertIsNone(p2.languageIn)
|
|
785
785
|
self.assertIsNone(p2.uniqueLang)
|
|
786
786
|
|
|
787
|
-
def
|
|
787
|
+
def test_propertyclass_update_04(self):
|
|
788
788
|
p1 = PropertyClass(
|
|
789
789
|
con=self._connection,
|
|
790
790
|
project=self._project,
|
|
@@ -817,7 +817,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
817
817
|
self.assertEqual(p2.description, LangString("An annotation@en"))
|
|
818
818
|
|
|
819
819
|
|
|
820
|
-
def
|
|
820
|
+
def test_propertyclass_update_05(self):
|
|
821
821
|
p1 = PropertyClass(
|
|
822
822
|
con=self._connection,
|
|
823
823
|
project=self._project,
|
|
@@ -851,7 +851,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
851
851
|
Xsd_string("nom français@fr"),
|
|
852
852
|
Xsd_string("name deutsch@de")])
|
|
853
853
|
|
|
854
|
-
def
|
|
854
|
+
def test_propertyclass_update_06(self):
|
|
855
855
|
p1 = PropertyClass(
|
|
856
856
|
con=self._connection,
|
|
857
857
|
project=self._project,
|
|
@@ -901,7 +901,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
901
901
|
for r in res:
|
|
902
902
|
self.assertIn(r['comment'], [Xsd_string("description english@en"), Xsd_string("description français@fr")])
|
|
903
903
|
|
|
904
|
-
def
|
|
904
|
+
def test_propertyclass_update_07(self):
|
|
905
905
|
p7 = PropertyClass(con=self._connection,
|
|
906
906
|
project=self._project,
|
|
907
907
|
property_class_iri=Xsd_QName('test:testprop7'),
|
|
@@ -920,7 +920,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
920
920
|
ignore_cache=True)
|
|
921
921
|
self.assertEqual(p7.get(PropClassAttr.TYPE), {OwlPropertyType.SymmetricProperty, OwlPropertyType.TransitiveProperty, OwlPropertyType.OwlDataProperty})
|
|
922
922
|
|
|
923
|
-
def
|
|
923
|
+
def test_propertyclass_update_08(self):
|
|
924
924
|
p8 = PropertyClass(con=self._connection,
|
|
925
925
|
project=self._project,
|
|
926
926
|
property_class_iri=Xsd_QName('test:testprop8'),
|
|
@@ -939,7 +939,7 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
939
939
|
ignore_cache=True)
|
|
940
940
|
self.assertEqual(p8.get(PropClassAttr.TYPE), {OwlPropertyType.SymmetricProperty, OwlPropertyType.OwlDataProperty})
|
|
941
941
|
|
|
942
|
-
def
|
|
942
|
+
def test_propertyclass_update_09(self):
|
|
943
943
|
i = PropertyClass(con=self._connection,
|
|
944
944
|
project=self._project,
|
|
945
945
|
property_class_iri=Xsd_QName('test:isChild9'),
|
|
@@ -957,6 +957,109 @@ class TestPropertyClass(unittest.TestCase):
|
|
|
957
957
|
ignore_cache=True)
|
|
958
958
|
self.assertEqual(i2.get(PropClassAttr.INVERSE_OF), Xsd_QName('test:anotherParent'))
|
|
959
959
|
|
|
960
|
+
def test_propertyclass_update_10(self):
|
|
961
|
+
i = PropertyClass(con=self._connection,
|
|
962
|
+
project=self._project,
|
|
963
|
+
property_class_iri=Xsd_QName('test:isChild10'),
|
|
964
|
+
toClass=Iri('test:Human'),
|
|
965
|
+
inverseOf=Xsd_QName('test:isParent10'),
|
|
966
|
+
name=LangString(["Child"]),
|
|
967
|
+
description={"Child of the human"})
|
|
968
|
+
i.create()
|
|
969
|
+
i.type = {OwlPropertyType.FunctionalProperty, OwlPropertyType.SymmetricProperty}
|
|
970
|
+
i.update()
|
|
971
|
+
i2 = PropertyClass.read(con=self._connection,
|
|
972
|
+
project=self._project,
|
|
973
|
+
property_class_iri=Xsd_QName('test:isChild10'),
|
|
974
|
+
ignore_cache=True)
|
|
975
|
+
self.assertTrue({OwlPropertyType.FunctionalProperty} <= set(i2.type))
|
|
976
|
+
|
|
977
|
+
def test_propertyclass_update_11(self):
|
|
978
|
+
i = PropertyClass(con=self._connection,
|
|
979
|
+
project=self._project,
|
|
980
|
+
property_class_iri=Xsd_QName('test:isChild11'),
|
|
981
|
+
type={OwlPropertyType.FunctionalProperty, OwlPropertyType.StatementProperty, OwlPropertyType.TransitiveProperty},
|
|
982
|
+
toClass=Iri('test:Human'),
|
|
983
|
+
name=LangString(["Child"]),
|
|
984
|
+
description={"Child of the human"})
|
|
985
|
+
i.create()
|
|
986
|
+
i.type.discard(OwlPropertyType.FunctionalProperty)
|
|
987
|
+
i.update()
|
|
988
|
+
i2 = PropertyClass.read(con=self._connection,
|
|
989
|
+
project=self._project,
|
|
990
|
+
property_class_iri=Xsd_QName('test:isChild11'),
|
|
991
|
+
ignore_cache=True)
|
|
992
|
+
self.assertTrue({OwlPropertyType.StatementProperty, OwlPropertyType.TransitiveProperty} <= set(i2.type))
|
|
993
|
+
self.assertTrue(OwlPropertyType.FunctionalProperty not in i2.type)
|
|
994
|
+
|
|
995
|
+
def test_propertyclass_update_12(self):
|
|
996
|
+
i = PropertyClass(con=self._connection,
|
|
997
|
+
project=self._project,
|
|
998
|
+
property_class_iri=Xsd_QName('test:isChild12'),
|
|
999
|
+
type={OwlPropertyType.FunctionalProperty, OwlPropertyType.TransitiveProperty},
|
|
1000
|
+
toClass=Iri('test:Human'),
|
|
1001
|
+
name=LangString(["Child"]),
|
|
1002
|
+
description={"Child of the human"})
|
|
1003
|
+
i.create()
|
|
1004
|
+
i.type.add(OwlPropertyType.StatementProperty)
|
|
1005
|
+
i.update()
|
|
1006
|
+
i2 = PropertyClass.read(con=self._connection,
|
|
1007
|
+
project=self._project,
|
|
1008
|
+
property_class_iri=Xsd_QName('test:isChild12'),
|
|
1009
|
+
ignore_cache=True)
|
|
1010
|
+
self.assertTrue({OwlPropertyType.StatementProperty, OwlPropertyType.FunctionalProperty, OwlPropertyType.TransitiveProperty} <= set(i2.type))
|
|
1011
|
+
|
|
1012
|
+
def test_propertyclass_update_13(self):
|
|
1013
|
+
i = PropertyClass(con=self._connection,
|
|
1014
|
+
project=self._project,
|
|
1015
|
+
property_class_iri=Xsd_QName('test:isChild13'),
|
|
1016
|
+
type={OwlPropertyType.StatementProperty},
|
|
1017
|
+
toClass=Iri('test:Human'),
|
|
1018
|
+
name=LangString(["Child"]),
|
|
1019
|
+
description={"Child of the human"})
|
|
1020
|
+
i.create()
|
|
1021
|
+
i.type.discard(OwlPropertyType.StatementProperty)
|
|
1022
|
+
i.update()
|
|
1023
|
+
i2 = PropertyClass.read(con=self._connection,
|
|
1024
|
+
project=self._project,
|
|
1025
|
+
property_class_iri=Xsd_QName('test:isChild13'),
|
|
1026
|
+
ignore_cache=True)
|
|
1027
|
+
self.assertTrue(OwlPropertyType.StatementProperty not in set(i2.type))
|
|
1028
|
+
|
|
1029
|
+
def test_propertyclass_update_14(self):
|
|
1030
|
+
i = PropertyClass(con=self._connection,
|
|
1031
|
+
project=self._project,
|
|
1032
|
+
property_class_iri=Xsd_QName('test:isChild14'),
|
|
1033
|
+
type={OwlPropertyType.StatementProperty},
|
|
1034
|
+
toClass=Iri('test:Human'),
|
|
1035
|
+
name=LangString(["Child"]),
|
|
1036
|
+
description={"Child of the human"})
|
|
1037
|
+
i.create()
|
|
1038
|
+
i.type = None
|
|
1039
|
+
i.update()
|
|
1040
|
+
i2 = PropertyClass.read(con=self._connection,
|
|
1041
|
+
project=self._project,
|
|
1042
|
+
property_class_iri=Xsd_QName('test:isChild14'),
|
|
1043
|
+
ignore_cache=True)
|
|
1044
|
+
self.assertTrue(OwlPropertyType.StatementProperty not in set(i2.type))
|
|
1045
|
+
|
|
1046
|
+
def test_propertyclass_update_15(self):
|
|
1047
|
+
i = PropertyClass(con=self._connection,
|
|
1048
|
+
project=self._project,
|
|
1049
|
+
property_class_iri=Xsd_QName('test:isChild15'),
|
|
1050
|
+
type={OwlPropertyType.StatementProperty},
|
|
1051
|
+
toClass=Iri('test:Human'),
|
|
1052
|
+
name=LangString(["Child"]),
|
|
1053
|
+
description={"Child of the human"})
|
|
1054
|
+
i.create()
|
|
1055
|
+
del i.type
|
|
1056
|
+
i.update()
|
|
1057
|
+
i2 = PropertyClass.read(con=self._connection,
|
|
1058
|
+
project=self._project,
|
|
1059
|
+
property_class_iri=Xsd_QName('test:isChild15'),
|
|
1060
|
+
ignore_cache=True)
|
|
1061
|
+
self.assertTrue(OwlPropertyType.StatementProperty not in set(i2.type))
|
|
1062
|
+
|
|
960
1063
|
# @unittest.skip('Work in progress')
|
|
961
1064
|
def test_propertyclass_delete_attrs(self):
|
|
962
1065
|
p1 = PropertyClass(
|
|
@@ -48,7 +48,7 @@ oldaplib/src/helpers/json_encoder.py,sha256=c78h9uf58zfLaK8X7S1KCK4otY3iEltGnPBy
|
|
|
48
48
|
oldaplib/src/helpers/langstring.py,sha256=KfyYisMKEYstv-CUPlKkjMg9fbTjrOV3IDn2HOUfdtY,30350
|
|
49
49
|
oldaplib/src/helpers/numeric.py,sha256=swRKU51zbwss9UDGTC6FzhTTPK_BVfy5On0KCK-zZnQ,966
|
|
50
50
|
oldaplib/src/helpers/observable_dict.py,sha256=w_I4fG8tKBibimcmSxeKgvDF-zy2aHSBUluXIBeNCHE,3287
|
|
51
|
-
oldaplib/src/helpers/observable_set.py,sha256=
|
|
51
|
+
oldaplib/src/helpers/observable_set.py,sha256=aqBtZFLSG32NSFXNNYGE7RyGj0QmL2O35Khj1asnRYc,14495
|
|
52
52
|
oldaplib/src/helpers/oldaperror.py,sha256=2gKgV8FYiEjbcox1KN1PlOIPY4KclxVTnCIOQ6Ivvc0,1321
|
|
53
53
|
oldaplib/src/helpers/query_processor.py,sha256=1RJnQ9u6BS58xK0PcTbffzF2W-_K42kw37Vbh2HO5sA,10369
|
|
54
54
|
oldaplib/src/helpers/semantic_version.py,sha256=HLFQO2CPVDz_GKZaFCjR5q_G-aSLQ2XYohCA2tCU9go,3218
|
|
@@ -66,11 +66,11 @@ oldaplib/src/oldaplistnode.py,sha256=NnC2juEGTtEkDO6OlB9PjSw_zTF-wSsRUgEk-6VV9DA
|
|
|
66
66
|
oldaplib/src/oldaplogging.py,sha256=IDSOylms9OSTInYPC4Y2QrTTEzRL0T5I2QssCevOhTU,1242
|
|
67
67
|
oldaplib/src/permissionset.py,sha256=bzzVuZ7O_yVMujziwo32GEJIZYGG3g5gTds4HjLmGtU,31874
|
|
68
68
|
oldaplib/src/project.py,sha256=DNwViRg19zkE1F0zuWqQFK008uTVehVAu7xNbyessig,34207
|
|
69
|
-
oldaplib/src/propertyclass.py,sha256=
|
|
69
|
+
oldaplib/src/propertyclass.py,sha256=jXB5Y4Fq9RcSpsW_v7dHxd0BjdFqFWVT9A67k-dnoaw,97330
|
|
70
70
|
oldaplib/src/resourceclass.py,sha256=I6m93JhfCh4XAUFgmb6v0fD798DfU7-ImTKrUJk4g-o,102098
|
|
71
71
|
oldaplib/src/user.py,sha256=Z4GXPRkaHXx3glUpPXQdFqYMxQPOuqayDwkTAE5RGjU,48820
|
|
72
72
|
oldaplib/src/userdataclass.py,sha256=FbZkcRt0pKbOeqsZ7HbpwoKE-XPWH2AqpHG1GcsrBPo,12364
|
|
73
|
-
oldaplib/src/version.py,sha256=
|
|
73
|
+
oldaplib/src/version.py,sha256=KDtsjv7ghvIAiAm_GoJi8tU56ilDnt7P4gEvxUpAlwc,22
|
|
74
74
|
oldaplib/src/xsd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
75
75
|
oldaplib/src/xsd/floatingpoint.py,sha256=rDReKqh0mXyc4F5wslgTUxbeGf3-PGERyughj5_62YI,8852
|
|
76
76
|
oldaplib/src/xsd/iri.py,sha256=w1Dr0z-REi7yPe3GPGnyzGrLVMvLY03kEeK-AmZ9sxw,8383
|
|
@@ -134,7 +134,7 @@ oldaplib/test/test_oldaplist_helpers.py,sha256=vJkA_Txhdk4oIwo2YK566yOte2Z6MQksh
|
|
|
134
134
|
oldaplib/test/test_oldaplistnode.py,sha256=bWoCmDmHvOnNNviSCvhWo7LA2CskA_5IRDxNUufTKj4,149434
|
|
135
135
|
oldaplib/test/test_permissionset.py,sha256=YOCirqm_oFE1Emz9fYsnDeawwI6zHN9xBv9vOZnKst0,23368
|
|
136
136
|
oldaplib/test/test_project.py,sha256=fwkfaCxEskd27xinxDDr74dMWs7S0YcGr84mUOw20x4,25290
|
|
137
|
-
oldaplib/test/test_propertyclass.py,sha256=
|
|
137
|
+
oldaplib/test/test_propertyclass.py,sha256=1C2urIKlZV1FwGlsmJMLcrHk1aSeb9dclydzhYlbNqw,61857
|
|
138
138
|
oldaplib/test/test_resourceclass.py,sha256=WQGyns2S8O6vDH8oXBQjcww_VcjIONovuNdKm0coO-c,96621
|
|
139
139
|
oldaplib/test/test_semantic_version.py,sha256=OSJYHWDpKBqk-HsxJ2nFpSr14a4OEZTFCogzEni8mcE,3392
|
|
140
140
|
oldaplib/test/test_user.py,sha256=gLTcQ0ymi9pYPPpq9BOY_3YS07EJXtnJKFCHe4Rj0mQ,72133
|
|
@@ -158,6 +158,6 @@ oldaplib/testdata/source_type.yaml,sha256=dSihKikw3O-IlGf6anj5KWMoBYLaweLVF1Zojm
|
|
|
158
158
|
oldaplib/testdata/test_move_left_of_toL.yaml,sha256=2m1OSQrQFlsCQxeJrjzBAO74LMprNDo_HuyrYGsOeXI,787
|
|
159
159
|
oldaplib/testdata/testlist.yaml,sha256=AT11nXEG81Sfyb-tr1gQV0H_dZBrOCcFuHf7YtL8P2g,1994
|
|
160
160
|
oldaplib/testit.http,sha256=qW7mnr6aNLXFG6lQdLgyhXILOPN6qc5iFVZclLyVvkY,303
|
|
161
|
-
oldaplib-0.3.
|
|
162
|
-
oldaplib-0.3.
|
|
163
|
-
oldaplib-0.3.
|
|
161
|
+
oldaplib-0.3.18.dist-info/METADATA,sha256=9IYrZnU_x0pbUEcYRWe0qKpthP8GRekOEHWAxX9SxsI,3061
|
|
162
|
+
oldaplib-0.3.18.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
163
|
+
oldaplib-0.3.18.dist-info/RECORD,,
|
|
File without changes
|