cognite-neat 0.127.24__py3-none-any.whl → 0.127.25__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.
- cognite/neat/_version.py +1 -1
- cognite/neat/v0/core/_data_model/importers/_rdf/_owl2data_model.py +39 -19
- {cognite_neat-0.127.24.dist-info → cognite_neat-0.127.25.dist-info}/METADATA +1 -1
- {cognite_neat-0.127.24.dist-info → cognite_neat-0.127.25.dist-info}/RECORD +6 -6
- {cognite_neat-0.127.24.dist-info → cognite_neat-0.127.25.dist-info}/WHEEL +0 -0
- {cognite_neat-0.127.24.dist-info → cognite_neat-0.127.25.dist-info}/licenses/LICENSE +0 -0
cognite/neat/_version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
__version__ = "0.127.
|
|
1
|
+
__version__ = "0.127.25"
|
|
2
2
|
__engine__ = "^2.0.4"
|
|
@@ -27,33 +27,53 @@ CLASSES_QUERY = """SELECT ?concept ?name ?description ?implements
|
|
|
27
27
|
|
|
28
28
|
CLASSES_QUERY_PARAMETERS = {"concept", "name", "description", "implements"}
|
|
29
29
|
|
|
30
|
-
PROPERTIES_QUERY = """
|
|
31
|
-
|
|
32
|
-
SELECT ?concept ?property_ ?name ?description ?value_type ?minCount ?maxCount ?default
|
|
30
|
+
PROPERTIES_QUERY = """ SELECT ?concept ?property_ ?name ?description ?value_type ?min_count ?max_count ?default
|
|
33
31
|
WHERE {{
|
|
34
32
|
?property_ a ?property_Type.
|
|
35
33
|
FILTER (?property_Type IN (owl:ObjectProperty, owl:DatatypeProperty ) )
|
|
36
34
|
|
|
35
|
+
# --- 1. Explicit Domain Discovery ---
|
|
37
36
|
|
|
37
|
+
# A. Handling owl:domain when it is expressed as owl restriction
|
|
38
|
+
OPTIONAL {{
|
|
39
|
+
?property_ rdfs:domain ?domain_exp_node .
|
|
40
|
+
FILTER(isBlank(?domain_exp_node))
|
|
41
|
+
?domain_exp_node owl:unionOf|owl:intersectionOf ?exp_concepts_list .
|
|
42
|
+
?exp_concepts_list rdf:rest*/rdf:first ?explicit_concept.
|
|
43
|
+
}}
|
|
38
44
|
|
|
39
|
-
# Handling
|
|
40
|
-
# owl restriction
|
|
45
|
+
# B. Handling the domain when it is a single concept
|
|
41
46
|
OPTIONAL {{
|
|
42
|
-
?property_ rdfs:domain ?
|
|
43
|
-
FILTER(isBlank(?
|
|
44
|
-
?
|
|
45
|
-
?concepts rdf:rest*/rdf:first ?concept.
|
|
47
|
+
?property_ rdfs:domain ?domain_exp_node .
|
|
48
|
+
FILTER(!isBlank(?domain_exp_node))
|
|
49
|
+
BIND(?domain_exp_node AS ?explicit_concept)
|
|
46
50
|
}}
|
|
47
51
|
|
|
48
|
-
#
|
|
52
|
+
# --- 2. Inherited Domain Discovery (Fallback) ---
|
|
53
|
+
|
|
54
|
+
# C. Handling inherited domain when parent domain is a restriction
|
|
49
55
|
OPTIONAL {{
|
|
50
|
-
?property_ rdfs:
|
|
51
|
-
|
|
52
|
-
|
|
56
|
+
?property_ rdfs:subPropertyOf ?parent_property .
|
|
57
|
+
?parent_property rdfs:domain ?parent_domain_node .
|
|
58
|
+
FILTER(isBlank(?parent_domain_node))
|
|
59
|
+
?parent_domain_node owl:unionOf|owl:intersectionOf ?parent_concepts_list .
|
|
60
|
+
?parent_concepts_list rdf:rest*/rdf:first ?inherited_concept.
|
|
53
61
|
}}
|
|
54
62
|
|
|
55
|
-
# Handling
|
|
56
|
-
|
|
63
|
+
# D. Handling inherited domain when parent domain is a single concept
|
|
64
|
+
OPTIONAL {{
|
|
65
|
+
?property_ rdfs:subPropertyOf ?parent_property .
|
|
66
|
+
?parent_property rdfs:domain ?parent_domain_node .
|
|
67
|
+
FILTER(!isBlank(?parent_domain_node))
|
|
68
|
+
BIND(?parent_domain_node AS ?inherited_concept)
|
|
69
|
+
}}
|
|
70
|
+
|
|
71
|
+
# Final Concept Assignment with Priority ---
|
|
72
|
+
# COALESCE prioritizes ?explicit_concept over ?inherited_concept
|
|
73
|
+
BIND(COALESCE(?explicit_concept, ?inherited_concept) AS ?concept)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
# Handling owl:range when it is expressed as owl restriction
|
|
57
77
|
OPTIONAL {{
|
|
58
78
|
?property_ rdfs:range ?range .
|
|
59
79
|
FILTER(isBlank(?range))
|
|
@@ -70,8 +90,8 @@ PROPERTIES_QUERY = """
|
|
|
70
90
|
|
|
71
91
|
OPTIONAL {{?property_ rdfs:label|skos:prefLabel ?name }}.
|
|
72
92
|
OPTIONAL {{?property_ rdfs:comment|skos:definition ?description}}.
|
|
73
|
-
OPTIONAL {{?property_ owl:maxCardinality ?
|
|
74
|
-
OPTIONAL {{?property_ owl:minCardinality ?
|
|
93
|
+
OPTIONAL {{?property_ owl:maxCardinality ?max_count}}.
|
|
94
|
+
OPTIONAL {{?property_ owl:minCardinality ?min_count}}.
|
|
75
95
|
|
|
76
96
|
# FILTERS
|
|
77
97
|
FILTER (!isBlank(?property_))
|
|
@@ -85,8 +105,8 @@ PROPERTIES_QUERY_PARAMETERS = {
|
|
|
85
105
|
"name",
|
|
86
106
|
"description",
|
|
87
107
|
"value_type",
|
|
88
|
-
"
|
|
89
|
-
"
|
|
108
|
+
"min_count",
|
|
109
|
+
"max_count",
|
|
90
110
|
"default",
|
|
91
111
|
}
|
|
92
112
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: cognite-neat
|
|
3
|
-
Version: 0.127.
|
|
3
|
+
Version: 0.127.25
|
|
4
4
|
Summary: Knowledge graph transformation
|
|
5
5
|
Project-URL: Documentation, https://cognite-neat.readthedocs-hosted.com/
|
|
6
6
|
Project-URL: Homepage, https://cognite-neat.readthedocs-hosted.com/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
cognite/neat/__init__.py,sha256=Lo4DbjDOwnhCYUoAgPp5RG1fDdF7OlnomalTe7n1ydw,211
|
|
2
2
|
cognite/neat/_exceptions.py,sha256=ox-5hXpee4UJlPE7HpuEHV2C96aLbLKo-BhPDoOAzhA,1650
|
|
3
3
|
cognite/neat/_issues.py,sha256=wH1mnkrpBsHUkQMGUHFLUIQWQlfJ_qMfdF7q0d9wNhY,1871
|
|
4
|
-
cognite/neat/_version.py,sha256=
|
|
4
|
+
cognite/neat/_version.py,sha256=Hsl6r_Z4Ik-HLkbCToNXmmjME2_bdiVlGTB06JNU8HM,47
|
|
5
5
|
cognite/neat/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
6
6
|
cognite/neat/v1.py,sha256=owqW5Mml2DSZx1AvPvwNRTBngfhBNrQ6EH-7CKL7Jp0,61
|
|
7
7
|
cognite/neat/_client/__init__.py,sha256=75Bh7eGhaN4sOt3ZcRzHl7pXaheu1z27kmTHeaI05vo,114
|
|
@@ -166,7 +166,7 @@ cognite/neat/v0/core/_data_model/importers/_spreadsheet2data_model.py,sha256=ksD
|
|
|
166
166
|
cognite/neat/v0/core/_data_model/importers/_rdf/__init__.py,sha256=1yOjV2PKCxwH7uCTXVZhSdxtn5etmFX40cksvwtKcZ8,199
|
|
167
167
|
cognite/neat/v0/core/_data_model/importers/_rdf/_base.py,sha256=Rv24TQQDZqAuFD8Qh0yRBiB7-JvoMVj3mGoPBm-xBFs,6052
|
|
168
168
|
cognite/neat/v0/core/_data_model/importers/_rdf/_inference2rdata_model.py,sha256=w8LsdkzgoTXN3LZyjEL_5grWZGlf7PPj8qOu370_K6M,28976
|
|
169
|
-
cognite/neat/v0/core/_data_model/importers/_rdf/_owl2data_model.py,sha256=
|
|
169
|
+
cognite/neat/v0/core/_data_model/importers/_rdf/_owl2data_model.py,sha256=6fS2IhmRjsQdENYb47bSvRcqTzp7zr0YUuRIsYY-EPc,5200
|
|
170
170
|
cognite/neat/v0/core/_data_model/importers/_rdf/_shared.py,sha256=lcMnGIvqYZJ41JPjzanZHi9uG826EzYHpQXSMYVRK8A,9839
|
|
171
171
|
cognite/neat/v0/core/_data_model/models/__init__.py,sha256=whWV0FrdUi01Du2mgan3_kZHQ9T2tGrGb2xRxoFDhNo,1258
|
|
172
172
|
cognite/neat/v0/core/_data_model/models/_base_unverified.py,sha256=1Wfbp-tJaEF6hd1bFdp2FhTgPkInf-1ZokuEoVJRPxQ,6842
|
|
@@ -312,7 +312,7 @@ cognite/neat/v0/session/engine/__init__.py,sha256=D3MxUorEs6-NtgoICqtZ8PISQrjrr4
|
|
|
312
312
|
cognite/neat/v0/session/engine/_import.py,sha256=1QxA2_EK613lXYAHKQbZyw2yjo5P9XuiX4Z6_6-WMNQ,169
|
|
313
313
|
cognite/neat/v0/session/engine/_interface.py,sha256=3W-cYr493c_mW3P5O6MKN1xEQg3cA7NHR_ev3zdF9Vk,533
|
|
314
314
|
cognite/neat/v0/session/engine/_load.py,sha256=u0x7vuQCRoNcPt25KJBJRn8sJabonYK4vtSZpiTdP4k,5201
|
|
315
|
-
cognite_neat-0.127.
|
|
316
|
-
cognite_neat-0.127.
|
|
317
|
-
cognite_neat-0.127.
|
|
318
|
-
cognite_neat-0.127.
|
|
315
|
+
cognite_neat-0.127.25.dist-info/METADATA,sha256=t6VBbJO1-wAlt1FwCCk-rq9Pcdood0JN3AIw8SwdyTI,9150
|
|
316
|
+
cognite_neat-0.127.25.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
317
|
+
cognite_neat-0.127.25.dist-info/licenses/LICENSE,sha256=W8VmvFia4WHa3Gqxq1Ygrq85McUNqIGDVgtdvzT-XqA,11351
|
|
318
|
+
cognite_neat-0.127.25.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|