ontobdc 0.1.0a0__tar.gz

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.
Files changed (42) hide show
  1. ontobdc-0.1.0a0/LICENSE +201 -0
  2. ontobdc-0.1.0a0/PKG-INFO +170 -0
  3. ontobdc-0.1.0a0/README.md +157 -0
  4. ontobdc-0.1.0a0/core/__init__.py +2 -0
  5. ontobdc-0.1.0a0/core/src/__init__.py +2 -0
  6. ontobdc-0.1.0a0/core/src/adapter/__init__.py +4 -0
  7. ontobdc-0.1.0a0/core/src/adapter/rich_table.py +57 -0
  8. ontobdc-0.1.0a0/core/src/domain/__init__.py +2 -0
  9. ontobdc-0.1.0a0/core/src/domain/port/__init__.py +2 -0
  10. ontobdc-0.1.0a0/core/src/domain/port/repository.py +38 -0
  11. ontobdc-0.1.0a0/core/src/domain/schema/__init__.py +2 -0
  12. ontobdc-0.1.0a0/core/src/domain/schema/entity.py +94 -0
  13. ontobdc-0.1.0a0/core/src/domain/schema/factory.py +69 -0
  14. ontobdc-0.1.0a0/ontobdc.egg-info/PKG-INFO +170 -0
  15. ontobdc-0.1.0a0/ontobdc.egg-info/SOURCES.txt +40 -0
  16. ontobdc-0.1.0a0/ontobdc.egg-info/dependency_links.txt +1 -0
  17. ontobdc-0.1.0a0/ontobdc.egg-info/requires.txt +3 -0
  18. ontobdc-0.1.0a0/ontobdc.egg-info/top_level.txt +8 -0
  19. ontobdc-0.1.0a0/pyproject.toml +20 -0
  20. ontobdc-0.1.0a0/resource/__init__.py +2 -0
  21. ontobdc-0.1.0a0/resource/plugin/__init__.py +2 -0
  22. ontobdc-0.1.0a0/resource/plugin/capability/__init__.py +1 -0
  23. ontobdc-0.1.0a0/resource/plugin/capability/list_documents.py +173 -0
  24. ontobdc-0.1.0a0/resource/plugin/capability/list_documents_by_bbox.py +244 -0
  25. ontobdc-0.1.0a0/resource/plugin/capability/list_documents_by_name_pattern.py +242 -0
  26. ontobdc-0.1.0a0/resource/plugin/capability/list_documents_by_template.py +210 -0
  27. ontobdc-0.1.0a0/resource/plugin/capability/list_documents_by_type.py +197 -0
  28. ontobdc-0.1.0a0/resource/src/__init__.py +2 -0
  29. ontobdc-0.1.0a0/resource/src/adapter/__init__.py +2 -0
  30. ontobdc-0.1.0a0/resource/src/adapter/folder.py +56 -0
  31. ontobdc-0.1.0a0/resource/src/adapter/repository.py +37 -0
  32. ontobdc-0.1.0a0/resource/src/domain/__init__.py +2 -0
  33. ontobdc-0.1.0a0/resource/src/domain/exception/__init__.py +2 -0
  34. ontobdc-0.1.0a0/resource/src/domain/exception.py +6 -0
  35. ontobdc-0.1.0a0/resource/src/domain/port/__init__.py +2 -0
  36. ontobdc-0.1.0a0/resource/src/domain/port/entity.py +17 -0
  37. ontobdc-0.1.0a0/resource/src/domain/port/repository.py +106 -0
  38. ontobdc-0.1.0a0/run/__init__.py +2 -0
  39. ontobdc-0.1.0a0/run/capability_core.py +63 -0
  40. ontobdc-0.1.0a0/run/plan.py +290 -0
  41. ontobdc-0.1.0a0/run/run.py +179 -0
  42. ontobdc-0.1.0a0/setup.cfg +4 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,170 @@
1
+ Metadata-Version: 2.4
2
+ Name: ontobdc
3
+ Version: 0.1.0a0
4
+ Summary: OntoBDC
5
+ Author: Elias M P Junior
6
+ Requires-Python: >=3.10
7
+ Description-Content-Type: text/markdown
8
+ License-File: LICENSE
9
+ Requires-Dist: rich
10
+ Requires-Dist: PyYAML
11
+ Requires-Dist: numpy
12
+ Dynamic: license-file
13
+
14
+ # OntoBDC
15
+
16
+ OntoBDC is a **domain and data layer** for engineering information.
17
+ It provides:
18
+
19
+ - Domain models (entities and schemas) for documents and datasets
20
+ - File and dataset repositories built on top of folders and filesystems
21
+ - Resource-oriented capabilities that can be composed into higher-level flows
22
+
23
+ You can use OntoBDC as a Python package, via its own CLI
24
+ (`ontobdc.sh` / `run/run.sh`), or integrated into other stacks.
25
+
26
+ ---
27
+
28
+ ## 🚀 Quick Start
29
+
30
+ ### 1. Install as a Python package
31
+
32
+ From the root of this repository:
33
+
34
+ ```bash
35
+ python -m venv .venv
36
+ source .venv/bin/activate
37
+
38
+ pip install -e .
39
+ ```
40
+
41
+ This makes the `ontobdc` package importable in your Python environment.
42
+
43
+ ### 2. Run capabilities via ontobdc CLI
44
+
45
+ This repository provides a thin CLI wrapper in `ontobdc.sh` that dispatches
46
+ to development tools and the capability runner:
47
+
48
+ ```bash
49
+ ./ontobdc.sh -h
50
+ ```
51
+
52
+ Main commands:
53
+
54
+ - `./ontobdc.sh run …` → runs capabilities through `ontobdc/run/run.py`
55
+ - `./ontobdc.sh plan …` → plans capability execution flows
56
+ - `./ontobdc.sh commit` / `./ontobdc.sh branch` → Git workflow helpers for this repo
57
+
58
+ You can also call the runner script directly:
59
+
60
+ ```bash
61
+ ./ontobdc/run/run.sh run --json
62
+ ```
63
+
64
+ This prints a JSON catalog of registered capabilities, including those
65
+ coming from OntoBDC itself and, if configured, other plugin packages.
66
+
67
+ OntoBDC ships resource-oriented capabilities, for example
68
+ to list documents from a repository:
69
+
70
+ - `org.ontobdc.domain.resource.capability.list_documents_by_bbox`
71
+ - `org.ontobdc.domain.resource.capability.list_documents_by_type`
72
+ - `org.ontobdc.domain.resource.capability.list_documents_by_name_pattern`
73
+
74
+ These capabilities are designed to work over a `FileRepositoryPort`
75
+ implementation, typically backed by local folders or other storage
76
+ adapters.
77
+
78
+ ## 🧩 Capabilities
79
+
80
+ OntoBDC focuses on **resource and file-centric** capabilities. Examples:
81
+
82
+ ### Resource Capabilities
83
+
84
+ These live under `ontobdc.resource.plugin.capability`:
85
+
86
+ | ID | Description |
87
+ |----|-------------|
88
+ | `org.ontobdc.domain.resource.capability.list_documents_by_bbox` | Lists documents from a `FileRepositoryPort` filtered by bounding box and optional mimetypes. |
89
+ | `org.ontobdc.domain.resource.capability.list_documents_by_type` | Lists documents filtered by logical type (e.g., models, drawings, reports). |
90
+ | `org.ontobdc.domain.resource.capability.list_documents_by_name_pattern` | Lists documents filtered by name patterns (glob or regex-style matching). |
91
+
92
+ These capabilities consume repositories defined in
93
+ `ontobdc.resource.src.domain.port.repository` and adapters in
94
+ `ontobdc.resource.src.adapter`.
95
+
96
+ ### Drive / PDF Capabilities
97
+
98
+ Under `ontobdc.tmp.src.drive.plugin.capability.pdf` you will find
99
+ experimental capabilities such as:
100
+
101
+ - Attaching images to PDF files
102
+ - Converting PDF pages to PNG
103
+ - Extracting PDF pages to markdown
104
+ - Counting pages in a PDF
105
+
106
+ They are meant for document processing workflows that sit on top of
107
+ OntoBDC’s file and dataset abstractions.
108
+
109
+ ---
110
+
111
+ ## 🏗️ Architecture
112
+
113
+ OntoBDC is structured as a set of **layers**:
114
+
115
+ - **Domain Ports and Entities**
116
+ - `ontobdc.resource.src.domain.port.*` defines interfaces for entities
117
+ (documents, folders, datasets) and repositories.
118
+ - `ontobdc.resource.src.domain.entity` and schemas describe how these
119
+ resources are modeled.
120
+
121
+ - **Adapters**
122
+ - `ontobdc.resource.src.adapter` provides concrete adapters for
123
+ filesystem-based repositories and folder structures.
124
+ - `ontobdc.core.src.adapter` includes presentation adapters, such as
125
+ rich table rendering for terminal output.
126
+
127
+ - **Capabilities**
128
+ - `ontobdc.resource.plugin.capability` packages domain operations as
129
+ reusable capabilities compatible with the InfoBIM execution model.
130
+ - Drive / PDF capabilities live under `ontobdc.tmp.src.drive.plugin.capability`.
131
+
132
+ - **Runner Integration**
133
+ - `ontobdc/run/run.py` registers capabilities in a shared
134
+ `CapabilityRegistry` and wires them to the CLI, including
135
+ `--json` catalog export and an interactive menu when no capability ID
136
+ is provided.
137
+
138
+ ---
139
+
140
+ ## 🤖 For AI Agents
141
+
142
+ OntoBDC is designed to be **agent-friendly**:
143
+
144
+ - Capabilities expose structured input and output schemas
145
+ - The runner supports a JSON catalog (`--json`) for automatic discovery
146
+ - Planning helpers in `ontobdc/run/plan.py` can be used to build and
147
+ visualize multi-step execution graphs
148
+
149
+ ---
150
+
151
+ ## 🔗 Integration with other stacks (including InfoBIM IFC)
152
+
153
+ OntoBDC can be embedded into larger stacks. One concrete example is the
154
+ InfoBIM IFC stack, where:
155
+
156
+ - OntoBDC provides the **domain model** and **resource capabilities**
157
+ (documents, repositories, datasets)
158
+ - The stack adds IFC-centric capabilities (pipes, units, materials) and
159
+ a higher-level CLI
160
+
161
+ In that scenario, capabilities from OntoBDC and from the host stack share
162
+ the same capability registry and can be combined in planning/automation
163
+ workflows.
164
+
165
+ ---
166
+
167
+ ## 📄 License
168
+
169
+ OntoBDC is part of the **InfoBIM Community** ecosystem.
170
+ Licensed under **Apache 2.0**.***
@@ -0,0 +1,157 @@
1
+ # OntoBDC
2
+
3
+ OntoBDC is a **domain and data layer** for engineering information.
4
+ It provides:
5
+
6
+ - Domain models (entities and schemas) for documents and datasets
7
+ - File and dataset repositories built on top of folders and filesystems
8
+ - Resource-oriented capabilities that can be composed into higher-level flows
9
+
10
+ You can use OntoBDC as a Python package, via its own CLI
11
+ (`ontobdc.sh` / `run/run.sh`), or integrated into other stacks.
12
+
13
+ ---
14
+
15
+ ## 🚀 Quick Start
16
+
17
+ ### 1. Install as a Python package
18
+
19
+ From the root of this repository:
20
+
21
+ ```bash
22
+ python -m venv .venv
23
+ source .venv/bin/activate
24
+
25
+ pip install -e .
26
+ ```
27
+
28
+ This makes the `ontobdc` package importable in your Python environment.
29
+
30
+ ### 2. Run capabilities via ontobdc CLI
31
+
32
+ This repository provides a thin CLI wrapper in `ontobdc.sh` that dispatches
33
+ to development tools and the capability runner:
34
+
35
+ ```bash
36
+ ./ontobdc.sh -h
37
+ ```
38
+
39
+ Main commands:
40
+
41
+ - `./ontobdc.sh run …` → runs capabilities through `ontobdc/run/run.py`
42
+ - `./ontobdc.sh plan …` → plans capability execution flows
43
+ - `./ontobdc.sh commit` / `./ontobdc.sh branch` → Git workflow helpers for this repo
44
+
45
+ You can also call the runner script directly:
46
+
47
+ ```bash
48
+ ./ontobdc/run/run.sh run --json
49
+ ```
50
+
51
+ This prints a JSON catalog of registered capabilities, including those
52
+ coming from OntoBDC itself and, if configured, other plugin packages.
53
+
54
+ OntoBDC ships resource-oriented capabilities, for example
55
+ to list documents from a repository:
56
+
57
+ - `org.ontobdc.domain.resource.capability.list_documents_by_bbox`
58
+ - `org.ontobdc.domain.resource.capability.list_documents_by_type`
59
+ - `org.ontobdc.domain.resource.capability.list_documents_by_name_pattern`
60
+
61
+ These capabilities are designed to work over a `FileRepositoryPort`
62
+ implementation, typically backed by local folders or other storage
63
+ adapters.
64
+
65
+ ## 🧩 Capabilities
66
+
67
+ OntoBDC focuses on **resource and file-centric** capabilities. Examples:
68
+
69
+ ### Resource Capabilities
70
+
71
+ These live under `ontobdc.resource.plugin.capability`:
72
+
73
+ | ID | Description |
74
+ |----|-------------|
75
+ | `org.ontobdc.domain.resource.capability.list_documents_by_bbox` | Lists documents from a `FileRepositoryPort` filtered by bounding box and optional mimetypes. |
76
+ | `org.ontobdc.domain.resource.capability.list_documents_by_type` | Lists documents filtered by logical type (e.g., models, drawings, reports). |
77
+ | `org.ontobdc.domain.resource.capability.list_documents_by_name_pattern` | Lists documents filtered by name patterns (glob or regex-style matching). |
78
+
79
+ These capabilities consume repositories defined in
80
+ `ontobdc.resource.src.domain.port.repository` and adapters in
81
+ `ontobdc.resource.src.adapter`.
82
+
83
+ ### Drive / PDF Capabilities
84
+
85
+ Under `ontobdc.tmp.src.drive.plugin.capability.pdf` you will find
86
+ experimental capabilities such as:
87
+
88
+ - Attaching images to PDF files
89
+ - Converting PDF pages to PNG
90
+ - Extracting PDF pages to markdown
91
+ - Counting pages in a PDF
92
+
93
+ They are meant for document processing workflows that sit on top of
94
+ OntoBDC’s file and dataset abstractions.
95
+
96
+ ---
97
+
98
+ ## 🏗️ Architecture
99
+
100
+ OntoBDC is structured as a set of **layers**:
101
+
102
+ - **Domain Ports and Entities**
103
+ - `ontobdc.resource.src.domain.port.*` defines interfaces for entities
104
+ (documents, folders, datasets) and repositories.
105
+ - `ontobdc.resource.src.domain.entity` and schemas describe how these
106
+ resources are modeled.
107
+
108
+ - **Adapters**
109
+ - `ontobdc.resource.src.adapter` provides concrete adapters for
110
+ filesystem-based repositories and folder structures.
111
+ - `ontobdc.core.src.adapter` includes presentation adapters, such as
112
+ rich table rendering for terminal output.
113
+
114
+ - **Capabilities**
115
+ - `ontobdc.resource.plugin.capability` packages domain operations as
116
+ reusable capabilities compatible with the InfoBIM execution model.
117
+ - Drive / PDF capabilities live under `ontobdc.tmp.src.drive.plugin.capability`.
118
+
119
+ - **Runner Integration**
120
+ - `ontobdc/run/run.py` registers capabilities in a shared
121
+ `CapabilityRegistry` and wires them to the CLI, including
122
+ `--json` catalog export and an interactive menu when no capability ID
123
+ is provided.
124
+
125
+ ---
126
+
127
+ ## 🤖 For AI Agents
128
+
129
+ OntoBDC is designed to be **agent-friendly**:
130
+
131
+ - Capabilities expose structured input and output schemas
132
+ - The runner supports a JSON catalog (`--json`) for automatic discovery
133
+ - Planning helpers in `ontobdc/run/plan.py` can be used to build and
134
+ visualize multi-step execution graphs
135
+
136
+ ---
137
+
138
+ ## 🔗 Integration with other stacks (including InfoBIM IFC)
139
+
140
+ OntoBDC can be embedded into larger stacks. One concrete example is the
141
+ InfoBIM IFC stack, where:
142
+
143
+ - OntoBDC provides the **domain model** and **resource capabilities**
144
+ (documents, repositories, datasets)
145
+ - The stack adds IFC-centric capabilities (pipes, units, materials) and
146
+ a higher-level CLI
147
+
148
+ In that scenario, capabilities from OntoBDC and from the host stack share
149
+ the same capability registry and can be combined in planning/automation
150
+ workflows.
151
+
152
+ ---
153
+
154
+ ## 📄 License
155
+
156
+ OntoBDC is part of the **InfoBIM Community** ecosystem.
157
+ Licensed under **Apache 2.0**.***
@@ -0,0 +1,2 @@
1
+ __all__ = []
2
+
@@ -0,0 +1,2 @@
1
+ __all__ = []
2
+
@@ -0,0 +1,4 @@
1
+ from .rich_table import TableViewAdapter
2
+
3
+ __all__ = ["TableViewAdapter"]
4
+
@@ -0,0 +1,57 @@
1
+ from typing import List, Tuple, Any
2
+
3
+ from rich.box import Box
4
+ from rich.table import Table
5
+
6
+
7
+ DASHED_HORIZONTALS = Box(
8
+ " ── \n"
9
+ " \n"
10
+ " ── \n"
11
+ " \n"
12
+ " ╌╌ \n"
13
+ " ── \n"
14
+ " \n"
15
+ " ── \n"
16
+ )
17
+
18
+
19
+ class TableViewAdapter:
20
+ PRIMARY_COLUMN = {"style": "cyan", "vertical": "top"}
21
+ NUMERIC_COLUMN = {"justify": "right", "vertical": "top"}
22
+ SECONDARY_COLUMN = {"style": "dim", "vertical": "top"}
23
+ INDEX_COLUMN = {"justify": "right", "style": "dim", "vertical": "top"}
24
+
25
+ @staticmethod
26
+ def create_table(
27
+ title: str,
28
+ columns: List[Tuple[str, Any]],
29
+ show_header: bool = True,
30
+ header_style: str = "bold white",
31
+ border_style: str = "grey35",
32
+ ) -> Table:
33
+ table = Table(
34
+ title=title,
35
+ box=DASHED_HORIZONTALS,
36
+ border_style=border_style,
37
+ show_lines=True,
38
+ show_header=show_header,
39
+ header_style=header_style,
40
+ )
41
+
42
+ for col_name, col_kwargs in columns:
43
+ table.add_column(col_name, **col_kwargs)
44
+
45
+ return table
46
+
47
+ @staticmethod
48
+ def col(label: str, kind: str = "primary", **overrides: Any) -> Tuple[str, Any]:
49
+ kind_map = {
50
+ "primary": TableViewAdapter.PRIMARY_COLUMN,
51
+ "numeric": TableViewAdapter.NUMERIC_COLUMN,
52
+ "secondary": TableViewAdapter.SECONDARY_COLUMN,
53
+ "index": TableViewAdapter.INDEX_COLUMN,
54
+ }
55
+ base = dict(kind_map.get(kind, {}))
56
+ base.update(overrides)
57
+ return label, base
@@ -0,0 +1,2 @@
1
+ __all__ = []
2
+
@@ -0,0 +1,2 @@
1
+ __all__ = []
2
+
@@ -0,0 +1,38 @@
1
+
2
+ from abc import ABC, abstractmethod
3
+ from typing import List, Dict, Any
4
+
5
+
6
+ class RepositoryPort(ABC):
7
+ """
8
+ Base repository port.
9
+ """
10
+
11
+ @abstractmethod
12
+ def get_by_id(self, id: str) -> List[Any]:
13
+ """
14
+ Get a file resource by its ID.
15
+
16
+ :param id: The ID of the file resource.
17
+ :return: The file resource as a dictionary.
18
+ """
19
+ pass
20
+
21
+ @abstractmethod
22
+ def get_all(self) -> List[Any]:
23
+ """
24
+ Get all file resources.
25
+
26
+ :return: A list of file resources as dictionaries.
27
+ """
28
+ pass
29
+
30
+ @abstractmethod
31
+ def get_by_type(self, type: str) -> List[Any]:
32
+ """
33
+ Get all file resources of a certain type.
34
+
35
+ :param type: The type of the file resource.
36
+ :return: A list of file resources as dictionaries.
37
+ """
38
+ pass
@@ -0,0 +1,2 @@
1
+ __all__ = []
2
+