Skip to content

Commit da0636e

Browse files
committed
fix/major_fixes
- Readme updates, added a full example on how to use the package. - Fixed the required database driver packages in the setup and toml files. - Improved the query handling for unqlite databases, to maintain a query style compatible with mongodb databases: For instance, queries like the following are now supported in unqlite as well. - collection.find({field: 1, id: 0}), will return documents like: [ {field_name: <value>}, {field_name: <value>}, ... ] - collection.find({field: 1}), will return documents like: [ {<doc_id>: <value>}, {<doc_id>: <value>}, ... ] This provides a more consistent experience across different noSQL databases into handle projections similar to mongoDB. - Corrections in the Ontology module prefixes and in the sparkQL queries to match the new ontology prefixes. - Changed the default BM named args from "FromMetadata" and "FromParameters" to "metadata" and "params" respectively. - Changed the data object sent to the BM function from a dictionary to a simple object with attributes, now data inside a BM is accessible by using: data.metadata instead of data['metadata'] data.params instead of data['params']
1 parent a2494cd commit da0636e

15 files changed

Lines changed: 536 additions & 123 deletions

CHANGELOG.txt

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,28 @@
11
Change Log
22
===============
3-
VERSION="0.0.16"
4-
LAST_UPDATE="12/11/2025"
3+
VERSION="0.0.17"
4+
LAST_UPDATE="18/11/2025"
55
------------------
6-
- Readme updates
7-
- Added the Async SQLite driver
8-
- Added the Async Postgres driver
9-
- Added the Async UnqLite driver
6+
- Readme updates, added a full example of using the package.
7+
- Fixed the required database driver packages in the setup file.
8+
- Improved the query handling for unqlite databases, to maintain a query style compatible with mongodb databases:
9+
For instance, queries like the following are now supported in unqlite as well.
10+
- collection.find({field: 1, id: 0}), will return documents like:
11+
[
12+
{field_name: <value>},
13+
{field_name: <value>},
14+
...
15+
]
16+
- collection.find({field: 1}), will return documents like:
17+
[
18+
{<doc_id>: <value>},
19+
{<doc_id>: <value>},
20+
...
21+
]
22+
This provides a more consistent experience across different noSQL databases into handle projections similar to mongoDB.
23+
- Corrections in the Ontology module prefixes and in the sparkQL queries to match the new ontology prefixes.
24+
- Changed the default named args from metadata and parameters from "FromMetadata" and "FromParameters" to "metadata" and "params" respectively.
25+
- Changed the data object sent to the BM function from a dictionary to a simple object with attributes, now data inside a BM is accessible by using:
26+
data.metadata instead of data['metadata']
27+
data.params instead of data['params']
1028
------------------

OntologicalFramework/OntologyToAPI-BusinessModel.ttl

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
@prefix : <http://www.cedri.com/SmartLEM-BusinessModel#> .
1+
@prefix : <http://www.cedri.com/OntologyToAPI-BusinessModel#> .
22
@prefix owl: <http://www.w3.org/2002/07/owl#> .
33
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
44
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
55
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
66
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
7-
@base <http://www.cedri.com/SmartLEM-BusinessModel#> .
7+
@base <http://www.cedri.com/OntologyToAPI-BusinessModel#> .
88

9-
<http://www.cedri.com/SmartLEM-BusinessModel> rdf:type owl:Ontology ;
10-
owl:versionIRI <http://www.cedri.com/SmartLEM-BusinessModel/1.0.0> ;
11-
owl:imports <http://www.cedri.com/SmartLEM-ExternalCode/1.0.0> ,
12-
<http://www.cedri.com/SmartLEM-Metadata/1.0.0> ;
9+
<http://www.cedri.com/OntologyToAPI-BusinessModel> rdf:type owl:Ontology ;
10+
owl:versionIRI <http://www.cedri.com/OntologyToAPI-BusinessModel/1.0.0> ;
11+
owl:imports <http://www.cedri.com/OntologyToAPI-ExternalCode/1.0.0> ,
12+
<http://www.cedri.com/OntologyToAPI-Metadata/1.0.0> ;
1313
<http://purl.org/dc/terms/creator> "https://orcid.org/0000-0002-7620-0960" ;
14-
<http://purl.org/dc/terms/description> "This ontology represent the business model interfaces with other smartLEM concepts." ;
14+
<http://purl.org/dc/terms/description> "This ontology represent the business model interfaces with other OntologyToAPI concepts." ;
1515
<http://purl.org/dc/terms/issued> "2025-06-30" ;
1616
<http://purl.org/dc/terms/modified> "2025-06-30" .
1717

@@ -47,38 +47,38 @@ xsd:duration rdf:type rdfs:Datatype .
4747
# Object Properties
4848
#################################################################
4949

50-
### http://www.cedri.com/SmartLEM-BusinessModel#hasExternalCode
50+
### http://www.cedri.com/OntologyToAPI-BusinessModel#hasExternalCode
5151
:hasExternalCode rdf:type owl:ObjectProperty ;
5252
rdfs:domain :BusinessModel ;
53-
rdfs:range <http://www.cedri.com/SmartLEM-ExternalCode#ExternalCode> ;
53+
rdfs:range <http://www.cedri.com/OntologyToAPI-ExternalCode#ExternalCode> ;
5454
rdfs:comment "A business model have some external code" .
5555

5656

57-
### http://www.cedri.com/SmartLEM-BusinessModel#hasParameter
57+
### http://www.cedri.com/OntologyToAPI-BusinessModel#hasParameter
5858
:hasParameter rdf:type owl:ObjectProperty ;
5959
rdfs:domain :BusinessModel ;
6060
rdfs:range :Parameter .
6161

6262

63-
### http://www.cedri.com/SmartLEM-BusinessModel#requiresMetadata
63+
### http://www.cedri.com/OntologyToAPI-BusinessModel#requiresMetadata
6464
:requiresMetadata rdf:type owl:ObjectProperty ,
6565
owl:InverseFunctionalProperty ;
6666
rdfs:domain :BusinessModel ;
67-
rdfs:range <http://www.cedri.com/SmartLEM-Metadata#Metadata> ;
67+
rdfs:range <http://www.cedri.com/OntologyToAPI-Metadata#Metadata> ;
6868
rdfs:comment "The metadata required to achieve some goal of a business model" .
6969

7070

7171
#################################################################
7272
# Data properties
7373
#################################################################
7474

75-
### http://www.cedri.com/SmartLEM-BusinessModel#hasParameterLabel
75+
### http://www.cedri.com/OntologyToAPI-BusinessModel#hasParameterLabel
7676
:hasParameterLabel rdf:type owl:DatatypeProperty ;
7777
rdfs:domain :Parameter ;
7878
rdfs:range xsd:string .
7979

8080

81-
### http://www.cedri.com/SmartLEM-BusinessModel#hasParameterType
81+
### http://www.cedri.com/OntologyToAPI-BusinessModel#hasParameterType
8282
:hasParameterType rdf:type owl:DatatypeProperty ;
8383
rdfs:domain :Parameter ;
8484
rdfs:range xsd:string .
@@ -88,18 +88,18 @@ xsd:duration rdf:type rdfs:Datatype .
8888
# Classes
8989
#################################################################
9090

91-
### http://www.cedri.com/SmartLEM-BusinessModel#BusinessModel
91+
### http://www.cedri.com/OntologyToAPI-BusinessModel#BusinessModel
9292
:BusinessModel rdf:type owl:Class ;
9393
rdfs:comment "represents a business model that is related with metadata and can have external code" .
9494

9595

96-
### http://www.cedri.com/SmartLEM-BusinessModel#Parameter
96+
### http://www.cedri.com/OntologyToAPI-BusinessModel#Parameter
9797
:Parameter rdf:type owl:Class ;
9898
rdfs:comment "An parameter required to run an Business Model" .
9999

100100

101-
### http://www.cedri.com/SmartLEM-ExternalCode#ExternalCode
102-
<http://www.cedri.com/SmartLEM-ExternalCode#ExternalCode> rdf:type owl:Class .
101+
### http://www.cedri.com/OntologyToAPI-ExternalCode#ExternalCode
102+
<http://www.cedri.com/OntologyToAPI-ExternalCode#ExternalCode> rdf:type owl:Class .
103103

104104

105105
### Generated by the OWL API (version 4.5.29.2024-05-13T12:11:03Z) https://github.com/owlcs/owlapi

OntologicalFramework/OntologyToAPI-Communication.ttl

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
@prefix : <http://www.cedri.com/SmartLEM-Communications#> .
2-
@prefix ct: <http://www.cedri.com/SmartLEM-Communications/> .
1+
@prefix : <http://www.cedri.com/OntologyToAPI-Communications#> .
2+
@prefix ct: <http://www.cedri.com/OntologyToAPI-Communications/> .
33
@prefix owl: <http://www.w3.org/2002/07/owl#> .
44
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
55
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
66
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
77
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
8-
@base <http://www.cedri.com/SmartLEM-Communications#> .
8+
@base <http://www.cedri.com/OntologyToAPI-Communications#> .
99

10-
<http://www.cedri.com/SmartLEM-Communications> rdf:type owl:Ontology ;
11-
owl:versionIRI <http://www.cedri.com/SmartLEM-Communications/1.0.0> ;
10+
<http://www.cedri.com/OntologyToAPI-Communications> rdf:type owl:Ontology ;
11+
owl:versionIRI <http://www.cedri.com/OntologyToAPI-Communications/1.0.0> ;
1212
<http://purl.org/dc/terms/creator> "https://orcid.org/0000-0002-7620-0960" ;
1313
<http://purl.org/dc/terms/description> "This ontology represent the communication concepts from multiple system." ;
1414
<http://purl.org/dc/terms/issued> "2025-06-30" ;
@@ -46,109 +46,109 @@ xsd:duration rdf:type rdfs:Datatype .
4646
# Data properties
4747
#################################################################
4848

49-
### http://www.cedri.com/SmartLEM-Communications#hasConnectionString
49+
### http://www.cedri.com/OntologyToAPI-Communications#hasConnectionString
5050
:hasConnectionString rdf:type owl:DatatypeProperty ,
5151
owl:FunctionalProperty ;
5252
rdfs:domain :DatabaseCommunication ;
5353
rdfs:range xsd:string ;
5454
rdfs:comment "connection string for databases (e.g., SQL and non-SQL databases)" .
5555

5656

57-
### http://www.cedri.com/SmartLEM-Communications#hasEndpoint
57+
### http://www.cedri.com/OntologyToAPI-Communications#hasEndpoint
5858
:hasEndpoint rdf:type owl:DatatypeProperty ,
5959
owl:FunctionalProperty ;
6060
rdfs:domain :APICommunication ;
6161
rdfs:range xsd:string ;
6262
rdfs:comment "has a endpoint structure to request data" .
6363

6464

65-
### http://www.cedri.com/SmartLEM-Communications#hasFileType
65+
### http://www.cedri.com/OntologyToAPI-Communications#hasFileType
6666
:hasFileType rdf:type owl:DatatypeProperty ,
6767
owl:FunctionalProperty ;
6868
rdfs:domain :FileBasedCommunication ;
6969
rdfs:range xsd:string ;
7070
rdfs:comment "has a file type (e.g., XLS, XLSX, CSV, JSON, etc)" .
7171

7272

73-
### http://www.cedri.com/SmartLEM-Communications#hasIPAddress
73+
### http://www.cedri.com/OntologyToAPI-Communications#hasIPAddress
7474
:hasIPAddress rdf:type owl:DatatypeProperty ,
7575
owl:FunctionalProperty ;
7676
rdfs:domain ct:CommunicationTechnology ;
7777
rdfs:range xsd:string ;
7878
rdfs:comment "the internet protocol address" .
7979

8080

81-
### http://www.cedri.com/SmartLEM-Communications#hasPath
81+
### http://www.cedri.com/OntologyToAPI-Communications#hasPath
8282
:hasPath rdf:type owl:DatatypeProperty ,
8383
owl:FunctionalProperty ;
8484
rdfs:domain :FileBasedCommunication ;
8585
rdfs:range xsd:string ;
8686
rdfs:comment "has a path for a specific file or directory" .
8787

8888

89-
### http://www.cedri.com/SmartLEM-Communications#hasPort
89+
### http://www.cedri.com/OntologyToAPI-Communications#hasPort
9090
:hasPort rdf:type owl:DatatypeProperty ,
9191
owl:FunctionalProperty ;
9292
rdfs:domain ct:CommunicationTechnology ;
9393
rdfs:range xsd:integer ;
9494
rdfs:comment "has default port" .
9595

9696

97-
### http://www.cedri.com/SmartLEM-Communications#hasQueryCall
97+
### http://www.cedri.com/OntologyToAPI-Communications#hasQueryCall
9898
:hasQueryCall rdf:type owl:DatatypeProperty ;
9999
rdfs:domain :DatabaseCommunication ;
100100
rdfs:range xsd:string ;
101101
rdfs:comment "a generic query within any data storing technology to insert, retrieve or update information" .
102102

103103

104-
### http://www.cedri.com/SmartLEM-Communications#hasQueueName
104+
### http://www.cedri.com/OntologyToAPI-Communications#hasQueueName
105105
:hasQueueName rdf:type owl:DatatypeProperty ,
106106
owl:FunctionalProperty ;
107107
rdfs:domain :MessageQueueCommunication ;
108108
rdfs:range xsd:string ;
109109
rdfs:comment "has a pub/sub queue name" .
110110

111111

112-
### http://www.cedri.com/SmartLEM-Communications#hasRequestURL
112+
### http://www.cedri.com/OntologyToAPI-Communications#hasRequestURL
113113
:hasRequestURL rdf:type owl:DatatypeProperty ,
114114
owl:FunctionalProperty ;
115115
rdfs:domain :APICommunication ;
116116
rdfs:range xsd:string ;
117117
rdfs:comment "has a request URL mainly for an API call" .
118118

119119

120-
### http://www.cedri.com/SmartLEM-Communications#hasResponseField
120+
### http://www.cedri.com/OntologyToAPI-Communications#hasResponseField
121121
:hasResponseField rdf:type owl:DatatypeProperty ;
122122
rdfs:domain :APICommunication ;
123123
rdfs:range xsd:string ;
124124
rdfs:comment "has a response field in the content of message from an API call" .
125125

126126

127-
### http://www.cedri.com/SmartLEM-Communications#hasSecurityLevel
127+
### http://www.cedri.com/OntologyToAPI-Communications#hasSecurityLevel
128128
:hasSecurityLevel rdf:type owl:DatatypeProperty ,
129129
owl:FunctionalProperty ;
130130
rdfs:domain ct:CommunicationTechnology ;
131131
rdfs:range xsd:string ;
132132
rdfs:comment "e.g., none, basic, TLS, end-to-end" .
133133

134134

135-
### http://www.cedri.com/SmartLEM-Communications#isStateful
135+
### http://www.cedri.com/OntologyToAPI-Communications#isStateful
136136
:isStateful rdf:type owl:DatatypeProperty ,
137137
owl:FunctionalProperty ;
138138
rdfs:domain ct:CommunicationTechnology ;
139139
rdfs:range xsd:boolean ;
140140
rdfs:comment "whether the communication maintains state (e.g., WebSockets = true, REST = false)." .
141141

142142

143-
### http://www.cedri.com/SmartLEM-Communications#usesMessageFormat
143+
### http://www.cedri.com/OntologyToAPI-Communications#usesMessageFormat
144144
:usesMessageFormat rdf:type owl:DatatypeProperty ,
145145
owl:FunctionalProperty ;
146146
rdfs:domain ct:CommunicationTechnology ;
147147
rdfs:range xsd:string ;
148148
rdfs:comment "e.g., JSON, XML, Protobuf, Binary" .
149149

150150

151-
### http://www.cedri.com/SmartLEM-Communications#usesTechnology
151+
### http://www.cedri.com/OntologyToAPI-Communications#usesTechnology
152152
:usesTechnology rdf:type owl:DatatypeProperty ,
153153
owl:FunctionalProperty ;
154154
rdfs:domain :DatabaseCommunication ;
@@ -160,55 +160,55 @@ xsd:duration rdf:type rdfs:Datatype .
160160
# Classes
161161
#################################################################
162162

163-
### http://www.cedri.com/SmartLEM-Communications#APICommunication
163+
### http://www.cedri.com/OntologyToAPI-Communications#APICommunication
164164
:APICommunication rdf:type owl:Class ;
165165
rdfs:subClassOf ct:CommunicationTechnology ;
166166
rdfs:comment "A class representing API-based communication." .
167167

168168

169-
### http://www.cedri.com/SmartLEM-Communications#DatabaseCommunication
169+
### http://www.cedri.com/OntologyToAPI-Communications#DatabaseCommunication
170170
:DatabaseCommunication rdf:type owl:Class ;
171171
rdfs:subClassOf ct:CommunicationTechnology ;
172172
rdfs:comment "A class representing communication with databases." .
173173

174174

175-
### http://www.cedri.com/SmartLEM-Communications#FileBasedCommunication
175+
### http://www.cedri.com/OntologyToAPI-Communications#FileBasedCommunication
176176
:FileBasedCommunication rdf:type owl:Class ;
177177
rdfs:subClassOf ct:CommunicationTechnology ;
178178
rdfs:comment "A class representing communication through file systems." .
179179

180180

181-
### http://www.cedri.com/SmartLEM-Communications#MessageQueueCommunication
181+
### http://www.cedri.com/OntologyToAPI-Communications#MessageQueueCommunication
182182
:MessageQueueCommunication rdf:type owl:Class ;
183183
rdfs:subClassOf ct:CommunicationTechnology ;
184184
rdfs:comment "A class representing message broker or queue-based communication." .
185185

186186

187-
### http://www.cedri.com/SmartLEM-Communications#RPCCommunication
187+
### http://www.cedri.com/OntologyToAPI-Communications#RPCCommunication
188188
:RPCCommunication rdf:type owl:Class ;
189189
rdfs:subClassOf ct:CommunicationTechnology ;
190190
rdfs:comment "A class representing Remote Procedure Call-based communication." .
191191

192192

193-
### http://www.cedri.com/SmartLEM-Communications#ServiceMeshCommunication
193+
### http://www.cedri.com/OntologyToAPI-Communications#ServiceMeshCommunication
194194
:ServiceMeshCommunication rdf:type owl:Class ;
195195
rdfs:subClassOf ct:CommunicationTechnology ;
196196
rdfs:comment "A class representing service mesh-based internal service communication." .
197197

198198

199-
### http://www.cedri.com/SmartLEM-Communications#SocketCommunication
199+
### http://www.cedri.com/OntologyToAPI-Communications#SocketCommunication
200200
:SocketCommunication rdf:type owl:Class ;
201201
rdfs:subClassOf ct:CommunicationTechnology ;
202202
rdfs:comment "A class representing socket-based communication." .
203203

204204

205-
### http://www.cedri.com/SmartLEM-Communications#WebSocketCommunication
205+
### http://www.cedri.com/OntologyToAPI-Communications#WebSocketCommunication
206206
:WebSocketCommunication rdf:type owl:Class ;
207207
rdfs:subClassOf ct:CommunicationTechnology ;
208208
rdfs:comment "A class representing WebSocket communication." .
209209

210210

211-
### http://www.cedri.com/SmartLEM-Communications/CommunicationTechnology
211+
### http://www.cedri.com/OntologyToAPI-Communications/CommunicationTechnology
212212
ct:CommunicationTechnology rdf:type owl:Class ;
213213
rdfs:comment "A class representing communication technology." .
214214

OntologicalFramework/OntologyToAPI-ExternalCode.ttl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
@prefix : <http://www.cedri.com/SmartLEM-ExternalCode#> .
1+
@prefix : <http://www.cedri.com/OntologyToAPI-ExternalCode#> .
22
@prefix owl: <http://www.w3.org/2002/07/owl#> .
33
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
44
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
55
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
66
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
7-
@base <http://www.cedri.com/SmartLEM-ExternalCode#> .
7+
@base <http://www.cedri.com/OntologyToAPI-ExternalCode#> .
88

9-
<http://www.cedri.com/SmartLEM-ExternalCode> rdf:type owl:Ontology ;
10-
owl:versionIRI <http://www.cedri.com/SmartLEM-ExternalCode/1.0.0> ;
9+
<http://www.cedri.com/OntologyToAPI-ExternalCode> rdf:type owl:Ontology ;
10+
owl:versionIRI <http://www.cedri.com/OntologyToAPI-ExternalCode/1.0.0> ;
1111
<http://purl.org/dc/terms/creator> "https://orcid.org/0000-0002-7620-0960" ;
1212
<http://purl.org/dc/terms/description> "This ontology represent the concepts as an interface to some external piece of code." ;
1313
<http://purl.org/dc/terms/issued> "2025-06-30" ;
@@ -45,23 +45,23 @@ xsd:duration rdf:type rdfs:Datatype .
4545
# Data properties
4646
#################################################################
4747

48-
### http://www.cedri.com/SmartLEM-ExternalCode#hasFunction
48+
### http://www.cedri.com/OntologyToAPI-ExternalCode#hasFunction
4949
:hasFunction rdf:type owl:DatatypeProperty ,
5050
owl:FunctionalProperty ;
5151
rdfs:domain :ExternalCode ;
5252
rdfs:range xsd:string ;
5353
rdfs:comment "a function name write in python" .
5454

5555

56-
### http://www.cedri.com/SmartLEM-ExternalCode#hasPythonFile
56+
### http://www.cedri.com/OntologyToAPI-ExternalCode#hasPythonFile
5757
:hasPythonFile rdf:type owl:DatatypeProperty ,
5858
owl:FunctionalProperty ;
5959
rdfs:domain :ExternalCode ;
6060
rdfs:range xsd:string ;
6161
rdfs:comment "the python file path of an external code" .
6262

6363

64-
### http://www.cedri.com/SmartLEM-ExternalCode#requiresLib
64+
### http://www.cedri.com/OntologyToAPI-ExternalCode#requiresLib
6565
:requiresLib rdf:type owl:DatatypeProperty ,
6666
owl:FunctionalProperty ;
6767
rdfs:domain :ExternalCode ;
@@ -73,7 +73,7 @@ xsd:duration rdf:type rdfs:Datatype .
7373
# Classes
7474
#################################################################
7575

76-
### http://www.cedri.com/SmartLEM-ExternalCode#ExternalCode
76+
### http://www.cedri.com/OntologyToAPI-ExternalCode#ExternalCode
7777
:ExternalCode rdf:type owl:Class ;
7878
rdfs:comment "is the literal representation of a external code within a system" .
7979

0 commit comments

Comments
 (0)