oldaplib 0.3.20__py3-none-any.whl → 0.3.22__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.
@@ -1,12 +1,14 @@
1
1
  @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
2
2
  @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
3
3
  @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
4
+ @prefix owl: <http://www.w3.org/2002/07/owl#> .
4
5
  @prefix schema: <http://schema.org/> .
5
6
  @prefix dcterms: <http://purl.org/dc/terms/> .
6
7
  @prefix oldap: <http://oldap.org/base#> .
7
8
  @prefix : <http://oldap.org/base#> .
8
9
 
9
10
  @prefix hyha: <http://hyperhamlet.unibas.ch/> .
11
+ @prefix britnet: <http://www.salsah.org/version/2.0/SwissBritNet#> .
10
12
 
11
13
  :admin {
12
14
 
@@ -95,3 +97,22 @@
95
97
  <<<https://orcid.org/0000-0002-7403-9595> :inProject <http://www.salsah.org/version/2.0/SwissBritNet>>> :hasAdminPermission :ADMIN_RESOURCES .
96
98
 
97
99
  }
100
+
101
+ hyha:shacl {
102
+ hyha:shapes schema:version "0.1.0"^^xsd:string .
103
+ }
104
+
105
+ hyha:onto {
106
+ hyha:ontology rdf:type owl:Ontology ;
107
+ owl:versionInfo "0.1.0"^^xsd:string .
108
+ }
109
+
110
+ britnet:shacl {
111
+ britnet:shapes schema:version "0.1.0"^^xsd:string .
112
+ }
113
+
114
+ britnet:onto {
115
+ britnet:ontology rdf:type owl:Ontology ;
116
+ owl:versionInfo "0.1.0"^^xsd:string .
117
+ }
118
+
@@ -191,5 +191,4 @@
191
191
  :inProject :HyperHamlet ;
192
192
  :hasPermissions :GenericView ;
193
193
  :isActive false .
194
-
195
194
  }
@@ -14,6 +14,20 @@
14
14
  shared:shacl {
15
15
  shared:shapes schema:version "0.1.0"^^xsd:string .
16
16
 
17
+ ###########################################################################
18
+ # Shared properties
19
+ ###########################################################################
20
+ :commentStringShape a sh:PropertyShape ;
21
+ sh:path :commentString ;
22
+ oldap:statementProperty true ;
23
+ dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
24
+ dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
25
+ dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
26
+ dcterms:modified "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
27
+ sh:name "Simple comment"@en ;
28
+ sh:description "A simple comment as a string"@en ;
29
+ sh:datatype xsd:string .
30
+
17
31
  ###########################################################################
18
32
  # Chronology Date definitions
19
33
  ###########################################################################
@@ -176,7 +190,18 @@ shared:onto {
176
190
  owl:versionInfo "0.1.0"^^xsd:string .
177
191
 
178
192
  ###############################################################################
179
- # Properties used for :Project
193
+ # Generic comment property
194
+ ###############################################################################
195
+
196
+ :commentString rdf:type rdf:Property, owl:DatatypeProperty ;
197
+ dcterms:creator <https://orcid.org/0000-0003-1681-4036> ;
198
+ dcterms:created "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
199
+ dcterms:contributor <https://orcid.org/0000-0003-1681-4036> ;
200
+ dcterms:modified "2023-11-04T12:00:00+00:00"^^xsd:dateTime ;
201
+ rdfs:range xsd:string .
202
+
203
+ ###############################################################################
204
+ # Properties used for :ChronologyObject
180
205
  ###############################################################################
181
206
 
182
207
  oldap:startJDC rdf:type owl:DatatypeProperty ;
@@ -358,6 +383,5 @@ shared:onto {
358
383
  owl:onDataRange xsd:string ;
359
384
  ] .
360
385
 
361
-
362
386
  }
363
387
 
oldaplib/src/datamodel.py CHANGED
@@ -474,14 +474,14 @@ class DataModel(Model):
474
474
  #
475
475
  query = cls.__context.sparql_context
476
476
  query += f"""
477
- SELECT ?prop ?graph
477
+ SELECT ?prop
478
478
  WHERE {{
479
- GRAPH ?graph {{
480
- ?prop a sh:PropertyShape
481
- }}
482
- FILTER (?graph = {cls.__graph}:shacl || ?graph = shared:shacl)
479
+ GRAPH {cls.__graph}:shacl {{
480
+ ?prop a sh:PropertyShape
481
+ }}
483
482
  }}
484
483
  """
484
+
485
485
  jsonobj = con.query(query)
486
486
  res = QueryProcessor(context=cls.__context, query_result=jsonobj)
487
487
  #
@@ -489,7 +489,7 @@ class DataModel(Model):
489
489
  #
490
490
  propclasses: list[PropertyClass] = []
491
491
  for r in res:
492
- projectid = r['graph'].prefix
492
+ projectid = cls.__graph
493
493
  propnameshacl = str(r['prop'])
494
494
  propclassiri = propnameshacl.removesuffix("Shape")
495
495
  propclass = PropertyClass.read(con, projectid, Xsd_QName(propclassiri, validate=False), ignore_cache=ignore_cache)
@@ -521,13 +521,10 @@ class DataModel(Model):
521
521
  # create empty data model -> update -> add resource without property -> add property -> update
522
522
  # _prop_changeset is not empoty after update... ERROR!!!!!!!!!!!!!!!!!!!!!
523
523
  try:
524
- if resclassiri == 'test:Book':
525
- pass
526
524
  resclass = ResourceClass.read(con, project, Xsd_QName(resclassiri, validate=False), sa_props=sa_props, ignore_cache=ignore_cache)
525
+ resclasses.append(resclass)
527
526
  except OldapError as er:
528
527
  print(f'Error reading resource class {resclassiri}: {er}')
529
-
530
- resclasses.append(resclass)
531
528
  instance = cls(project=project, con=con, propclasses=propclasses, resclasses=resclasses, extontos=extontos)
532
529
  for qname in instance.get_extontos():
533
530
  instance[qname].set_notifier(instance.notifier, qname)
@@ -200,7 +200,7 @@ class PropertyClass(Model, Notify):
200
200
  _externalOntology: bool | Xsd_boolean = False,
201
201
  _internal: Xsd_QName | None = None, # DO NOT USE!! Only for serialization!
202
202
  _force_external: bool | None = None, # DO NOT USE!! Only for serialization!
203
- _from_triplestore: bool = False,
203
+ _from_triplestore: bool = False, # DO NOT USE!! Only for serialization!
204
204
  validate: bool = False,
205
205
  **kwargs):
206
206
  """
@@ -255,7 +255,6 @@ class PropertyClass(Model, Notify):
255
255
  validate=validate)
256
256
  Notify.__init__(self, notifier, notify_data)
257
257
 
258
- #self.__statementProperty = _statementProperty if isinstance(_statementProperty, Xsd_boolean) else Xsd_boolean(_statementProperty, validate=True)
259
258
  self._externalOntology = _externalOntology if isinstance(_externalOntology, Xsd_boolean) else Xsd_boolean(_externalOntology, validate=True)
260
259
  if self._externalOntology:
261
260
  self._force_external = True
@@ -382,7 +381,7 @@ class PropertyClass(Model, Notify):
382
381
  **({'_internal': self._internal} if self._internal else {}),
383
382
  **({'_force_external': self._force_external} if self._force_external else {}),
384
383
  **({'_externalOntology': self._externalOntology} if self._externalOntology else {}),
385
- **({'__statementProperty': self.__statementProperty} if self.__statementProperty else {}),
384
+ #**({'__statementProperty': self.__statementProperty} if self.__statementProperty else {}),
386
385
  '_from_triplestore': self.__from_triplestore,
387
386
  }
388
387
 
oldaplib/src/version.py CHANGED
@@ -1 +1 @@
1
- __version__ = "0.3.20"
1
+ __version__ = "0.3.22"
@@ -373,7 +373,7 @@ class TestDataModel(unittest.TestCase):
373
373
  self.assertEqual(set(model.get_propclasses()), {
374
374
  Xsd_QName("oldap:hasAdminPermission"),
375
375
  Xsd_QName("oldap:statementProperty"),
376
- Xsd_QName("oldap:namespaceIri")
376
+ Xsd_QName("oldap:namespaceIri"),
377
377
  })
378
378
  self.assertEqual(set(model.get_resclasses()), {
379
379
  Xsd_QName("oldap:Project"),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: oldaplib
3
- Version: 0.3.20
3
+ Version: 0.3.22
4
4
  Summary: Open Media Access Server Library (Linked Open Data middleware/RESTApi)
5
5
  License: GNU Affero General Public License version 3
6
6
  Author: Lukas Rosenthaler
@@ -1,16 +1,16 @@
1
1
  oldaplib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  oldaplib/apps/load_list.py,sha256=Dr0oLPUMoJkAD55_flAt6y8hjx_ci7uuOQzYBUOr8Sc,1840
3
- oldaplib/ontologies/admin-testing.trig,sha256=OpVt8QUXphWGtDflaUxqp5QUJ65VxujuXXHC_BlBe7U,5206
4
- oldaplib/ontologies/admin.trig,sha256=S53TALvsBvbkV_Put4bUlwk8ZcD-Fj-K6LlsKkiuB98,8964
3
+ oldaplib/ontologies/admin-testing.trig,sha256=O1_WateUvdouG0zEdnNG0BWkIIMdoTGaTqb1wAD8njs,5694
4
+ oldaplib/ontologies/admin.trig,sha256=ByxFYdI9rh-RhLnSpkdZHMMWgXCSTi2YMJc1QgBHFhE,8963
5
5
  oldaplib/ontologies/example.trig,sha256=MdRrFBZZ1L6aUDiT6aX4cnXiy-RoZHczF3Exn7aBSmU,1518
6
6
  oldaplib/ontologies/oldap.trig,sha256=i2XanqKlhWSIdD17fLu5g0Luq2GORQCcyIfLn9Kummk,60241
7
7
  oldaplib/ontologies/oldap.ttl,sha256=qdA0uiSjzVhkc1d5IN2y5ioK1QMzwl-TTnn3M_D1Kh8,29446
8
- oldaplib/ontologies/shared.trig,sha256=BPocpJFbHIEq1XEd1P3yjMg7q-vSYyIVDCa97RILuMI,18045
8
+ oldaplib/ontologies/shared.trig,sha256=p9UE8mT8Ye8JKyZpfjH65VDJM8ho5jGXkX-jA5IS9sI,19329
9
9
  oldaplib/ontologies/standard/.gitsave,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  oldaplib/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
11
  oldaplib/src/cachesingleton.py,sha256=WGhuFER-mTnOJmwaN17fXPAg7zn7GJBm-XadShNUBBk,3687
12
12
  oldaplib/src/connection.py,sha256=LJMJO65QhSbheIEBnOCphRyAD1STwkO8zfNcYPcKwP8,29016
13
- oldaplib/src/datamodel.py,sha256=HXur6vCFW4WGsQ8sKxVK0uz2I742_8xm1nVDJ8JNviY,35147
13
+ oldaplib/src/datamodel.py,sha256=GJiWSvfH6VYos4mpxOxj2eoMM1kTNZkhf2ITWGM86Cc,35016
14
14
  oldaplib/src/dtypes/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
15
  oldaplib/src/dtypes/bnode.py,sha256=7Swl77PJlzahov7d7ijJExmoVsTkR5JFOvFQf1jDmEg,1555
16
16
  oldaplib/src/dtypes/languagein.py,sha256=6h3VrTH8IcTN6mvnWuGvzDoKX_Jh6h9w3wWrLuAWfVc,8593
@@ -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=y82BQDTGKzLGJSENNBb3LD8BTZmSdGRoYNEeUlV4628,97326
69
+ oldaplib/src/propertyclass.py,sha256=OuzCSCRp8Qfz-PolmoH7FARfTEvWJd42ghLgvPsgT78,97213
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=uAkobnetgdGdqCULNC7XUYGJPjMNHvADSXk8oSo_jpY,22
73
+ oldaplib/src/version.py,sha256=4taJJaGNydi5cJmoZOKzj0v5QfTSj0KJZiAHh1J83MQ,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
@@ -119,7 +119,7 @@ oldaplib/test/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
119
119
  oldaplib/test/test_cache.py,sha256=6TGukPUruuj5BsZaPGZdIx9L7v39qB9jIKZkg_GkbW4,702
120
120
  oldaplib/test/test_connection.py,sha256=y_t0v9jbo1BFsDlAjei2ckG0iVnLNc4ShlIRxe8GMvg,13386
121
121
  oldaplib/test/test_context.py,sha256=atESRnIStobqkydjpVnmpHrcmf6QD9rgEwAZCsHlnXI,4757
122
- oldaplib/test/test_datamodel.py,sha256=4s9ijonHaMLbL32Rz6JBflyxxG0TizPNbOpFLhp5FGg,59024
122
+ oldaplib/test/test_datamodel.py,sha256=mzDMN3X_o6_iLdBJANre41nRlj_C4bq61HKFZuvfk3w,59025
123
123
  oldaplib/test/test_dtypes.py,sha256=ifXWUc6ExAKGukyM1ziku7Xd9eehg4J7HZy9B63-aPo,8601
124
124
  oldaplib/test/test_externalontologies.py,sha256=eExlaKUTsbm1dou_By4_T_qL0iuH5L96v3sjpTYYLWQ,7844
125
125
  oldaplib/test/test_hasproperty.py,sha256=r991g8kBTfv1CGs9Hf0fli-AUp7Ob7rOHWYD74h4fjM,11572
@@ -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.20.dist-info/METADATA,sha256=E6OjLAX0Alyi2IVi0EAr2_ODmkKoh9IaxWL9AMO8gwU,3010
162
- oldaplib-0.3.20.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
163
- oldaplib-0.3.20.dist-info/RECORD,,
161
+ oldaplib-0.3.22.dist-info/METADATA,sha256=5hrFKoin1P63-sfNf5-kDGfQc1sSSYBhhosn0INEUIU,3010
162
+ oldaplib-0.3.22.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
163
+ oldaplib-0.3.22.dist-info/RECORD,,