cognite-neat 0.117.10__py3-none-any.whl → 0.117.12__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.
@@ -272,7 +272,7 @@ class OWLClass(OntologyModel):
272
272
 
273
273
  return cls(
274
274
  id_=namespace[str(definition.class_.suffix)],
275
- label=definition.name or str(definition.class_.suffix),
275
+ label=definition.name if definition.name else None,
276
276
  comment=definition.description,
277
277
  sub_class_of=sub_class_of,
278
278
  namespace=namespace,
@@ -289,6 +289,19 @@ class OWLClass(OntologyModel):
289
289
  else: # If comment is None, return empty list
290
290
  return []
291
291
 
292
+ @property
293
+ def title_triples(self) -> list[tuple]:
294
+ if self.label:
295
+ return [
296
+ (
297
+ self.id_,
298
+ DCTERMS.title,
299
+ Literal(f"{remove_namespace_from_uri(self.id_)} - {self.label}"),
300
+ )
301
+ ]
302
+ else:
303
+ return []
304
+
292
305
  @property
293
306
  def comment_triples(self) -> list[tuple]:
294
307
  if self.comment:
@@ -305,7 +318,9 @@ class OWLClass(OntologyModel):
305
318
 
306
319
  @property
307
320
  def triples(self) -> list[tuple]:
308
- return self.type_triples + self.label_triples + self.comment_triples + self.subclass_triples
321
+ return (
322
+ self.type_triples + self.label_triples + self.title_triples + self.comment_triples + self.subclass_triples
323
+ )
309
324
 
310
325
 
311
326
  class OWLProperty(OntologyModel):
@@ -348,7 +363,8 @@ class OWLProperty(OntologyModel):
348
363
  else:
349
364
  raise ValueError(f"Value type {definition.value_type.type_} is not supported")
350
365
  owl_property.domain.add(namespace[str(definition.class_.suffix)])
351
- owl_property.label.add(definition.name or definition.property_)
366
+ if definition.name:
367
+ owl_property.label.add(definition.name)
352
368
  if definition.description:
353
369
  owl_property.comment.add(definition.description)
354
370
 
@@ -477,8 +493,23 @@ class OWLProperty(OntologyModel):
477
493
 
478
494
  @property
479
495
  def label_triples(self) -> list[tuple]:
480
- label = list(filter(None, self.label))
481
- return [(self.id_, RDFS.label, Literal(label[0] if label else self.id_))]
496
+ if label := list(filter(None, self.label)):
497
+ return [(self.id_, RDFS.label, Literal(label[0]))]
498
+ else:
499
+ return []
500
+
501
+ @property
502
+ def title_triples(self) -> list[tuple]:
503
+ if label := list(filter(None, self.label)):
504
+ return [
505
+ (
506
+ self.id_,
507
+ DCTERMS.title,
508
+ Literal(f"{remove_namespace_from_uri(self.id_)} - {label[0]}"),
509
+ )
510
+ ]
511
+ else:
512
+ return []
482
513
 
483
514
  @property
484
515
  def comment_triples(self) -> list[tuple]:
@@ -486,7 +517,14 @@ class OWLProperty(OntologyModel):
486
517
 
487
518
  @property
488
519
  def triples(self) -> list[tuple]:
489
- return self.type_triples + self.label_triples + self.comment_triples + self.domain_triples + self.range_triples
520
+ return (
521
+ self.type_triples
522
+ + self.label_triples
523
+ + self.title_triples
524
+ + self.comment_triples
525
+ + self.domain_triples
526
+ + self.range_triples
527
+ )
490
528
 
491
529
 
492
530
  SHACL = Namespace("http://www.w3.org/ns/shacl#")
@@ -1728,6 +1728,7 @@ class _DMSRulesConverter:
1728
1728
  # we do not want a version in class as we use URI for the class
1729
1729
  class_=ClassEntity(prefix=view.view.prefix, suffix=view.view.suffix),
1730
1730
  description=view.description,
1731
+ name=view.name,
1731
1732
  implements=[
1732
1733
  # we do not want a version in class as we use URI for the class
1733
1734
  implemented_view.as_class(skip_version=True)
@@ -1766,6 +1767,7 @@ class _DMSRulesConverter:
1766
1767
  # Removing version
1767
1768
  class_=ClassEntity(suffix=property_.view.suffix, prefix=property_.view.prefix),
1768
1769
  property_=property_.view_property,
1770
+ name=property_.name,
1769
1771
  value_type=value_type,
1770
1772
  description=property_.description,
1771
1773
  min_count=property_.min_count,
@@ -17,7 +17,7 @@ class ConfigAPI(Protocol):
17
17
 
18
18
 
19
19
  class NeatEngine(Protocol):
20
- version: str = "2.0.0"
20
+ version: str = "2.0.5"
21
21
 
22
22
  @property
23
23
  def set(self) -> ConfigAPI: ...
@@ -157,7 +157,7 @@ class NeatGraphStore:
157
157
  return cls(
158
158
  dataset=Dataset(
159
159
  store=SPARQLUpdateStore(
160
- query_endpoint=f"{remote_url}/query", update_endpoint=f"{remote_url}/query", autocommit=autocommit
160
+ query_endpoint=f"{remote_url}/query", update_endpoint=f"{remote_url}/update", autocommit=autocommit
161
161
  ),
162
162
  default_union=True,
163
163
  )
cognite/neat/_version.py CHANGED
@@ -1,2 +1,2 @@
1
- __version__ = "0.117.10"
1
+ __version__ = "0.117.12"
2
2
  __engine__ = "^2.0.4"
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: cognite-neat
3
- Version: 0.117.10
3
+ Version: 0.117.12
4
4
  Summary: Knowledge graph transformation
5
5
  License: Apache-2.0
6
6
  Author: Nikola Vasiljevic
7
7
  Author-email: nikola.vasiljevic@cognite.com
8
- Requires-Python: >=3.10,<4.0
8
+ Requires-Python: >=3.10
9
9
  Classifier: License :: OSI Approved :: Apache Software License
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.10
@@ -52,9 +52,10 @@ Requires-Dist: rich[jupyter] (>=13.7.1,<14.0.0)
52
52
  Requires-Dist: tomli (>=2.0.1,<3.0.0) ; python_version < "3.11"
53
53
  Requires-Dist: typing_extensions (>=4.8,<5.0) ; python_version < "3.11"
54
54
  Requires-Dist: urllib3 (>=2,<3)
55
+ Project-URL: Changelog, https://github.com/cognitedata/neat/releases
55
56
  Project-URL: Documentation, https://cognite-neat.readthedocs-hosted.com/
57
+ Project-URL: GitHub, https://github.com/cognitedata/neat
56
58
  Project-URL: Homepage, https://cognite-neat.readthedocs-hosted.com/
57
- Project-URL: Repository, https://github.com/cognitedata/neat
58
59
  Description-Content-Type: text/markdown
59
60
 
60
61
  # kNowlEdge grAph Transformer (NEAT)
@@ -87,7 +87,7 @@ cognite/neat/_rules/exporters/_base.py,sha256=VkNMy8wsH-x4tAjS44cXgzzNH0CM2k_4Rh
87
87
  cognite/neat/_rules/exporters/_rules2dms.py,sha256=ddlRbEgKBDLiO-DBM4A5fGpiF5nDgVpzdT3YGchAHNM,19625
88
88
  cognite/neat/_rules/exporters/_rules2excel.py,sha256=rCxEyiCu9QQ05GPFVT0MQwTZaZNh5hXpGLUeMeZcYlg,18754
89
89
  cognite/neat/_rules/exporters/_rules2instance_template.py,sha256=6hvuqb5cdO5IqbFKPaoZxIF-fG9gxo0c0pLWLJmKioA,5989
90
- cognite/neat/_rules/exporters/_rules2ontology.py,sha256=C7t01qIdP85GAwQXRt_41TPlapv2lrLpNSiJpL8dOl8,22170
90
+ cognite/neat/_rules/exporters/_rules2ontology.py,sha256=4Z8Qf8H3Ksz0xAtyj5A3oyIKFJNljfMKKqYLxtiQfKs,23057
91
91
  cognite/neat/_rules/exporters/_rules2yaml.py,sha256=ggaPR8FO8PwZk1_nhwb5wVHk_C4s6qh1RrlbPkNcbBo,3160
92
92
  cognite/neat/_rules/exporters/_validation.py,sha256=DVJGdNNU2WtAFgUg0h4SWVhveRErEPOcYdT65y5toV0,682
93
93
  cognite/neat/_rules/importers/__init__.py,sha256=KiTNglSK6OVCdvPiGmO2dTKEGQJWT5Yxa6XWqm7YClQ,1408
@@ -132,7 +132,7 @@ cognite/neat/_rules/models/mapping/_classic2core.py,sha256=AhLWoXk4PlBVA6SgBtY9d
132
132
  cognite/neat/_rules/models/mapping/_classic2core.yaml,sha256=ei-nuivNWVW9HmvzDBKIPF6ZdgaMq64XHw_rKm0CMxg,22584
133
133
  cognite/neat/_rules/transformers/__init__.py,sha256=vp6OQnRUGdIrPVDOsY_tM2KBzis-IldaoVkAQEFgvVM,1563
134
134
  cognite/neat/_rules/transformers/_base.py,sha256=9LnjKbYIf9238PQXedkTZsMXAyEND6glUD187iEaHfc,2783
135
- cognite/neat/_rules/transformers/_converters.py,sha256=d7EPv9H_zFpCw9CS_qODDE3ZexQweCJG5HpG6BcasW4,89316
135
+ cognite/neat/_rules/transformers/_converters.py,sha256=cCMvSrk6LPMyA3k9-4j0qCNi9FdsWRhSifKnr8j4UmQ,89385
136
136
  cognite/neat/_rules/transformers/_mapping.py,sha256=QVd96vMF9sGailN5hB22KGdmOU8GzFwZ7IPMD0aVCYY,18237
137
137
  cognite/neat/_rules/transformers/_verification.py,sha256=coZjoLqdfS8yrPP62T_xEKrDZc9ETbPWrLuwEVBSLZQ,4370
138
138
  cognite/neat/_session/__init__.py,sha256=fxQ5URVlUnmEGYyB8Baw7IDq-uYacqkigbc4b-Pr9Fw,58
@@ -154,12 +154,12 @@ cognite/neat/_session/_to.py,sha256=S7209afgOlLWbsKOA0Z4lAwT57gzLmSDaUWpUaWjJJY,
154
154
  cognite/neat/_session/_wizard.py,sha256=9idlzhZy54h2Iwupe9iXKX3RDb5jJQuBZFEouni50L0,1476
155
155
  cognite/neat/_session/engine/__init__.py,sha256=D3MxUorEs6-NtgoICqtZ8PISQrjrr4dvca6n48bu_bI,120
156
156
  cognite/neat/_session/engine/_import.py,sha256=1QxA2_EK613lXYAHKQbZyw2yjo5P9XuiX4Z6_6-WMNQ,169
157
- cognite/neat/_session/engine/_interface.py,sha256=ItJ1VMrPt-pKKvpSpglD9n9yFC6ehF9xV2DUVCyfQB0,533
157
+ cognite/neat/_session/engine/_interface.py,sha256=3W-cYr493c_mW3P5O6MKN1xEQg3cA7NHR_ev3zdF9Vk,533
158
158
  cognite/neat/_session/engine/_load.py,sha256=LcoYVthQyCzLWKzRE_75_nElS-n_eMWSPAgNJBnh5dA,5193
159
159
  cognite/neat/_session/exceptions.py,sha256=kRNKnhvOEPnF8TdcKP-lWbHvAwn-MOtGxKZdUpnJ_Q8,3239
160
160
  cognite/neat/_shared.py,sha256=Ov59SWYboRRsncB_5V1ZC_BAoACfNLjo80vqE5Ru6wo,2325
161
161
  cognite/neat/_store/__init__.py,sha256=RrvuZrMdezqun5dOrwHWSk26kampZcvqiHBqSFumkEE,130
162
- cognite/neat/_store/_graph_store.py,sha256=mWWax09ZTOUbFOpX8Gxq9yTOyduEebMvVddQ0-FvDwc,17141
162
+ cognite/neat/_store/_graph_store.py,sha256=ruIn1mSnJoj597M-ZgXDH2bzy3uF11NLomel0OkuR4Q,17142
163
163
  cognite/neat/_store/_provenance.py,sha256=V2rBK3L4wneoiTBvir3AbmrcPsl6XVmefovkkjHYhNE,7301
164
164
  cognite/neat/_store/_rules_store.py,sha256=dh2GfDRRtQ2F00I5hdqYveULQKx2_kt630Mac_ZFF2k,18562
165
165
  cognite/neat/_store/exceptions.py,sha256=XznWE3X8iBpnTKcC2SpInwesQVpfinGBzQT6xX9GANg,1614
@@ -177,10 +177,10 @@ cognite/neat/_utils/text.py,sha256=qy7lgMdRjzxSYkL8teAnWsq6T5baS_QcezHLK007_7M,7
177
177
  cognite/neat/_utils/time_.py,sha256=7ayUm0OWZm1JDmy32E4ip8WRr2o0GLwrHwJA8sJ43Z4,357
178
178
  cognite/neat/_utils/upload.py,sha256=xWtM6mFuD2QYQHaZ7zCAuGptbEpPIxcH-raWQu93-Ug,5845
179
179
  cognite/neat/_utils/xml_.py,sha256=FQkq84u35MUsnKcL6nTMJ9ajtG9D5i1u4VBnhGqP2DQ,1710
180
- cognite/neat/_version.py,sha256=5zWfgiXewAsXGaDaOZXvCifFrtC_4gmggpTf0imvMUw,47
180
+ cognite/neat/_version.py,sha256=UiPaIrCQ2Dtlfchy7Yn9lrRzE0x1d8c6iWHSSVJ1chY,47
181
181
  cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
182
- cognite_neat-0.117.10.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
183
- cognite_neat-0.117.10.dist-info/METADATA,sha256=QyKyWeL6QHakal4Cs16YhZ3rwu8eG__54geUBj0nSD0,5362
184
- cognite_neat-0.117.10.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
185
- cognite_neat-0.117.10.dist-info/entry_points.txt,sha256=SsQlnl8SNMSSjE3acBI835JYFtsIinLSbVmHmMEXv6E,51
186
- cognite_neat-0.117.10.dist-info/RECORD,,
182
+ cognite_neat-0.117.12.dist-info/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
183
+ cognite_neat-0.117.12.dist-info/METADATA,sha256=CrA6mTX8srnTM6XDzWoLx632BTbkkucd4lIpQ2IvNWg,5422
184
+ cognite_neat-0.117.12.dist-info/WHEEL,sha256=fGIA9gx4Qxk2KDKeNJCbOEwSrmLtjWCwzBz351GyrPQ,88
185
+ cognite_neat-0.117.12.dist-info/entry_points.txt,sha256=SsQlnl8SNMSSjE3acBI835JYFtsIinLSbVmHmMEXv6E,51
186
+ cognite_neat-0.117.12.dist-info/RECORD,,
@@ -1,4 +1,4 @@
1
1
  Wheel-Version: 1.0
2
- Generator: poetry-core 2.1.1
2
+ Generator: poetry-core 2.1.2
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any