rdf-construct 0.3.0__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.
Files changed (110) hide show
  1. rdf_construct/__init__.py +12 -0
  2. rdf_construct/__main__.py +0 -0
  3. rdf_construct/cli.py +3429 -0
  4. rdf_construct/core/__init__.py +33 -0
  5. rdf_construct/core/config.py +116 -0
  6. rdf_construct/core/ordering.py +219 -0
  7. rdf_construct/core/predicate_order.py +212 -0
  8. rdf_construct/core/profile.py +157 -0
  9. rdf_construct/core/selector.py +64 -0
  10. rdf_construct/core/serialiser.py +232 -0
  11. rdf_construct/core/utils.py +89 -0
  12. rdf_construct/cq/__init__.py +77 -0
  13. rdf_construct/cq/expectations.py +365 -0
  14. rdf_construct/cq/formatters/__init__.py +45 -0
  15. rdf_construct/cq/formatters/json.py +104 -0
  16. rdf_construct/cq/formatters/junit.py +104 -0
  17. rdf_construct/cq/formatters/text.py +146 -0
  18. rdf_construct/cq/loader.py +300 -0
  19. rdf_construct/cq/runner.py +321 -0
  20. rdf_construct/diff/__init__.py +59 -0
  21. rdf_construct/diff/change_types.py +214 -0
  22. rdf_construct/diff/comparator.py +338 -0
  23. rdf_construct/diff/filters.py +133 -0
  24. rdf_construct/diff/formatters/__init__.py +71 -0
  25. rdf_construct/diff/formatters/json.py +192 -0
  26. rdf_construct/diff/formatters/markdown.py +210 -0
  27. rdf_construct/diff/formatters/text.py +195 -0
  28. rdf_construct/docs/__init__.py +60 -0
  29. rdf_construct/docs/config.py +238 -0
  30. rdf_construct/docs/extractors.py +603 -0
  31. rdf_construct/docs/generator.py +360 -0
  32. rdf_construct/docs/renderers/__init__.py +7 -0
  33. rdf_construct/docs/renderers/html.py +803 -0
  34. rdf_construct/docs/renderers/json.py +390 -0
  35. rdf_construct/docs/renderers/markdown.py +628 -0
  36. rdf_construct/docs/search.py +278 -0
  37. rdf_construct/docs/templates/html/base.html.jinja +44 -0
  38. rdf_construct/docs/templates/html/class.html.jinja +152 -0
  39. rdf_construct/docs/templates/html/hierarchy.html.jinja +28 -0
  40. rdf_construct/docs/templates/html/index.html.jinja +110 -0
  41. rdf_construct/docs/templates/html/instance.html.jinja +90 -0
  42. rdf_construct/docs/templates/html/namespaces.html.jinja +37 -0
  43. rdf_construct/docs/templates/html/property.html.jinja +124 -0
  44. rdf_construct/docs/templates/html/single_page.html.jinja +169 -0
  45. rdf_construct/lint/__init__.py +75 -0
  46. rdf_construct/lint/config.py +214 -0
  47. rdf_construct/lint/engine.py +396 -0
  48. rdf_construct/lint/formatters.py +327 -0
  49. rdf_construct/lint/rules.py +692 -0
  50. rdf_construct/localise/__init__.py +114 -0
  51. rdf_construct/localise/config.py +508 -0
  52. rdf_construct/localise/extractor.py +427 -0
  53. rdf_construct/localise/formatters/__init__.py +36 -0
  54. rdf_construct/localise/formatters/markdown.py +229 -0
  55. rdf_construct/localise/formatters/text.py +224 -0
  56. rdf_construct/localise/merger.py +346 -0
  57. rdf_construct/localise/reporter.py +356 -0
  58. rdf_construct/main.py +6 -0
  59. rdf_construct/merge/__init__.py +165 -0
  60. rdf_construct/merge/config.py +354 -0
  61. rdf_construct/merge/conflicts.py +281 -0
  62. rdf_construct/merge/formatters.py +426 -0
  63. rdf_construct/merge/merger.py +425 -0
  64. rdf_construct/merge/migrator.py +339 -0
  65. rdf_construct/merge/rules.py +377 -0
  66. rdf_construct/merge/splitter.py +1102 -0
  67. rdf_construct/puml2rdf/__init__.py +103 -0
  68. rdf_construct/puml2rdf/config.py +230 -0
  69. rdf_construct/puml2rdf/converter.py +420 -0
  70. rdf_construct/puml2rdf/merger.py +200 -0
  71. rdf_construct/puml2rdf/model.py +202 -0
  72. rdf_construct/puml2rdf/parser.py +565 -0
  73. rdf_construct/puml2rdf/validators.py +451 -0
  74. rdf_construct/refactor/__init__.py +72 -0
  75. rdf_construct/refactor/config.py +362 -0
  76. rdf_construct/refactor/deprecator.py +328 -0
  77. rdf_construct/refactor/formatters/__init__.py +8 -0
  78. rdf_construct/refactor/formatters/text.py +311 -0
  79. rdf_construct/refactor/renamer.py +294 -0
  80. rdf_construct/shacl/__init__.py +56 -0
  81. rdf_construct/shacl/config.py +166 -0
  82. rdf_construct/shacl/converters.py +520 -0
  83. rdf_construct/shacl/generator.py +364 -0
  84. rdf_construct/shacl/namespaces.py +93 -0
  85. rdf_construct/stats/__init__.py +29 -0
  86. rdf_construct/stats/collector.py +178 -0
  87. rdf_construct/stats/comparator.py +298 -0
  88. rdf_construct/stats/formatters/__init__.py +83 -0
  89. rdf_construct/stats/formatters/json.py +38 -0
  90. rdf_construct/stats/formatters/markdown.py +153 -0
  91. rdf_construct/stats/formatters/text.py +186 -0
  92. rdf_construct/stats/metrics/__init__.py +26 -0
  93. rdf_construct/stats/metrics/basic.py +147 -0
  94. rdf_construct/stats/metrics/complexity.py +137 -0
  95. rdf_construct/stats/metrics/connectivity.py +130 -0
  96. rdf_construct/stats/metrics/documentation.py +128 -0
  97. rdf_construct/stats/metrics/hierarchy.py +207 -0
  98. rdf_construct/stats/metrics/properties.py +88 -0
  99. rdf_construct/uml/__init__.py +22 -0
  100. rdf_construct/uml/context.py +194 -0
  101. rdf_construct/uml/mapper.py +371 -0
  102. rdf_construct/uml/odm_renderer.py +789 -0
  103. rdf_construct/uml/renderer.py +684 -0
  104. rdf_construct/uml/uml_layout.py +393 -0
  105. rdf_construct/uml/uml_style.py +613 -0
  106. rdf_construct-0.3.0.dist-info/METADATA +496 -0
  107. rdf_construct-0.3.0.dist-info/RECORD +110 -0
  108. rdf_construct-0.3.0.dist-info/WHEEL +4 -0
  109. rdf_construct-0.3.0.dist-info/entry_points.txt +3 -0
  110. rdf_construct-0.3.0.dist-info/licenses/LICENSE +21 -0
@@ -0,0 +1,496 @@
1
+ Metadata-Version: 2.4
2
+ Name: rdf-construct
3
+ Version: 0.3.0
4
+ Summary: Semantic RDF manipulation toolkit - order, serialize, and diff RDF ontologies
5
+ License-Expression: MIT
6
+ License-File: LICENSE
7
+ Keywords: rdf,ontology,turtle,owl,rdfs,knowledge-graph,knowledge-base,serialization,ontology-engineering,ontology-management,sparql
8
+ Author: Dave Dyke
9
+ Author-email: 23141680+aigora-de@users.noreply.github.com
10
+ Maintainer: Dave Dyke
11
+ Maintainer-email: 23141680+aigora-de@users.noreply.github.com
12
+ Requires-Python: >=3.10
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Intended Audience :: Information Technology
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.10
20
+ Classifier: Programming Language :: Python :: 3.11
21
+ Classifier: Programming Language :: Python :: 3.12
22
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
23
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
24
+ Classifier: Topic :: Internet :: WWW/HTTP
25
+ Classifier: Topic :: Text Processing :: Markup
26
+ Classifier: Typing :: Typed
27
+ Requires-Dist: click (>=8.1.0,<9.0.0)
28
+ Requires-Dist: jinja2 (>=3.1.0,<4.0.0)
29
+ Requires-Dist: pyyaml (>=6.0,<7.0)
30
+ Requires-Dist: rdflib (>=7.0.0,<8.0.0)
31
+ Requires-Dist: rich (>=13.0.0,<14.0.0)
32
+ Project-URL: Bug Tracker, https://github.com/aigora-de/rdf-construct/issues
33
+ Project-URL: Changelog, https://github.com/aigora-de/rdf-construct/blob/main/CHANGELOG.md
34
+ Project-URL: Documentation, https://github.com/aigora-de/rdf-construct#readme
35
+ Project-URL: Homepage, https://github.com/aigora-de/rdf-construct
36
+ Project-URL: Repository, https://github.com/aigora-de/rdf-construct.git
37
+ Description-Content-Type: text/markdown
38
+
39
+ # rdf-construct
40
+
41
+ > *"The ROM construct itself is a hardwired ROM cassette replicating a dead man's skills..."* — William Gibson, Neuromancer
42
+
43
+ **Semantic RDF manipulation toolkit** for ordering, documenting, validating, comparing, and visualising RDF ontologies.
44
+
45
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
46
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
47
+ [![PyPI version](https://badge.fury.io/py/rdf-construct.svg)](https://pypi.org/project/rdf-construct/)
48
+ [![Downloads](https://pepy.tech/badge/rdf-construct)](https://pepy.tech/project/rdf-construct)
49
+
50
+ ## Features
51
+
52
+ - **Semantic Ordering**: Serialise RDF/Turtle with intelligent ordering instead of alphabetical chaos
53
+ - **Documentation Generation**: Create navigable HTML, Markdown, or JSON documentation from ontologies
54
+ - **UML Generation**: Create PlantUML class diagrams from RDF ontologies
55
+ - **PUML2RDF**: Convert PlantUML diagrams to RDF/OWL ontologies (diagram-first design)
56
+ - **SHACL Generation**: Generate SHACL validation shapes from OWL definitions
57
+ - **Semantic Diff**: Compare ontology versions and identify meaningful changes
58
+ - **Ontology Merging**: Combine multiple ontologies with conflict detection and data migration
59
+ - **Ontology Splitting**: Split monolithic ontologies into modules with dependency tracking
60
+ - **Ontology Refactoring**: Rename URIs and deprecate entities with OWL annotations
61
+ - **Multi-Language Support**: Extract, translate, and merge translations for internationalised ontologies
62
+ - **Ontology Linting**: Check quality with 11 configurable rules
63
+ - **Competency Question Testing**: Validate ontologies against SPARQL-based tests
64
+ - **Ontology Statistics**: Comprehensive metrics with comparison mode
65
+ - **Flexible Styling**: Configure colours, layouts, and visual themes for diagrams
66
+ - **Profile-Based**: Define multiple strategies in YAML configuration
67
+ - **Deterministic**: Same input + profile = same output, always
68
+
69
+ ## Why?
70
+
71
+ RDFlib's built-in serialisers always sort alphabetically, which:
72
+ - Obscures semantic structure
73
+ - Makes diffs noisy (unrelated changes mixed together)
74
+ - Loses author's intentional organisation
75
+ - Makes large ontologies hard to navigate
76
+
77
+ **rdf-construct** preserves semantic meaning in serialisation, making RDF files more maintainable.
78
+
79
+ ## Quick Start
80
+
81
+ ### Installation
82
+
83
+ ```bash
84
+ # From PyPI (recommended)
85
+ pip install rdf-construct
86
+
87
+ # From source
88
+ git clone https://github.com/aigora-de/rdf-construct.git
89
+ cd rdf-construct
90
+ pip install -e .
91
+
92
+ # For development
93
+ poetry install
94
+ ```
95
+
96
+ ### Compare Ontology Versions
97
+
98
+ ```bash
99
+ # Basic comparison
100
+ rdf-construct diff v1.0.ttl v1.1.ttl
101
+
102
+ # Generate markdown changelog
103
+ rdf-construct diff v1.0.ttl v1.1.ttl --format markdown -o CHANGELOG.md
104
+
105
+ # JSON output for CI/scripting
106
+ rdf-construct diff old.ttl new.ttl --format json
107
+ ```
108
+
109
+ ### Generate Documentation
110
+
111
+ ```bash
112
+ # HTML documentation with search
113
+ rdf-construct docs ontology.ttl -o api-docs/
114
+
115
+ # Markdown for GitHub wiki
116
+ rdf-construct docs ontology.ttl --format markdown
117
+
118
+ # JSON for custom rendering
119
+ rdf-construct docs ontology.ttl --format json
120
+ ```
121
+
122
+ ### Generate UML Diagrams
123
+
124
+ ```bash
125
+ # Generate diagrams from an example ontology
126
+ rdf-construct uml examples/animal_ontology.ttl -C examples/uml_contexts.yml
127
+
128
+ # With styling and layout
129
+ rdf-construct uml examples/animal_ontology.ttl -C examples/uml_contexts.yml \
130
+ --style-config examples/uml_styles.yml --style default \
131
+ --layout-config examples/uml_layouts.yml --layout hierarchy
132
+ ```
133
+
134
+ ### Reorder RDF Files
135
+
136
+ ```bash
137
+ # Order an ontology using all profiles
138
+ rdf-construct order ontology.ttl order_config.yml
139
+
140
+ # Generate specific profiles only
141
+ rdf-construct order ontology.ttl order_config.yml -p alpha -p logical_topo
142
+ ```
143
+
144
+ ### Check Ontology Quality
145
+
146
+ ```bash
147
+ # Run all lint rules
148
+ rdf-construct lint ontology.ttl
149
+
150
+ # Strict checking for CI
151
+ rdf-construct lint ontology.ttl --level strict --format json
152
+ ```
153
+
154
+ ### Run Competency Question Tests
155
+
156
+ ```bash
157
+ # Run tests
158
+ rdf-construct cq-test ontology.ttl tests.yml
159
+
160
+ # JUnit output for CI
161
+ rdf-construct cq-test ontology.ttl tests.yml --format junit -o results.xml
162
+ ```
163
+
164
+ ### Generate SHACL Shapes
165
+
166
+ ```bash
167
+ # Basic generation
168
+ rdf-construct shacl-gen ontology.ttl -o shapes.ttl
169
+
170
+ # Strict mode with closed shapes
171
+ rdf-construct shacl-gen ontology.ttl --level strict --closed
172
+ ```
173
+
174
+ ### Ontology Statistics
175
+
176
+ ```bash
177
+ # Display statistics
178
+ rdf-construct stats ontology.ttl
179
+
180
+ # Compare two versions
181
+ rdf-construct stats v1.ttl v2.ttl --compare --format markdown
182
+ ```
183
+
184
+ ### Merge Ontologies
185
+
186
+ ```bash
187
+ # Basic merge
188
+ rdf-construct merge core.ttl extension.ttl -o merged.ttl
189
+
190
+ # With priorities (higher wins conflicts)
191
+ rdf-construct merge core.ttl extension.ttl -o merged.ttl -p 1 -p 2
192
+
193
+ # Generate conflict report
194
+ rdf-construct merge core.ttl extension.ttl -o merged.ttl --report conflicts.md
195
+ ```
196
+
197
+ ### Split Ontologies
198
+ ```bash
199
+ # Split by namespace (auto-detect modules)
200
+ rdf-construct split large.ttl -o modules/ --by-namespace
201
+
202
+ # Split with configuration file
203
+ rdf-construct split large.ttl -o modules/ -c split.yml
204
+
205
+ # Preview what would be created
206
+ rdf-construct split large.ttl -o modules/ --by-namespace --dry-run
207
+ ```
208
+
209
+ ### Refactor Ontologies
210
+ ```bash
211
+ # Fix a typo
212
+ rdf-construct refactor rename ontology.ttl \
213
+ --from "ex:Buiding" --to "ex:Building" -o fixed.ttl
214
+
215
+ # Bulk namespace change
216
+ rdf-construct refactor rename ontology.ttl \
217
+ --from-namespace "http://old/" --to-namespace "http://new/" -o migrated.ttl
218
+
219
+ # Deprecate an entity with replacement
220
+ rdf-construct refactor deprecate ontology.ttl \
221
+ --entity "ex:LegacyClass" --replaced-by "ex:NewClass" \
222
+ --message "Use NewClass instead." -o updated.ttl
223
+
224
+ # Preview changes
225
+ rdf-construct refactor rename ontology.ttl --from "ex:Old" --to "ex:New" --dry-run
226
+ ```
227
+
228
+ ### Multi-Language Translations
229
+ ```bash
230
+ # Extract strings for German translation
231
+ rdf-construct localise extract ontology.ttl --language de -o translations/de.yml
232
+
233
+ # Merge completed translations
234
+ rdf-construct localise merge ontology.ttl translations/de.yml -o localised.ttl
235
+
236
+ # Check translation coverage
237
+ rdf-construct localise report ontology.ttl --languages en,de,fr
238
+ ```
239
+
240
+ ## Documentation
241
+
242
+ 📚 **[Complete Documentation](docs/index.md)** - Start here
243
+
244
+ **For Users**:
245
+ - [Getting Started](docs/user_guides/GETTING_STARTED.md) - 5-minute quick start
246
+ - [Docs Guide](docs/user_guides/DOCS_GUIDE.md) - Documentation generation
247
+ - [UML Guide](docs/user_guides/UML_GUIDE.md) - Complete UML features
248
+ - [PlantUML Import Guide](docs/user_guides/PLANTUML_IMPORT_GUIDE.md) - Diagram-first design
249
+ - [SHACL Guide](docs/user_guides/SHACL_GUIDE.md) - SHACL shape generation
250
+ - [Diff Guide](docs/user_guides/DIFF_GUIDE.md) - Semantic ontology comparison
251
+ - [Lint Guide](docs/user_guides/LINT_GUIDE.md) - Ontology quality checking
252
+ - [CQ Testing Guide](docs/user_guides/CQ_TEST_GUIDE.md) - Competency question testing
253
+ - [Stats Guide](docs/user_guides/STATS_GUIDE.md) - Ontology metrics
254
+ - [Merge Guide](docs/user_guides/MERGE_GUIDE.md) - Combining ontologies
255
+ - [Refactor Guide](docs/user_guides/REFACTOR_GUIDE.md) - Renaming and deprecation
256
+ - [Localise Guide](docs/user_guides/LOCALISE_GUIDE.md) - Multi-language translations
257
+ - [CLI Reference](docs/user_guides/CLI_REFERENCE.md) - All commands and options
258
+
259
+ **For Developers**:
260
+ - [Architecture](docs/dev/ARCHITECTURE.md) - System design
261
+ - [UML Implementation](docs/dev/UML_IMPLEMENTATION.md) - Technical details
262
+ - [Contributing](CONTRIBUTING.md) - Development guide
263
+
264
+ **Additional**:
265
+ - [Code Index](CODE_INDEX.md) - Complete file inventory
266
+ - [Quick Reference](docs/user_guides/QUICK_REFERENCE.md) - Cheat sheet
267
+
268
+ ## Example
269
+
270
+ ### Input (Alphabetically Ordered - Hard to Read)
271
+
272
+ ```turtle
273
+ ex:Bird rdfs:subClassOf ex:Animal .
274
+ ex:Cat rdfs:subClassOf ex:Mammal .
275
+ ex:Dog rdfs:subClassOf ex:Mammal .
276
+ ex:Eagle rdfs:subClassOf ex:Bird .
277
+ ex:Mammal rdfs:subClassOf ex:Animal .
278
+ ex:Sparrow rdfs:subClassOf ex:Bird .
279
+ ```
280
+
281
+ ### Output (Semantically Ordered - Easy to Understand)
282
+
283
+ ```turtle
284
+ # Root class first
285
+ ex:Animal a owl:Class .
286
+
287
+ # Then its direct subclasses
288
+ ex:Mammal rdfs:subClassOf ex:Animal .
289
+ ex:Bird rdfs:subClassOf ex:Animal .
290
+
291
+ # Then their subclasses
292
+ ex:Dog rdfs:subClassOf ex:Mammal .
293
+ ex:Cat rdfs:subClassOf ex:Mammal .
294
+
295
+ ex:Eagle rdfs:subClassOf ex:Bird .
296
+ ex:Sparrow rdfs:subClassOf ex:Bird .
297
+ ```
298
+
299
+ ## Semantic Diff
300
+
301
+ Compare ontology versions and see what actually changed:
302
+
303
+ ```bash
304
+ $ rdf-construct diff v1.0.ttl v1.1.ttl
305
+
306
+ Comparing v1.0.ttl → v1.1.ttl
307
+
308
+ ADDED (2 entities):
309
+ + Class ex:SmartBuilding (subclass of ex:Building)
310
+ + DataProperty ex:energyRating
311
+
312
+ REMOVED (1 entity):
313
+ - Class ex:DeprecatedStructure
314
+
315
+ MODIFIED (1 entity):
316
+ ~ Class ex:Building
317
+ + rdfs:comment "A constructed physical structure."@en
318
+
319
+ Summary: 2 added, 1 removed, 1 modified
320
+ ```
321
+
322
+ Unlike text-based `diff`, semantic diff ignores:
323
+ - Statement reordering
324
+ - Prefix rebinding (`ex:` → `example:`)
325
+ - Whitespace and formatting changes
326
+
327
+ ## Complete Toolkit
328
+
329
+ ### Semantic Ordering
330
+
331
+ **Topological Sort**: Parents before children using Kahn's algorithm
332
+ ```yaml
333
+ profiles:
334
+ logical_topo:
335
+ sections:
336
+ - classes:
337
+ sort: topological
338
+ roots: ["ies:Element"]
339
+ ```
340
+
341
+ **Root-Based Ordering**: Organise by explicit hierarchy
342
+ ```yaml
343
+ sections:
344
+ - classes:
345
+ sort: topological
346
+ roots:
347
+ - ex:Mammal
348
+ - ex:Bird
349
+ ```
350
+
351
+ ### Documentation Generation
352
+
353
+ Generate professional documentation in multiple formats:
354
+
355
+ ```bash
356
+ # HTML with search, navigation, and cross-references
357
+ rdf-construct docs ontology.ttl -o docs/
358
+
359
+ # Markdown for GitHub/GitLab wikis
360
+ rdf-construct docs ontology.ttl --format markdown
361
+
362
+ # JSON for custom rendering
363
+ rdf-construct docs ontology.ttl --format json
364
+ ```
365
+
366
+ ### UML Context System
367
+
368
+ **Root Classes Strategy**: Start from specific concepts
369
+ ```yaml
370
+ animal_taxonomy:
371
+ root_classes: [ex:Animal]
372
+ include_descendants: true
373
+ ```
374
+
375
+ **Focus Classes Strategy**: Hand-pick classes
376
+ ```yaml
377
+ key_concepts:
378
+ focus_classes: [ex:Dog, ex:Cat, ex:Eagle]
379
+ ```
380
+
381
+ **Property Filtering**: Control what relationships show
382
+ ```yaml
383
+ properties:
384
+ mode: domain_based # or connected, explicit, all, none
385
+ ```
386
+
387
+ ### Quality Checking
388
+
389
+ 11 built-in lint rules across three categories:
390
+
391
+ | Category | Rules |
392
+ |----------|-------|
393
+ | Structural | orphan-class, dangling-reference, circular-subclass, property-no-type, empty-ontology |
394
+ | Documentation | missing-label, missing-comment |
395
+ | Best Practice | redundant-subclass, property-no-domain, property-no-range, inconsistent-naming |
396
+
397
+ ### Styling and Layout
398
+
399
+ **Visual Themes**:
400
+ - `default` - Professional blue scheme
401
+ - `high_contrast` - Bold colours for presentations
402
+ - `grayscale` - Black and white for academic papers
403
+ - `minimal` - Bare-bones for debugging
404
+
405
+ **Layout Control**:
406
+ - Direction (top-to-bottom, left-to-right)
407
+ - Arrow hints for hierarchy
408
+ - Spacing and grouping
409
+
410
+ ## Project Status
411
+
412
+ **Current**: v0.2.0 - Feature complete for core ontology workflows
413
+ **License**: MIT
414
+
415
+ ### Implemented
416
+ ✅ RDF semantic ordering
417
+ ✅ Topological sorting with root-based branches
418
+ ✅ Custom Turtle serialisation (preserves order)
419
+ ✅ PlantUML diagram generation from RDF
420
+ ✅ PlantUML to RDF conversion
421
+ ✅ Configurable styling and layouts
422
+ ✅ Semantic diff (compare ontology versions)
423
+ ✅ Documentation generation (HTML, Markdown, JSON)
424
+ ✅ SHACL shape generation
425
+ ✅ Ontology linting (11 rules)
426
+ ✅ Competency question testing
427
+ ✅ Ontology statistics
428
+ ✅ Comprehensive documentation
429
+
430
+ ### (Possible) Roadmap
431
+ - [ ] Multi-format input support (JSON-LD, RDF/XML)
432
+ - [ ] Streaming mode for very large graphs
433
+ - [ ] Web UI for diagram configuration
434
+ - [ ] Additional lint rules
435
+
436
+ ## Contributing
437
+
438
+ Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
439
+
440
+ ```bash
441
+ # Setup development environment
442
+ git clone https://github.com/aigora-de/rdf-construct.git
443
+ cd rdf-construct
444
+ poetry install
445
+ pre-commit install
446
+
447
+ # Run tests
448
+ pytest
449
+
450
+ # Format and lint
451
+ black src/ tests/
452
+ ruff check src/ tests/
453
+ ```
454
+
455
+ ## Dependencies
456
+
457
+ **Runtime**:
458
+ - Python 3.10+
459
+ - rdflib >= 7.0.0
460
+ - click >= 8.1.0
461
+ - pyyaml >= 6.0
462
+ - rich >= 13.0.0
463
+ - jinja2 >= 3.1.0
464
+
465
+ **Development**:
466
+ - black, ruff, mypy
467
+ - pytest, pytest-cov
468
+ - pre-commit
469
+
470
+ ## Inspiration
471
+
472
+ Named after the **ROM construct** from William Gibson's *Neuromancer*—preserved, structured knowledge that can be queried and transformed.
473
+
474
+ The project aims to preserve the semantic structure of RDF ontologies in serialised form, making them as readable and maintainable as the author intended.
475
+
476
+ ## Credits
477
+
478
+ Built on the excellent [rdflib](https://github.com/RDFLib/rdflib) library.
479
+
480
+ Influenced by the need for better RDF tooling in ontology engineering and the [IES (Information Exchange Standard)](http://informationexchangestandard.org/) work.
481
+
482
+ ## License
483
+
484
+ MIT License - see [LICENSE](LICENSE) file for details.
485
+
486
+ ## Links
487
+
488
+ - **Documentation**: [docs/index.md](docs/index.md)
489
+ - **Issues**: https://github.com/aigora-de/rdf-construct/issues
490
+ - **Discussions**: https://github.com/aigora-de/rdf-construct/discussions
491
+
492
+ ---
493
+
494
+ **Status**: v0.2.0
495
+ **Python**: 3.10+ required
496
+ **Maintainer**: See [CONTRIBUTING.md](CONTRIBUTING.md)
@@ -0,0 +1,110 @@
1
+ rdf_construct/__init__.py,sha256=e5m7tDIQo-DDwUaReSPAMMWqkprpShDW6kNQ9Dt19Ws,296
2
+ rdf_construct/__main__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ rdf_construct/cli.py,sha256=ECV8FHgrPkb-439pJQkaW2m6vPvwTS7oZLHIEKnQVts,104784
4
+ rdf_construct/core/__init__.py,sha256=YgxXUPGHgBqToc8u06qksfWh_vx25g2eCg8_X8vg5l4,781
5
+ rdf_construct/core/config.py,sha256=uOAvvZ7keI8o4o6r6ESzHC4AkKHN1Ja2FADiHZqZDaM,3523
6
+ rdf_construct/core/ordering.py,sha256=fGw5aGIY8SpsGgbm1Z1YH5mzlDv7mU7b9Is07ekJxZg,7248
7
+ rdf_construct/core/predicate_order.py,sha256=ITQYC_pWtH6d4JbvOwKjyU7xGL_bSDoHHLQOTac8kMc,6688
8
+ rdf_construct/core/profile.py,sha256=CpA6fNMZKzDQgYa91KMylbfMv9RBiVo3AlUJ91_buzI,5475
9
+ rdf_construct/core/selector.py,sha256=Ie_J3ZcAHYVxk7hP2YzbtJ0oE93CikWBd8cbWq8c9PE,2386
10
+ rdf_construct/core/serialiser.py,sha256=Sba4Bn_8oUzRu6ntwapw215aSHC6B56Z8GSYU1Hsn04,7414
11
+ rdf_construct/core/utils.py,sha256=dhu92LvvNJ21UI7FpdcjW1PaoHPo6UXcgnrofhkO_WE,2557
12
+ rdf_construct/cq/__init__.py,sha256=PDFzRuBjlMKhyaimnOEHDpQ1Ok98xa4T6qtztju4Edw,1832
13
+ rdf_construct/cq/expectations.py,sha256=IHQhKd8-eetyj-jvbGn502vFcL0qoUzX_4IT0GfBSGE,11850
14
+ rdf_construct/cq/formatters/__init__.py,sha256=U5xqneRA1BwB_xWpQm3U_bNLxcBOsZbWhm45R7nwgWI,1275
15
+ rdf_construct/cq/formatters/json.py,sha256=VJixlGV3LY1EPRioQ7bqDi_aQMDWUVTNwk6gjBOIt1U,2932
16
+ rdf_construct/cq/formatters/junit.py,sha256=Jd019364vFZXKfNO6wxBwtlXe7FGPN7OpdE1lIgHUIM,3484
17
+ rdf_construct/cq/formatters/text.py,sha256=GI059SUomtyXDorxlQ7Whc7eHpw9AeyPnkwnwiIndco,4278
18
+ rdf_construct/cq/loader.py,sha256=at224OKu6Y7JKdJU-JRd03_54Q2m0bSCRhZ9R0pWEEU,8771
19
+ rdf_construct/cq/runner.py,sha256=QqkobjHHjxSdO2XeFaOHjBx5wrcokJme94QQhNgDHkA,9930
20
+ rdf_construct/diff/__init__.py,sha256=EewERur1p2ynqpyzwGFzpPS-E5DkA-VJEGO7QX9VhLU,1378
21
+ rdf_construct/diff/change_types.py,sha256=t12h6O6WQSrpSJdzTutuOXLB1fqm8gTob5gIhAfQ8rU,6383
22
+ rdf_construct/diff/comparator.py,sha256=e1bmXPJS-tkyC9Flopl6R8wcP5wHK8Tsk0-ngpUxwDc,10247
23
+ rdf_construct/diff/filters.py,sha256=KSigvCQ8Y9zVHwDagTYGGFueVkmEPvHDRRZXPoPscMQ,4247
24
+ rdf_construct/diff/formatters/__init__.py,sha256=YGcV_CkBnB5YW5BRq9GRqYS9-AIuuaZUH6bg_X03xXs,1694
25
+ rdf_construct/diff/formatters/json.py,sha256=rfh5OVPJW2hVBbWRoPLDuetkQAir40luO9aYXB6t7Vc,5741
26
+ rdf_construct/diff/formatters/markdown.py,sha256=FpoYneZecA81drKODiD0_KKE6DtcjJkGbyrRXTyshlU,5970
27
+ rdf_construct/diff/formatters/text.py,sha256=SRHHSs1eZCBMUQM49FeFYvjh6FU6YrUgOChxnTdE174,5773
28
+ rdf_construct/docs/__init__.py,sha256=pUiKoNsBpjAIrlqu7ERS0M_ODhemqxvmHGfCLGfq6c0,1592
29
+ rdf_construct/docs/config.py,sha256=CD8vrp3Xs_CJFKJzJWGo4G1MaSy-6XX0zQbp4aepJok,7681
30
+ rdf_construct/docs/extractors.py,sha256=mvizOxdZUpe9lzSJjYZWXIgu8azPnUsNVGxujAOFESY,18559
31
+ rdf_construct/docs/generator.py,sha256=_zb2rxI-8zKrDY4H8mlnGQOpoA1ap7lakTPVa2eoLaU,11127
32
+ rdf_construct/docs/renderers/__init__.py,sha256=2wCvhHarnvc87B4xlaFFmCWMPvyWWNsT-Yy_fjL2GHg,226
33
+ rdf_construct/docs/renderers/html.py,sha256=qnV5PcxvSPGjnc0Cp03NbS-fkJqc1f8RZdrCPU0afp8,21549
34
+ rdf_construct/docs/renderers/json.py,sha256=SQf9Fo83NyK1B_3C52aURWxeLXIzd6-GDgqo4sPErhg,12872
35
+ rdf_construct/docs/renderers/markdown.py,sha256=6upSBOS9eNW6nZilwwPuokWUdscWXz7rf4755zvpoSo,20638
36
+ rdf_construct/docs/search.py,sha256=dMkByM9a441JTdpwDcW-42NkD38wlj3cg7qivIqd-os,7991
37
+ rdf_construct/docs/templates/html/base.html.jinja,sha256=vRkwbY4LcsBQ5THFRxBsz-d5BFIYjohT9UsYed0CiLc,1441
38
+ rdf_construct/docs/templates/html/class.html.jinja,sha256=zLccSDhEQ2RD6KZ8Rz4cYSX-ScjH59olFav-Ow2Es5Q,5037
39
+ rdf_construct/docs/templates/html/hierarchy.html.jinja,sha256=pbMgmedPilyBgEUGiR0Hj31qJcVBaIe-nvosidTkk5M,657
40
+ rdf_construct/docs/templates/html/index.html.jinja,sha256=msABJ5mYb1-MKqrhtjaD21Gkp-5FGrVSOAJuMyiU5Rs,3311
41
+ rdf_construct/docs/templates/html/instance.html.jinja,sha256=jhFEq7f4NL_HgonIUoR_-U4Sv8lWG2I9tC8_2Iyq0X4,2807
42
+ rdf_construct/docs/templates/html/namespaces.html.jinja,sha256=ABL0GA-vHXKf1tW6TkJgA1fflYxAGezj3Nh48gYJk0w,850
43
+ rdf_construct/docs/templates/html/property.html.jinja,sha256=8fHsSyMSQDw5Pg5_QiiOIcRGVuTe-7dFtcNHZSBC3os,4051
44
+ rdf_construct/docs/templates/html/single_page.html.jinja,sha256=p1OV6sL0Yw-jgks7uSUJZvn1YY5I9hxj6knYI-iLWCQ,5557
45
+ rdf_construct/lint/__init__.py,sha256=xqC77f3EMhZ3O-TDDG7-e98EtIrT3uJsgBcDWfqe3bo,1418
46
+ rdf_construct/lint/config.py,sha256=aMrP-B8UNlI-8lgegG0i6go_7UzXOmctskcEWZ3iL-s,5967
47
+ rdf_construct/lint/engine.py,sha256=Eppc9ax6FiAPWVQa71xBM2tKCDd9mhFL8VYplMhjAGE,12362
48
+ rdf_construct/lint/formatters.py,sha256=IG6jPXn0YmyNAc2PnU5ZcPluGPQHnUt5PCysPuq7tMc,10019
49
+ rdf_construct/lint/rules.py,sha256=qkC_cGNMnd9fnq13dP30Hzao_1paZt_iS8y3t_6PEMk,22177
50
+ rdf_construct/localise/__init__.py,sha256=fKPOZ_TzvvQ-Yz_hR733sy5wM4zArpp4D-hyVO8HTdo,2659
51
+ rdf_construct/localise/config.py,sha256=7n0Ld1zT5YYNahB3DXeqbQpu4SFdd1lniXWlRK5wBOQ,15847
52
+ rdf_construct/localise/extractor.py,sha256=HxIjNi8EiOHQ_IcN48Os2RRoQIlBOi1aUolWFzbbgE8,13592
53
+ rdf_construct/localise/formatters/__init__.py,sha256=i2Mlo62BBUs7ywhncr6GDK4nVzdzdRB6EtSpdTZCw_w,948
54
+ rdf_construct/localise/formatters/markdown.py,sha256=ayKbma2SsO3pr5KIaJElU3-nqilxawXGnoUl1thwNUw,7572
55
+ rdf_construct/localise/formatters/text.py,sha256=AESBDjD89QzhkaMMq4UZYHM0bffLVnRAgOg8U7Es8jA,7596
56
+ rdf_construct/localise/merger.py,sha256=X5Wj_bKHWeiR4XqRxFvKVbCuklBneuvscoDDC0PnnbI,10480
57
+ rdf_construct/localise/reporter.py,sha256=idsMsKbzR2JXhJNBvVGz504fpIMMfh6R5Mi3_rtDeq4,10828
58
+ rdf_construct/main.py,sha256=k3Lm5MY9gO_q-mIchCoUMOJU5veeQSXHPEGzICUZ5NU,107
59
+ rdf_construct/merge/__init__.py,sha256=mK2cWplLhPsGoDbNGh9PPGm8AGeQ8w3n1mBH0JReCxM,3730
60
+ rdf_construct/merge/config.py,sha256=AelWI6AMmLwR7o-y7PEIypQrMlgL4j2Heswsw_hS6TA,10415
61
+ rdf_construct/merge/conflicts.py,sha256=3sTvIm5L_g8aNkjwkDaB660HMaM4rliBSTqels0RaFU,8944
62
+ rdf_construct/merge/formatters.py,sha256=OsMicZUMoLTmPZkgs6VQTeoB484fRfkEyCrlUt5yHdQ,14810
63
+ rdf_construct/merge/merger.py,sha256=kF3JNy3Ze0KB_cGs_RyC05U99f1ly7ULYsMak7LR0_c,13651
64
+ rdf_construct/merge/migrator.py,sha256=6_4AUxf8PL0CWQVuItsSxVyoEg-ClYsPY_F9GckCqjg,11318
65
+ rdf_construct/merge/rules.py,sha256=-Txf1-EuSMhWnGVNwnoI4Dt-qtxUQ5f5zfDDlCigzMw,11663
66
+ rdf_construct/merge/splitter.py,sha256=rom12dbPANi01KFmF8oY6J7-4526uMuQuZZLP2jDesg,36006
67
+ rdf_construct/puml2rdf/__init__.py,sha256=H6OCPA15ucd3snMNA08Nsnf3LJYizTwZrFRzmXQnd44,2247
68
+ rdf_construct/puml2rdf/config.py,sha256=FwTR--KsS2i5dwKi81LUZ9QcGF4h9OF1LquJl_dlhqw,7200
69
+ rdf_construct/puml2rdf/converter.py,sha256=uvhAdotxKP8uXP3X0XFsLjnP1cCNGcKkbqrbobPIwl4,14669
70
+ rdf_construct/puml2rdf/merger.py,sha256=xEyk5d6AoeA49d-7mYhqgeEExCDxCakcgvdofOoe27U,6528
71
+ rdf_construct/puml2rdf/model.py,sha256=L73spx4XTmo99i1SfeNNoKMOXRMPA7MsUWonDSydsgE,6187
72
+ rdf_construct/puml2rdf/parser.py,sha256=I_8nF6wPcuZGZ5ihRUd8t42AoDSs_Hv1OhRjS_Zlyds,18608
73
+ rdf_construct/puml2rdf/validators.py,sha256=PiY9uJdiDUn08uRd4R2by9gD_KQWIOdLEzzOv1Akybg,15313
74
+ rdf_construct/refactor/__init__.py,sha256=PDIAdn04OVKqKzwVb6OIS5e4i30GIp3kicL354pTmuk,1814
75
+ rdf_construct/refactor/config.py,sha256=6kX5RuNFh1EN0_fbIQ6Ti4pQx4H_YO8tRlmZRFEjd5s,10490
76
+ rdf_construct/refactor/deprecator.py,sha256=mxCTXMcpLKm1eXBu8RXK2bR2LkREso1R7f4Kpah2GoA,10742
77
+ rdf_construct/refactor/formatters/__init__.py,sha256=_iz4UXCPvZv-xhgVAOKrP1d3Mtv0wN5koYlVR64X5fs,216
78
+ rdf_construct/refactor/formatters/text.py,sha256=QgrTTQi83OTYWW4VWMCygy22PCln2HhADwrld135i2k,11777
79
+ rdf_construct/refactor/renamer.py,sha256=20CFQe7SuKSIqpmqr3LMIi11qVV3gboFCqO9yvn0HyY,9300
80
+ rdf_construct/shacl/__init__.py,sha256=ft45S6QvDvNCZAKqdbbs8tM5xC1dzh2wLUp9FAMz3X0,1488
81
+ rdf_construct/shacl/config.py,sha256=eVJGEjiqyLpvBpz4i8F0YsCLjow6TGEvNxkk37dwBhA,5499
82
+ rdf_construct/shacl/converters.py,sha256=vtqNcZcUqhJxyAo27-KlAUT7I4ylnvZBAy3mrtxCIsM,17827
83
+ rdf_construct/shacl/generator.py,sha256=s2UPoV6Mxb2Ps4i2xvrtQZgGRRaZ2TNVWthSep2DHP4,12206
84
+ rdf_construct/shacl/namespaces.py,sha256=bw00jYDS0t0SiPqSzvNOIUVaqzNXD2Di79PDPR6z8aQ,1807
85
+ rdf_construct/stats/__init__.py,sha256=1lBwUEpsWo2Nc0Qmn0FeKS4Tjk4kHmWSoANrHYFWjA0,649
86
+ rdf_construct/stats/collector.py,sha256=kx50rXp0yUX4dLYjXgNhCEkd8OVzVGJiqeP2YqSR5Nk,7084
87
+ rdf_construct/stats/comparator.py,sha256=lWCOcew-xB0Q6rcDF9hY8ZgD0Q0v14RKX_kwDg4PbJM,10347
88
+ rdf_construct/stats/formatters/__init__.py,sha256=S6U2skVbKnWTrEUwvc7SxzHMS-LzVXUePdRMEJzKMPw,2405
89
+ rdf_construct/stats/formatters/json.py,sha256=V8yjib5cF4ekFEfNZOcCGuN5HUIxnKxYE_JBUE13rhE,967
90
+ rdf_construct/stats/formatters/markdown.py,sha256=rEBXGolzD1D5zapUGXs80pDPcl1q3yUFT-fqwWDGM1U,5351
91
+ rdf_construct/stats/formatters/text.py,sha256=lOvvg8KS_0FJxI6BNU7ZF2HpfT7u-k4Op--vtrFS7nU,6876
92
+ rdf_construct/stats/metrics/__init__.py,sha256=F94As1xuaGF6nJFQ3yLqzADa3fCFfxR5FN5YX42LkvM,957
93
+ rdf_construct/stats/metrics/basic.py,sha256=S950-qhBxZzriyx0tGJ1AWIaleDTnHAP5LuyYP3FMu4,4003
94
+ rdf_construct/stats/metrics/complexity.py,sha256=Omlr_5O7LlTGdLHU5wgcDaGhLcnWBR1UmSfeHbMjJcc,4107
95
+ rdf_construct/stats/metrics/connectivity.py,sha256=UMpO7Fx4ELyfuekvf6vEPqZMyQPetQFWMWQvqRzCFHs,3777
96
+ rdf_construct/stats/metrics/documentation.py,sha256=6XExTtd2BjgY0EM2AOvyIXqidfcOO_j8DbYPHtizlBo,3770
97
+ rdf_construct/stats/metrics/hierarchy.py,sha256=EodpxowJaD9gTTXyLq-dvmpda9UfYD7mSzeWLJoFCAY,6125
98
+ rdf_construct/stats/metrics/properties.py,sha256=seerFOY9m-g-15vUXM5SCKpUZpMzrL1gmcmBxnTgxm4,2780
99
+ rdf_construct/uml/__init__.py,sha256=9IRGqCEt8DvLhsa6YUfg4_f9_Pnj2QGsqLqlQ43yWK8,591
100
+ rdf_construct/uml/context.py,sha256=4VEs_-HZxBo9YIuX5phPhmYn_FVmThfFP0elu7ORGJg,7161
101
+ rdf_construct/uml/mapper.py,sha256=_I-DIrBhqTE7UhJmtNbboKyyK3XR39zsshni6ix32NA,12466
102
+ rdf_construct/uml/odm_renderer.py,sha256=X4QqzWXJ-FX64ZIfu0Nx6gpHbEQsJOo2hq2fbY3KaOQ,26222
103
+ rdf_construct/uml/renderer.py,sha256=Zj3udsghxXqJ5NPqvVSoIK177Vtzh-fFgsDzYxF5OoY,23755
104
+ rdf_construct/uml/uml_layout.py,sha256=PBd_qOBJzDq2N8SCqDJqgAoFmYnzZC4jrLgCQ4biYBM,13217
105
+ rdf_construct/uml/uml_style.py,sha256=ngVqmbS18Y4mAi9ggtL26IeVF5VbcOIOvalvI62jSO4,21876
106
+ rdf_construct-0.3.0.dist-info/METADATA,sha256=kSO1Rk3M4FTjDBSFi9RMqDwTSIJzA2cetZp4-IgqXno,14937
107
+ rdf_construct-0.3.0.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
108
+ rdf_construct-0.3.0.dist-info/entry_points.txt,sha256=L4Mh7BDMt2BUHq_x9BwyPVZmZ-j_wifbD574Zm3qXZY,55
109
+ rdf_construct-0.3.0.dist-info/licenses/LICENSE,sha256=Fh-f4K2IlA0QH5XThePUIoG6_J_UqDkQyihGfvHcvpk,1061
110
+ rdf_construct-0.3.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: poetry-core 2.2.1
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ rdf-construct=rdf_construct.cli:cli
3
+
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Dave
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.