sp-ontolint 2.1.0rc1__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 (113) hide show
  1. sp_ontolint-2.1.0rc1/LICENSE +15 -0
  2. sp_ontolint-2.1.0rc1/LICENSE-APACHE +201 -0
  3. sp_ontolint-2.1.0rc1/LICENSE-MIT +21 -0
  4. sp_ontolint-2.1.0rc1/PKG-INFO +259 -0
  5. sp_ontolint-2.1.0rc1/pyproject.toml +84 -0
  6. sp_ontolint-2.1.0rc1/readme.md +226 -0
  7. sp_ontolint-2.1.0rc1/src/ontolint/__init__.py +19 -0
  8. sp_ontolint-2.1.0rc1/src/ontolint/__main__.py +4 -0
  9. sp_ontolint-2.1.0rc1/src/ontolint/api.py +218 -0
  10. sp_ontolint-2.1.0rc1/src/ontolint/checks/__init__.py +8 -0
  11. sp_ontolint-2.1.0rc1/src/ontolint/checks/annotations.py +355 -0
  12. sp_ontolint-2.1.0rc1/src/ontolint/checks/metadata.py +294 -0
  13. sp_ontolint-2.1.0rc1/src/ontolint/checks/namespaces.py +363 -0
  14. sp_ontolint-2.1.0rc1/src/ontolint/checks/structure.py +201 -0
  15. sp_ontolint-2.1.0rc1/src/ontolint/checks/uniqueness.py +272 -0
  16. sp_ontolint-2.1.0rc1/src/ontolint/cli.py +256 -0
  17. sp_ontolint-2.1.0rc1/src/ontolint/config.py +335 -0
  18. sp_ontolint-2.1.0rc1/src/ontolint/dqv.py +621 -0
  19. sp_ontolint-2.1.0rc1/src/ontolint/graphutil.py +36 -0
  20. sp_ontolint-2.1.0rc1/src/ontolint/loading.py +136 -0
  21. sp_ontolint-2.1.0rc1/src/ontolint/model.py +287 -0
  22. sp_ontolint-2.1.0rc1/src/ontolint/profiling.py +238 -0
  23. sp_ontolint-2.1.0rc1/src/ontolint/queries.py +58 -0
  24. sp_ontolint-2.1.0rc1/src/ontolint/registry.py +104 -0
  25. sp_ontolint-2.1.0rc1/src/ontolint/report/__init__.py +7 -0
  26. sp_ontolint-2.1.0rc1/src/ontolint/report/ctrf.py +76 -0
  27. sp_ontolint-2.1.0rc1/src/ontolint/report/ctrf_summary.py +294 -0
  28. sp_ontolint-2.1.0rc1/src/ontolint/report/markdown.py +285 -0
  29. sp_ontolint-2.1.0rc1/src/ontolint/report/templates/ctrf-report.hbs +31 -0
  30. sp_ontolint-2.1.0rc1/src/ontolint/resolution.py +179 -0
  31. sp_ontolint-2.1.0rc1/src/ontolint/runner.py +178 -0
  32. sp_ontolint-2.1.0rc1/src/ontolint/sparql/average_branching_factor.sparql +9 -0
  33. sp_ontolint-2.1.0rc1/src/ontolint/sparql/cardinality_restrictions.sparql +7 -0
  34. sp_ontolint-2.1.0rc1/src/ontolint/sparql/class_comments.sparql +20 -0
  35. sp_ontolint-2.1.0rc1/src/ontolint/sparql/class_connectivity.sparql +33 -0
  36. sp_ontolint-2.1.0rc1/src/ontolint/sparql/class_labels.sparql +19 -0
  37. sp_ontolint-2.1.0rc1/src/ontolint/sparql/class_missing_comment.sparql +38 -0
  38. sp_ontolint-2.1.0rc1/src/ontolint/sparql/class_missing_label.sparql +38 -0
  39. sp_ontolint-2.1.0rc1/src/ontolint/sparql/class_same_label.sparql +40 -0
  40. sp_ontolint-2.1.0rc1/src/ontolint/sparql/classes_in_node_shape.sparql +18 -0
  41. sp_ontolint-2.1.0rc1/src/ontolint/sparql/count_cp.sparql +36 -0
  42. sp_ontolint-2.1.0rc1/src/ontolint/sparql/deprecated_class.sparql +16 -0
  43. sp_ontolint-2.1.0rc1/src/ontolint/sparql/deprecated_property.sparql +16 -0
  44. sp_ontolint-2.1.0rc1/src/ontolint/sparql/dr_property.sparql +11 -0
  45. sp_ontolint-2.1.0rc1/src/ontolint/sparql/external_resource.sparql +25 -0
  46. sp_ontolint-2.1.0rc1/src/ontolint/sparql/hierarchy_depth.sparql +10 -0
  47. sp_ontolint-2.1.0rc1/src/ontolint/sparql/hijacking.sparql +17 -0
  48. sp_ontolint-2.1.0rc1/src/ontolint/sparql/hijacking_count.sparql +15 -0
  49. sp_ontolint-2.1.0rc1/src/ontolint/sparql/hijacking_fallback.sparql +28 -0
  50. sp_ontolint-2.1.0rc1/src/ontolint/sparql/isolated_classes.sparql +29 -0
  51. sp_ontolint-2.1.0rc1/src/ontolint/sparql/leaf_classes.sparql +12 -0
  52. sp_ontolint-2.1.0rc1/src/ontolint/sparql/missing_annotations.sparql +27 -0
  53. sp_ontolint-2.1.0rc1/src/ontolint/sparql/missing_disjoints.sparql +11 -0
  54. sp_ontolint-2.1.0rc1/src/ontolint/sparql/missing_dr_property.sparql +13 -0
  55. sp_ontolint-2.1.0rc1/src/ontolint/sparql/multiple_dr.sparql +15 -0
  56. sp_ontolint-2.1.0rc1/src/ontolint/sparql/node_shape.sparql +6 -0
  57. sp_ontolint-2.1.0rc1/src/ontolint/sparql/node_shape_comments.sparql +20 -0
  58. sp_ontolint-2.1.0rc1/src/ontolint/sparql/node_shape_labels.sparql +19 -0
  59. sp_ontolint-2.1.0rc1/src/ontolint/sparql/node_shape_missing_comment.sparql +22 -0
  60. sp_ontolint-2.1.0rc1/src/ontolint/sparql/node_shape_missing_label.sparql +21 -0
  61. sp_ontolint-2.1.0rc1/src/ontolint/sparql/node_shape_same_label.sparql +22 -0
  62. sp_ontolint-2.1.0rc1/src/ontolint/sparql/owl_declaration.sparql +6 -0
  63. sp_ontolint-2.1.0rc1/src/ontolint/sparql/owl_description.sparql +18 -0
  64. sp_ontolint-2.1.0rc1/src/ontolint/sparql/owl_imports.sparql +6 -0
  65. sp_ontolint-2.1.0rc1/src/ontolint/sparql/owl_no_description.sparql +22 -0
  66. sp_ontolint-2.1.0rc1/src/ontolint/sparql/polysemous.sparql +14 -0
  67. sp_ontolint-2.1.0rc1/src/ontolint/sparql/property_comments.sparql +32 -0
  68. sp_ontolint-2.1.0rc1/src/ontolint/sparql/property_in_property_shape.sparql +23 -0
  69. sp_ontolint-2.1.0rc1/src/ontolint/sparql/property_labels.sparql +32 -0
  70. sp_ontolint-2.1.0rc1/src/ontolint/sparql/property_missing_comment.sparql +48 -0
  71. sp_ontolint-2.1.0rc1/src/ontolint/sparql/property_missing_label.sparql +46 -0
  72. sp_ontolint-2.1.0rc1/src/ontolint/sparql/property_same_label.sparql +48 -0
  73. sp_ontolint-2.1.0rc1/src/ontolint/sparql/property_shape.sparql +10 -0
  74. sp_ontolint-2.1.0rc1/src/ontolint/sparql/property_shape_comments.sparql +25 -0
  75. sp_ontolint-2.1.0rc1/src/ontolint/sparql/property_shape_labels.sparql +24 -0
  76. sp_ontolint-2.1.0rc1/src/ontolint/sparql/property_shape_missing_comment.sparql +27 -0
  77. sp_ontolint-2.1.0rc1/src/ontolint/sparql/property_shape_missing_label.sparql +26 -0
  78. sp_ontolint-2.1.0rc1/src/ontolint/sparql/property_shape_same_label.sparql +28 -0
  79. sp_ontolint-2.1.0rc1/src/ontolint/sparql/return_instances.sparql +13 -0
  80. sp_ontolint-2.1.0rc1/src/ontolint/sparql/subclass_cycles.sparql +7 -0
  81. sp_ontolint-2.1.0rc1/src/ontolint/sparql/subclass_inference_rule.sparql +16 -0
  82. sp_ontolint-2.1.0rc1/src/ontolint/sparql/tangledness.sparql +9 -0
  83. sp_ontolint-2.1.0rc1/src/ontolint/sparql/unique_identifiers.sparql +23 -0
  84. sp_ontolint-2.1.0rc1/src/ontolint/sparql/untyped_class.sparql +43 -0
  85. sp_ontolint-2.1.0rc1/src/ontolint/sparql/untyped_property.sparql +28 -0
  86. sp_ontolint-2.1.0rc1/src/ontolint/sparql/validation_query.sparql +20 -0
  87. sp_ontolint-2.1.0rc1/src/ontolint/sparql/wrong_property_chain.sparql +9 -0
  88. sp_ontolint-2.1.0rc1/src/ontolint/terms.py +83 -0
  89. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/README.md +71 -0
  90. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/catalog.ttl +549 -0
  91. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/dash.ttl +2366 -0
  92. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/dc.ttl +146 -0
  93. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/dcam.ttl +43 -0
  94. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/dcat3.ttl +1840 -0
  95. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/dcterms.ttl +868 -0
  96. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/dctype.ttl +122 -0
  97. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/dqv.ttl +186 -0
  98. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/foaf.ttl +727 -0
  99. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/odrl.ttl +2274 -0
  100. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/org.ttl +1059 -0
  101. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/owl.ttl +570 -0
  102. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/prov.ttl +2466 -0
  103. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/rdf.ttl +227 -0
  104. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/rdfs.ttl +121 -0
  105. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/schema-https.ttl +21324 -0
  106. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/schema.ttl +21324 -0
  107. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/shacl.ttl +1665 -0
  108. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/skos.ttl +288 -0
  109. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/time.ttl +1785 -0
  110. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/vann.ttl +70 -0
  111. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/vcard.ttl +991 -0
  112. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/vs.ttl +40 -0
  113. sp_ontolint-2.1.0rc1/src/ontolint/vocabularies/xsd.ttl +100 -0
@@ -0,0 +1,15 @@
1
+ Copyright (c) 2026 Semantic Partners Ltd
2
+
3
+ This project is dual-licensed under either of
4
+
5
+ * Apache License, Version 2.0
6
+ ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
7
+ * MIT license
8
+ ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT)
9
+
10
+ at your option.
11
+
12
+ Unless you explicitly state otherwise, any contribution intentionally
13
+ submitted for inclusion in this project by you, as defined in the
14
+ Apache-2.0 license, shall be dual licensed as above, without any
15
+ additional terms or conditions.
@@ -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 2026 Semantic Partners Ltd
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,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Semantic Partners Ltd
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.
@@ -0,0 +1,259 @@
1
+ Metadata-Version: 2.4
2
+ Name: sp-ontolint
3
+ Version: 2.1.0rc1
4
+ Summary: Get an instant, user-friendly snapshot of your ontology’s size and health, right in your CI pipeline
5
+ License-Expression: MIT OR Apache-2.0
6
+ License-File: LICENSE
7
+ License-File: LICENSE-APACHE
8
+ License-File: LICENSE-MIT
9
+ Keywords: ontology,rdf,owl,shacl,sparql,lint,quality,dqv,ci
10
+ Author: Otello M Roscioni
11
+ Author-email: otello.roscioni@semanticpartners.com
12
+ Requires-Python: >=3.11
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Intended Audience :: Science/Research
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Scientific/Engineering :: Information Analysis
24
+ Classifier: Topic :: Software Development :: Quality Assurance
25
+ Requires-Dist: networkx (>=3.2,<4.0)
26
+ Requires-Dist: pyyaml (>=6.0.3,<7.0.0)
27
+ Requires-Dist: rdflib (>=7.6.0,<8.0.0)
28
+ Project-URL: Documentation, https://github.com/Semantic-partners/ontolint/tree/main/docs
29
+ Project-URL: Homepage, https://github.com/Semantic-partners/ontolint
30
+ Project-URL: Issues, https://github.com/Semantic-partners/ontolint/issues
31
+ Description-Content-Type: text/markdown
32
+
33
+ # Ontolint
34
+
35
+ Get an instant, user-friendly snapshot of your ontology’s size and health, right in your CI pipeline. This tool profiles your ontology file (triples, classes, properties, etc.) and runs quality checks (declarations, descriptions, versioning, structure), then produces a clear report so you can track complexity over time, catch regressions early, and keep your ontology consistently high-quality.
36
+
37
+ ## What it's for
38
+
39
+ - **Gating changes in CI.** Run it on every pull request: a failing check fails the build,
40
+ and the report lands in the job summary.
41
+ - **Catching what review misses.** Missing labels and descriptions, duplicate labels,
42
+ typos in core-vocabulary terms (`skos:scopNote`), imports that don't resolve, subclass
43
+ cycles, terms minted in someone else's namespace.
44
+ - **Tracking an ontology over time.** Profiling counts classes, properties, shapes,
45
+ hierarchy depth and more, so growth and complexity are visible run to run.
46
+ - **Feeding other tools.** Results come as Markdown for people, CTRF JSON for CI
47
+ dashboards and W3C DQV (RDF) for anything that reads RDF.
48
+
49
+ It reads Turtle, RDF/XML, OWL, N-Triples, JSON-LD and TriG, checks offline against bundled
50
+ copies of the core vocabularies, and only goes to the network for vocabularies it doesn't
51
+ have.
52
+
53
+ ## What's in the repository
54
+
55
+ | Path | What it is |
56
+ |---|---|
57
+ | [`src/ontolint/`](https://github.com/Semantic-partners/ontolint/tree/main/src/ontolint) | The Python package: the checks, the `ontolint` command and the API |
58
+ | [`src/ontolint/sparql/`](https://github.com/Semantic-partners/ontolint/tree/main/src/ontolint/sparql) | The SPARQL queries behind the checks and metrics |
59
+ | [`src/ontolint/vocabularies/`](https://github.com/Semantic-partners/ontolint/tree/main/src/ontolint/vocabularies) | Bundled copies of the core vocabularies, for offline checking |
60
+ | [`action.yml`](https://github.com/Semantic-partners/ontolint/blob/main/action.yml) | The GitHub Action |
61
+ | [`ontology/olq.ttl`](https://github.com/Semantic-partners/ontolint/blob/main/ontology/olq.ttl) | The `olq:` vocabulary used in DQV reports |
62
+ | [`examples/`](https://github.com/Semantic-partners/ontolint/tree/main/examples) | A CI workflow to copy |
63
+ | [`docs/`](https://github.com/Semantic-partners/ontolint/tree/main/docs) | Reference for the action, the API, the configuration and the reports |
64
+ | [`tests/`](https://github.com/Semantic-partners/ontolint/tree/main/tests) | The test suite, including example ontologies and the reports they produce |
65
+
66
+ ## Install
67
+
68
+ ```bash
69
+ pip install git+https://github.com/Semantic-partners/ontolint
70
+ ```
71
+
72
+ Ontolint needs Python 3.11 or later. This installs the `ontolint` and `ontolint-report`
73
+ commands and the `ontolint` Python package.
74
+
75
+ The [`ontolint` package on PyPI](https://pypi.org/project/ontolint/) is an unrelated
76
+ project, so `pip install ontolint` does not install this one.
77
+
78
+ ## Use it
79
+
80
+ ### From the command line
81
+
82
+ ```bash
83
+ ontolint my-ontology.ttl # report to stdout, CTRF JSON to ./ctrf/
84
+ ontolint ontologies/ -e # exit 1 if any check fails — for CI
85
+ ontolint ontologies/ --per-file # check each file on its own
86
+ ontolint my-ontology.ttl -v # also list every offending resource
87
+ ontolint my-ontology.ttl -p # profiling only, no checks
88
+ ontolint my-ontology.ttl --dqv-dir out/ # also write the DQV (RDF) report
89
+ ontolint --init # write a starter .rdf-lint.yml
90
+ ```
91
+
92
+ Given several files or a directory, ontolint checks them as one merged graph unless you pass
93
+ `--per-file`. `ontolint --help` lists every option. `ontolint-report --ctrf-dir ctrf`
94
+ combines CTRF files into one Markdown summary.
95
+
96
+ ### In GitHub Actions
97
+
98
+ ```yaml
99
+ jobs:
100
+ ontolint:
101
+ runs-on: ubuntu-latest
102
+ steps:
103
+ - uses: actions/checkout@v5
104
+ - uses: Semantic-partners/ontolint@main
105
+ with:
106
+ ontology-paths: ontologies/
107
+ ```
108
+
109
+ The action posts the report to the job summary and uploads the CTRF files. Inputs, outputs
110
+ and multi-ontology setups are in the
111
+ [action reference](https://github.com/Semantic-partners/ontolint/blob/main/docs/github-action.md).
112
+
113
+ ### From Python
114
+
115
+ `lint()` checks graphs you already hold and returns the DQV report as a graph — no files,
116
+ no subprocess:
117
+
118
+ ```python
119
+ import rdflib
120
+ from ontolint import Config, lint
121
+
122
+ report: rdflib.Graph = lint(
123
+ [activities_graph, parties_graph],
124
+ config=Config(per_file=True, imports=[schema_graph]),
125
+ )
126
+ ```
127
+
128
+ `Config` and `lint` are the whole supported API. `Config` takes the same settings as the
129
+ config file:
130
+
131
+ | Field | Type | Default | `.rdf-lint.yml` / CLI equivalent |
132
+ |---|---|---|---|
133
+ | `per_file` | `bool` | `False` | `--per-file` |
134
+ | `imports` | `Iterable[Graph \| str \| PathLike]`, or a mapping of those by IRI | `{}` | `imports.local` — a vocabulary may be a graph as well as a path, and needs no key |
135
+ | `ignore_imports` | `Sequence[IRI]` | `()` | `imports.ignore` |
136
+ | `exclude_types` | `Sequence[IRI]` | `()` | `exclude.types` |
137
+ | `skip_object_of` | `Sequence[IRI] \| None` | `None` | `undefined-terms.skip-object-of` (`None` keeps the defaults) |
138
+ | `resolve_siblings` | `bool` | `True` | `imports.siblings` |
139
+ | `checks` | `Sequence[str] \| None` | `None` (all) | the `enable:` list |
140
+ | `base_iri` | `IRI \| None` | `urn:ontolint:` | `--base-uri` |
141
+ | `inference` | `bool` | `False` | `-i` / `--inference` |
142
+ | `uri_parser` | `Callable[[str], Graph] \| None` | fetch over the network | — pass a callable that raises to forbid network access |
143
+
144
+ Naming datasets, reading pass/fail from the report and the rest are in the
145
+ [API reference](https://github.com/Semantic-partners/ontolint/blob/main/docs/python-api.md).
146
+
147
+ ## What it measures
148
+
149
+ ### Profiling metrics
150
+
151
+ Counted on every run, reported but never failed:
152
+
153
+ | Metric | What it counts |
154
+ |---|---|
155
+ | Number of triples | Triples in the graph |
156
+ | Class count | `owl:Class` and `rdfs:Class` |
157
+ | Property count | `rdf:Property`, `owl:ObjectProperty` and `owl:DatatypeProperty` |
158
+ | NodeShape count | `sh:NodeShape` |
159
+ | PropertyShape count | `sh:PropertyShape` |
160
+ | Local classes in NodeShapes | Classes that are also a `sh:NodeShape`, or are the `sh:targetClass` of one |
161
+ | Local properties in PropertyShapes | Properties that are the `sh:path` of a `sh:PropertyShape` |
162
+ | Deprecated classes / properties | `owl:DeprecatedClass` and `owl:DeprecatedProperty` |
163
+ | Vocabularies used | Namespaces declared with a prefix |
164
+ | Ontologies imported | `owl:imports` |
165
+ | Hierarchy depth | Levels from a root class to a leaf |
166
+ | Average branching factor | Subclasses per class |
167
+ | Cardinality restrictions | `owl:Restriction`s with `owl:cardinality`, `owl:minCardinality` or `owl:maxCardinality` |
168
+
169
+ ### Checks
170
+
171
+ Every check runs by default. Each is named as it appears in `.rdf-lint.yml`; the severity
172
+ is recorded in the DQV report, and with `-e` any failing check fails the run.
173
+
174
+ | Check | Fails when | Severity |
175
+ |---|---|---|
176
+ | `owl-declaration` | A processed file has no `owl:Ontology` declaration | Violation |
177
+ | `one-ontology-per-file` | One input declares more than one `owl:Ontology` | Violation |
178
+ | `owl-description` | The ontology has no `rdfs:comment`, `dcterms:abstract` or `dcterms:description` | Violation |
179
+ | `owl-imports` | An `owl:imports` target can't be resolved or is empty | Violation |
180
+ | `undefined-terms` | A term is defined neither locally nor in its vocabulary (bundled, local or fetched) | Violation |
181
+ | `class-missing-label` | A class has no label (`rdfs:label`, `skos:prefLabel`, … or a local subproperty of `rdfs:label`) | Violation |
182
+ | `property-missing-label` | A property has no label | Violation |
183
+ | `node-shape-missing-label` | A SHACL NodeShape has no label | Violation |
184
+ | `property-shape-missing-label` | A SHACL PropertyShape has no label | Violation |
185
+ | `class-missing-comment` | A class has no description (`rdfs:comment`, `dcterms:description`, `skos:definition`, … or a local subproperty of `rdfs:comment`) | Warning |
186
+ | `property-missing-comment` | A property has no description | Warning |
187
+ | `node-shape-missing-comment` | A SHACL NodeShape has no description | Warning |
188
+ | `property-shape-missing-comment` | A SHACL PropertyShape has no description | Warning |
189
+ | `class-same-label` | Two classes share a label in the same language, with the same predicate | Violation |
190
+ | `property-same-label` | Two properties share a label | Violation |
191
+ | `node-shape-same-label` | Two SHACL NodeShapes share a label | Violation |
192
+ | `property-shape-same-label` | Two SHACL PropertyShapes share a label | Violation |
193
+ | `isolated-classes` | A class is declared but not connected to the rest of the ontology | Warning |
194
+ | `property-missing-domain` | A property has no `rdfs:domain` | Warning |
195
+ | `property-missing-range` | A property has no `rdfs:range` | Warning |
196
+ | `unique-identifiers` | One IRI is declared as more than one kind of class or property | Violation |
197
+ | `subclass-cycles` | A class is part of an `rdfs:subClassOf` cycle | Violation |
198
+ | `untyped-class` | A term in the ontology's namespace is used as a class but not declared as one | Violation |
199
+ | `untyped-property` | A term in the ontology's namespace is used as a property but not declared as one | Violation |
200
+ | `hijacking` | A resource is defined in an external vocabulary's namespace | Violation |
201
+
202
+ Across the inputs of one run, ontolint also reports `duplicate-ontology-iri` when two
203
+ inputs declare the same `owl:Ontology` IRI.
204
+
205
+ ## Configure it
206
+
207
+ Put a `.rdf-lint.yml` in the directory you run from (or pass `-c path`). Every key is
208
+ optional:
209
+
210
+ ```yaml
211
+ disable: # or `enable:` to run only the checks listed
212
+ - property-missing-domain
213
+ - property-missing-range
214
+
215
+ exclude:
216
+ types: # skip instances of these types in the class checks
217
+ - rdf:PropositionForm
218
+
219
+ undefined-terms:
220
+ skip-object-of: # replaces the default list of reference properties
221
+ - rdfs:seeAlso
222
+
223
+ imports:
224
+ ignore: # trusted: never fetched or reported
225
+ - http://example.org/vendor/ns#
226
+ local: # resolve a namespace or import from a file
227
+ https://example.org/partner/ontology: vocab/partner.ttl
228
+ siblings: true # resolve against the other inputs of the run (default)
229
+ ```
230
+
231
+ Core vocabularies (RDF, RDFS, OWL, XSD, SHACL, SKOS, Dublin Core, FOAF, PROV, DCAT,
232
+ schema.org and more) are bundled, so terms in them are checked offline with no
233
+ configuration. Every setting, with its defaults, is in the
234
+ [configuration reference](https://github.com/Semantic-partners/ontolint/blob/main/docs/configuration.md).
235
+
236
+ ## Reports
237
+
238
+ Each run's results come out as Markdown for a reader, CTRF JSON for CI tooling and,
239
+ optionally, W3C DQV Turtle with one node per violation. The formats, and worked DQV
240
+ examples, are in the
241
+ [reports reference](https://github.com/Semantic-partners/ontolint/blob/main/docs/reports.md).
242
+
243
+ ## Contributing
244
+
245
+ See [DEVELOPING.md](https://github.com/Semantic-partners/ontolint/blob/main/DEVELOPING.md)
246
+ for setup, the code layout and the tests, and
247
+ [design.md](https://github.com/Semantic-partners/ontolint/blob/main/design.md) for how a run
248
+ is put together. The backlog is a
249
+ [GitHub project](https://github.com/orgs/Semantic-partners/projects/3).
250
+
251
+ ## License
252
+
253
+ Licensed under either of
254
+
255
+ * Apache License, Version 2.0 ([LICENSE-APACHE](https://github.com/Semantic-partners/ontolint/blob/main/LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0)
256
+ * MIT license ([LICENSE-MIT](https://github.com/Semantic-partners/ontolint/blob/main/LICENSE-MIT) or http://opensource.org/licenses/MIT)
257
+
258
+ at your option.
259
+
@@ -0,0 +1,84 @@
1
+ [project]
2
+ # The distribution name on PyPI. `ontolint` there is an unrelated project, so ours is
3
+ # sp-ontolint; what users import and run is still `ontolint` (packages, scripts below).
4
+ name = "sp-ontolint"
5
+ # Cosmetic: the release workflow stamps the version from the pushed tag (see RELEASING.md).
6
+ version = "2.1.0rc1"
7
+ description = "Get an instant, user-friendly snapshot of your ontology’s size and health, right in your CI pipeline"
8
+ license = "MIT OR Apache-2.0"
9
+ authors = [
10
+ {name = "Otello M Roscioni", email = "otello.roscioni@semanticpartners.com"},
11
+ {name = "Simon Shapiro"},
12
+ {name = "John Placek", email = "john.placek@semanticpartners.com"},
13
+ {name = "Pel Olson"},
14
+ ]
15
+ readme = "readme.md"
16
+ # Every version in this range is tested in CI (tests.yml), and publish.yml runs the same
17
+ # matrix before anything is uploaded.
18
+ requires-python = ">=3.11"
19
+ keywords = ["ontology", "rdf", "owl", "shacl", "sparql", "lint", "quality", "dqv", "ci"]
20
+ classifiers = [
21
+ "Development Status :: 4 - Beta",
22
+ "Intended Audience :: Developers",
23
+ "Intended Audience :: Science/Research",
24
+ "Operating System :: OS Independent",
25
+ "Programming Language :: Python :: 3",
26
+ "Programming Language :: Python :: 3 :: Only",
27
+ "Programming Language :: Python :: 3.11",
28
+ "Programming Language :: Python :: 3.12",
29
+ "Programming Language :: Python :: 3.13",
30
+ "Programming Language :: Python :: 3.14",
31
+ "Topic :: Scientific/Engineering :: Information Analysis",
32
+ "Topic :: Software Development :: Quality Assurance",
33
+ ]
34
+ dependencies = [
35
+ "rdflib (>=7.6.0,<8.0.0)",
36
+ "pyyaml (>=6.0.3,<7.0.0)",
37
+ "networkx (>=3.2,<4.0)"
38
+ ]
39
+
40
+ [project.urls]
41
+ Homepage = "https://github.com/Semantic-partners/ontolint"
42
+ Documentation = "https://github.com/Semantic-partners/ontolint/tree/main/docs"
43
+ Issues = "https://github.com/Semantic-partners/ontolint/issues"
44
+
45
+ [project.scripts]
46
+ ontolint = "ontolint.cli:main"
47
+ ontolint-report = "ontolint.report.ctrf_summary:main"
48
+
49
+ [build-system]
50
+ requires = ["poetry-core>=2.0.0,<3.0.0"]
51
+ build-backend = "poetry.core.masonry.api"
52
+
53
+ [tool.poetry]
54
+ packages = [{ include = "ontolint", from = "src" }]
55
+
56
+ [tool.poetry.group.dev.dependencies]
57
+ pytest = ">=8.3"
58
+ pytest-cov = ">=5.0"
59
+ ruff = ">=0.9"
60
+ # mustrd: SPARQL Given-When-Then specs (*.mustrd.ttl, listed in tests/mustrd_configuration.ttl).
61
+ # Pinned to a release candidate: 0.8.0rc5 is the first on PyPI with pytest 8+ / numpy 2
62
+ # support (Python 3.14) that no longer pins coverage and flake8. Move to 0.8.0 once it is
63
+ # out. The python range matches requires-python (mustrd needs an upper bound).
64
+ mustrd = { version = "0.8.0rc5", python = ">=3.11,<4.0" }
65
+ pytest-xdist = ">=3.6"
66
+
67
+ [tool.pytest.ini_options]
68
+ testpaths = ["tests"]
69
+ pythonpath = ["."]
70
+ # --mustrd runs the SPARQL Given-When-Then specs (*.mustrd.ttl) listed in tests/mustrd_configuration.ttl.
71
+ addopts = "-v --cov=ontolint --cov-report=xml --mustrd --config=tests/mustrd_configuration.ttl"
72
+
73
+ [tool.coverage.run]
74
+ source = ["ontolint"]
75
+ omit = ["tests/*"]
76
+
77
+ [tool.coverage.report]
78
+ show_missing = true
79
+
80
+ [tool.ruff]
81
+ src = ["src", "tests"]
82
+
83
+ [tool.ruff.lint]
84
+ ignore = ["E701"] # inline `if x: y` — intentional style in this codebase