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.
- rdf_construct/__init__.py +12 -0
- rdf_construct/__main__.py +0 -0
- rdf_construct/cli.py +3429 -0
- rdf_construct/core/__init__.py +33 -0
- rdf_construct/core/config.py +116 -0
- rdf_construct/core/ordering.py +219 -0
- rdf_construct/core/predicate_order.py +212 -0
- rdf_construct/core/profile.py +157 -0
- rdf_construct/core/selector.py +64 -0
- rdf_construct/core/serialiser.py +232 -0
- rdf_construct/core/utils.py +89 -0
- rdf_construct/cq/__init__.py +77 -0
- rdf_construct/cq/expectations.py +365 -0
- rdf_construct/cq/formatters/__init__.py +45 -0
- rdf_construct/cq/formatters/json.py +104 -0
- rdf_construct/cq/formatters/junit.py +104 -0
- rdf_construct/cq/formatters/text.py +146 -0
- rdf_construct/cq/loader.py +300 -0
- rdf_construct/cq/runner.py +321 -0
- rdf_construct/diff/__init__.py +59 -0
- rdf_construct/diff/change_types.py +214 -0
- rdf_construct/diff/comparator.py +338 -0
- rdf_construct/diff/filters.py +133 -0
- rdf_construct/diff/formatters/__init__.py +71 -0
- rdf_construct/diff/formatters/json.py +192 -0
- rdf_construct/diff/formatters/markdown.py +210 -0
- rdf_construct/diff/formatters/text.py +195 -0
- rdf_construct/docs/__init__.py +60 -0
- rdf_construct/docs/config.py +238 -0
- rdf_construct/docs/extractors.py +603 -0
- rdf_construct/docs/generator.py +360 -0
- rdf_construct/docs/renderers/__init__.py +7 -0
- rdf_construct/docs/renderers/html.py +803 -0
- rdf_construct/docs/renderers/json.py +390 -0
- rdf_construct/docs/renderers/markdown.py +628 -0
- rdf_construct/docs/search.py +278 -0
- rdf_construct/docs/templates/html/base.html.jinja +44 -0
- rdf_construct/docs/templates/html/class.html.jinja +152 -0
- rdf_construct/docs/templates/html/hierarchy.html.jinja +28 -0
- rdf_construct/docs/templates/html/index.html.jinja +110 -0
- rdf_construct/docs/templates/html/instance.html.jinja +90 -0
- rdf_construct/docs/templates/html/namespaces.html.jinja +37 -0
- rdf_construct/docs/templates/html/property.html.jinja +124 -0
- rdf_construct/docs/templates/html/single_page.html.jinja +169 -0
- rdf_construct/lint/__init__.py +75 -0
- rdf_construct/lint/config.py +214 -0
- rdf_construct/lint/engine.py +396 -0
- rdf_construct/lint/formatters.py +327 -0
- rdf_construct/lint/rules.py +692 -0
- rdf_construct/localise/__init__.py +114 -0
- rdf_construct/localise/config.py +508 -0
- rdf_construct/localise/extractor.py +427 -0
- rdf_construct/localise/formatters/__init__.py +36 -0
- rdf_construct/localise/formatters/markdown.py +229 -0
- rdf_construct/localise/formatters/text.py +224 -0
- rdf_construct/localise/merger.py +346 -0
- rdf_construct/localise/reporter.py +356 -0
- rdf_construct/main.py +6 -0
- rdf_construct/merge/__init__.py +165 -0
- rdf_construct/merge/config.py +354 -0
- rdf_construct/merge/conflicts.py +281 -0
- rdf_construct/merge/formatters.py +426 -0
- rdf_construct/merge/merger.py +425 -0
- rdf_construct/merge/migrator.py +339 -0
- rdf_construct/merge/rules.py +377 -0
- rdf_construct/merge/splitter.py +1102 -0
- rdf_construct/puml2rdf/__init__.py +103 -0
- rdf_construct/puml2rdf/config.py +230 -0
- rdf_construct/puml2rdf/converter.py +420 -0
- rdf_construct/puml2rdf/merger.py +200 -0
- rdf_construct/puml2rdf/model.py +202 -0
- rdf_construct/puml2rdf/parser.py +565 -0
- rdf_construct/puml2rdf/validators.py +451 -0
- rdf_construct/refactor/__init__.py +72 -0
- rdf_construct/refactor/config.py +362 -0
- rdf_construct/refactor/deprecator.py +328 -0
- rdf_construct/refactor/formatters/__init__.py +8 -0
- rdf_construct/refactor/formatters/text.py +311 -0
- rdf_construct/refactor/renamer.py +294 -0
- rdf_construct/shacl/__init__.py +56 -0
- rdf_construct/shacl/config.py +166 -0
- rdf_construct/shacl/converters.py +520 -0
- rdf_construct/shacl/generator.py +364 -0
- rdf_construct/shacl/namespaces.py +93 -0
- rdf_construct/stats/__init__.py +29 -0
- rdf_construct/stats/collector.py +178 -0
- rdf_construct/stats/comparator.py +298 -0
- rdf_construct/stats/formatters/__init__.py +83 -0
- rdf_construct/stats/formatters/json.py +38 -0
- rdf_construct/stats/formatters/markdown.py +153 -0
- rdf_construct/stats/formatters/text.py +186 -0
- rdf_construct/stats/metrics/__init__.py +26 -0
- rdf_construct/stats/metrics/basic.py +147 -0
- rdf_construct/stats/metrics/complexity.py +137 -0
- rdf_construct/stats/metrics/connectivity.py +130 -0
- rdf_construct/stats/metrics/documentation.py +128 -0
- rdf_construct/stats/metrics/hierarchy.py +207 -0
- rdf_construct/stats/metrics/properties.py +88 -0
- rdf_construct/uml/__init__.py +22 -0
- rdf_construct/uml/context.py +194 -0
- rdf_construct/uml/mapper.py +371 -0
- rdf_construct/uml/odm_renderer.py +789 -0
- rdf_construct/uml/renderer.py +684 -0
- rdf_construct/uml/uml_layout.py +393 -0
- rdf_construct/uml/uml_style.py +613 -0
- rdf_construct-0.3.0.dist-info/METADATA +496 -0
- rdf_construct-0.3.0.dist-info/RECORD +110 -0
- rdf_construct-0.3.0.dist-info/WHEEL +4 -0
- rdf_construct-0.3.0.dist-info/entry_points.txt +3 -0
- rdf_construct-0.3.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{% extends "base.html.jinja" %}
|
|
2
|
+
|
|
3
|
+
{% block title %}{{ instance_info.label or instance_info.qname }} - {{ ontology.title or "Documentation" }}{% endblock %}
|
|
4
|
+
|
|
5
|
+
{% block content %}
|
|
6
|
+
<article class="entity-card">
|
|
7
|
+
<h1>{{ instance_info.label or instance_info.qname }} <span class="entity-type instance">Instance</span></h1>
|
|
8
|
+
<p class="uri">{{ instance_info.uri }}</p>
|
|
9
|
+
|
|
10
|
+
{% if instance_info.definition %}
|
|
11
|
+
<p class="definition">{{ instance_info.definition }}</p>
|
|
12
|
+
{% endif %}
|
|
13
|
+
|
|
14
|
+
{% if instance_info.types %}
|
|
15
|
+
<section class="section">
|
|
16
|
+
<h3>Types</h3>
|
|
17
|
+
<ul class="entity-list">
|
|
18
|
+
{% for uri in instance_info.types %}
|
|
19
|
+
<li>
|
|
20
|
+
{% set found = namespace(value=false) %}
|
|
21
|
+
{% for c in classes %}
|
|
22
|
+
{% if c.uri|string == uri|string %}
|
|
23
|
+
<a href="{{ c.qname | entity_url('class') }}">{{ c.label or c.qname }}</a>
|
|
24
|
+
{% set found.value = true %}
|
|
25
|
+
{% endif %}
|
|
26
|
+
{% endfor %}
|
|
27
|
+
{% if not found.value %}
|
|
28
|
+
<code>{{ uri }}</code>
|
|
29
|
+
{% endif %}
|
|
30
|
+
</li>
|
|
31
|
+
{% endfor %}
|
|
32
|
+
</ul>
|
|
33
|
+
</section>
|
|
34
|
+
{% endif %}
|
|
35
|
+
|
|
36
|
+
{% if instance_info.properties %}
|
|
37
|
+
<section class="section">
|
|
38
|
+
<h3>Properties</h3>
|
|
39
|
+
<table>
|
|
40
|
+
<thead>
|
|
41
|
+
<tr>
|
|
42
|
+
<th>Property</th>
|
|
43
|
+
<th>Value</th>
|
|
44
|
+
</tr>
|
|
45
|
+
</thead>
|
|
46
|
+
<tbody>
|
|
47
|
+
{% for pred, values in instance_info.properties.items() %}
|
|
48
|
+
{% for value in values %}
|
|
49
|
+
<tr>
|
|
50
|
+
<td><code>{{ pred }}</code></td>
|
|
51
|
+
<td>
|
|
52
|
+
{% if value is string %}
|
|
53
|
+
{{ value }}
|
|
54
|
+
{% else %}
|
|
55
|
+
<code>{{ value }}</code>
|
|
56
|
+
{% endif %}
|
|
57
|
+
</td>
|
|
58
|
+
</tr>
|
|
59
|
+
{% endfor %}
|
|
60
|
+
{% endfor %}
|
|
61
|
+
</tbody>
|
|
62
|
+
</table>
|
|
63
|
+
</section>
|
|
64
|
+
{% endif %}
|
|
65
|
+
|
|
66
|
+
{% if instance_info.annotations %}
|
|
67
|
+
<section class="section">
|
|
68
|
+
<h3>Annotations</h3>
|
|
69
|
+
<table>
|
|
70
|
+
<thead>
|
|
71
|
+
<tr>
|
|
72
|
+
<th>Property</th>
|
|
73
|
+
<th>Value</th>
|
|
74
|
+
</tr>
|
|
75
|
+
</thead>
|
|
76
|
+
<tbody>
|
|
77
|
+
{% for name, values in instance_info.annotations.items() %}
|
|
78
|
+
{% for value in values %}
|
|
79
|
+
<tr>
|
|
80
|
+
<td><code>{{ name }}</code></td>
|
|
81
|
+
<td>{{ value }}</td>
|
|
82
|
+
</tr>
|
|
83
|
+
{% endfor %}
|
|
84
|
+
{% endfor %}
|
|
85
|
+
</tbody>
|
|
86
|
+
</table>
|
|
87
|
+
</section>
|
|
88
|
+
{% endif %}
|
|
89
|
+
</article>
|
|
90
|
+
{% endblock %}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{% extends "base.html.jinja" %}
|
|
2
|
+
|
|
3
|
+
{% block title %}Namespaces - {{ ontology.title or "Documentation" }}{% endblock %}
|
|
4
|
+
|
|
5
|
+
{% block content %}
|
|
6
|
+
<h2>Namespaces</h2>
|
|
7
|
+
|
|
8
|
+
{% if ontology.namespaces %}
|
|
9
|
+
<table>
|
|
10
|
+
<thead>
|
|
11
|
+
<tr>
|
|
12
|
+
<th>Prefix</th>
|
|
13
|
+
<th>Namespace URI</th>
|
|
14
|
+
</tr>
|
|
15
|
+
</thead>
|
|
16
|
+
<tbody>
|
|
17
|
+
{% for prefix, namespace in ontology.namespaces.items() | sort %}
|
|
18
|
+
<tr>
|
|
19
|
+
<td><code>{{ prefix }}</code></td>
|
|
20
|
+
<td><code>{{ namespace }}</code></td>
|
|
21
|
+
</tr>
|
|
22
|
+
{% endfor %}
|
|
23
|
+
</tbody>
|
|
24
|
+
</table>
|
|
25
|
+
{% else %}
|
|
26
|
+
<p>No namespaces defined.</p>
|
|
27
|
+
{% endif %}
|
|
28
|
+
|
|
29
|
+
{% if ontology.imports %}
|
|
30
|
+
<h2>Imports</h2>
|
|
31
|
+
<ul class="entity-list">
|
|
32
|
+
{% for uri in ontology.imports %}
|
|
33
|
+
<li><a href="{{ uri }}" target="_blank"><code>{{ uri }}</code></a></li>
|
|
34
|
+
{% endfor %}
|
|
35
|
+
</ul>
|
|
36
|
+
{% endif %}
|
|
37
|
+
{% endblock %}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
{% extends "base.html.jinja" %}
|
|
2
|
+
|
|
3
|
+
{% block title %}{{ property_info.label or property_info.qname }} - {{ ontology.title or "Documentation" }}{% endblock %}
|
|
4
|
+
|
|
5
|
+
{% block content %}
|
|
6
|
+
<article class="entity-card">
|
|
7
|
+
<h1>
|
|
8
|
+
{{ property_info.label or property_info.qname }}
|
|
9
|
+
<span class="entity-type {{ property_info.property_type }}">{{ property_info.property_type }} property</span>
|
|
10
|
+
</h1>
|
|
11
|
+
<p class="uri">{{ property_info.uri }}</p>
|
|
12
|
+
|
|
13
|
+
{% if property_info.definition %}
|
|
14
|
+
<p class="definition">{{ property_info.definition }}</p>
|
|
15
|
+
{% endif %}
|
|
16
|
+
|
|
17
|
+
{% if property_info.domain %}
|
|
18
|
+
<section class="section">
|
|
19
|
+
<h3>Domain</h3>
|
|
20
|
+
<ul class="entity-list">
|
|
21
|
+
{% for uri in property_info.domain %}
|
|
22
|
+
<li>
|
|
23
|
+
{% set found = namespace(value=false) %}
|
|
24
|
+
{% for c in classes %}
|
|
25
|
+
{% if c.uri|string == uri|string %}
|
|
26
|
+
<a href="{{ c.qname | entity_url('class') }}">{{ c.label or c.qname }}</a>
|
|
27
|
+
{% set found.value = true %}
|
|
28
|
+
{% endif %}
|
|
29
|
+
{% endfor %}
|
|
30
|
+
{% if not found.value %}
|
|
31
|
+
<code>{{ uri }}</code>
|
|
32
|
+
{% endif %}
|
|
33
|
+
</li>
|
|
34
|
+
{% endfor %}
|
|
35
|
+
</ul>
|
|
36
|
+
</section>
|
|
37
|
+
{% endif %}
|
|
38
|
+
|
|
39
|
+
{% if property_info.range %}
|
|
40
|
+
<section class="section">
|
|
41
|
+
<h3>Range</h3>
|
|
42
|
+
<ul class="entity-list">
|
|
43
|
+
{% for uri in property_info.range %}
|
|
44
|
+
<li>
|
|
45
|
+
{% set found = namespace(value=false) %}
|
|
46
|
+
{% for c in classes %}
|
|
47
|
+
{% if c.uri|string == uri|string %}
|
|
48
|
+
<a href="{{ c.qname | entity_url('class') }}">{{ c.label or c.qname }}</a>
|
|
49
|
+
{% set found.value = true %}
|
|
50
|
+
{% endif %}
|
|
51
|
+
{% endfor %}
|
|
52
|
+
{% if not found.value %}
|
|
53
|
+
<code>{{ uri }}</code>
|
|
54
|
+
{% endif %}
|
|
55
|
+
</li>
|
|
56
|
+
{% endfor %}
|
|
57
|
+
</ul>
|
|
58
|
+
</section>
|
|
59
|
+
{% endif %}
|
|
60
|
+
|
|
61
|
+
{% if property_info.is_functional or property_info.is_inverse_functional or property_info.inverse_of %}
|
|
62
|
+
<section class="section">
|
|
63
|
+
<h3>Characteristics</h3>
|
|
64
|
+
<ul class="entity-list">
|
|
65
|
+
{% if property_info.is_functional %}
|
|
66
|
+
<li><span class="annotation">Functional</span></li>
|
|
67
|
+
{% endif %}
|
|
68
|
+
{% if property_info.is_inverse_functional %}
|
|
69
|
+
<li><span class="annotation">Inverse Functional</span></li>
|
|
70
|
+
{% endif %}
|
|
71
|
+
{% if property_info.inverse_of %}
|
|
72
|
+
<li>Inverse of: <code>{{ property_info.inverse_of }}</code></li>
|
|
73
|
+
{% endif %}
|
|
74
|
+
</ul>
|
|
75
|
+
</section>
|
|
76
|
+
{% endif %}
|
|
77
|
+
|
|
78
|
+
{% if property_info.superproperties %}
|
|
79
|
+
<section class="section">
|
|
80
|
+
<h3>Superproperties</h3>
|
|
81
|
+
<ul class="entity-list">
|
|
82
|
+
{% for uri in property_info.superproperties %}
|
|
83
|
+
<li><code>{{ uri }}</code></li>
|
|
84
|
+
{% endfor %}
|
|
85
|
+
</ul>
|
|
86
|
+
</section>
|
|
87
|
+
{% endif %}
|
|
88
|
+
|
|
89
|
+
{% if property_info.subproperties %}
|
|
90
|
+
<section class="section">
|
|
91
|
+
<h3>Subproperties</h3>
|
|
92
|
+
<ul class="entity-list">
|
|
93
|
+
{% for uri in property_info.subproperties %}
|
|
94
|
+
<li><code>{{ uri }}</code></li>
|
|
95
|
+
{% endfor %}
|
|
96
|
+
</ul>
|
|
97
|
+
</section>
|
|
98
|
+
{% endif %}
|
|
99
|
+
|
|
100
|
+
{% if property_info.annotations %}
|
|
101
|
+
<section class="section">
|
|
102
|
+
<h3>Annotations</h3>
|
|
103
|
+
<table>
|
|
104
|
+
<thead>
|
|
105
|
+
<tr>
|
|
106
|
+
<th>Property</th>
|
|
107
|
+
<th>Value</th>
|
|
108
|
+
</tr>
|
|
109
|
+
</thead>
|
|
110
|
+
<tbody>
|
|
111
|
+
{% for name, values in property_info.annotations.items() %}
|
|
112
|
+
{% for value in values %}
|
|
113
|
+
<tr>
|
|
114
|
+
<td><code>{{ name }}</code></td>
|
|
115
|
+
<td>{{ value }}</td>
|
|
116
|
+
</tr>
|
|
117
|
+
{% endfor %}
|
|
118
|
+
{% endfor %}
|
|
119
|
+
</tbody>
|
|
120
|
+
</table>
|
|
121
|
+
</section>
|
|
122
|
+
{% endif %}
|
|
123
|
+
</article>
|
|
124
|
+
{% endblock %}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
{% extends "base.html.jinja" %}
|
|
2
|
+
|
|
3
|
+
{% block title %}{{ ontology.title or "Ontology Documentation" }}{% endblock %}
|
|
4
|
+
|
|
5
|
+
{% block content %}
|
|
6
|
+
<nav class="toc">
|
|
7
|
+
<h2>Contents</h2>
|
|
8
|
+
<ul>
|
|
9
|
+
<li><a href="#classes">Classes</a></li>
|
|
10
|
+
<li><a href="#object-properties">Object Properties</a></li>
|
|
11
|
+
<li><a href="#datatype-properties">Datatype Properties</a></li>
|
|
12
|
+
{% if annotation_properties %}
|
|
13
|
+
<li><a href="#annotation-properties">Annotation Properties</a></li>
|
|
14
|
+
{% endif %}
|
|
15
|
+
{% if instances and config.include_instances %}
|
|
16
|
+
<li><a href="#instances">Instances</a></li>
|
|
17
|
+
{% endif %}
|
|
18
|
+
<li><a href="#namespaces">Namespaces</a></li>
|
|
19
|
+
</ul>
|
|
20
|
+
</nav>
|
|
21
|
+
|
|
22
|
+
<section class="stats">
|
|
23
|
+
<div class="stat-card">
|
|
24
|
+
<div class="number">{{ classes | length }}</div>
|
|
25
|
+
<div class="label">Classes</div>
|
|
26
|
+
</div>
|
|
27
|
+
<div class="stat-card">
|
|
28
|
+
<div class="number">{{ object_properties | length + datatype_properties | length }}</div>
|
|
29
|
+
<div class="label">Properties</div>
|
|
30
|
+
</div>
|
|
31
|
+
{% if instances %}
|
|
32
|
+
<div class="stat-card">
|
|
33
|
+
<div class="number">{{ instances | length }}</div>
|
|
34
|
+
<div class="label">Instances</div>
|
|
35
|
+
</div>
|
|
36
|
+
{% endif %}
|
|
37
|
+
</section>
|
|
38
|
+
|
|
39
|
+
<section id="classes">
|
|
40
|
+
<h2>Classes</h2>
|
|
41
|
+
{% for class_info in classes %}
|
|
42
|
+
<article class="entity-card" id="class-{{ class_info.qname | qname_local }}">
|
|
43
|
+
<h3>{{ class_info.label or class_info.qname }}</h3>
|
|
44
|
+
<p class="uri">{{ class_info.uri }}</p>
|
|
45
|
+
{% if class_info.definition %}
|
|
46
|
+
<p class="definition">{{ class_info.definition }}</p>
|
|
47
|
+
{% endif %}
|
|
48
|
+
{% if class_info.superclasses %}
|
|
49
|
+
<p><strong>Superclasses:</strong>
|
|
50
|
+
{% for uri in class_info.superclasses %}
|
|
51
|
+
<code>{{ uri }}</code>{% if not loop.last %}, {% endif %}
|
|
52
|
+
{% endfor %}
|
|
53
|
+
</p>
|
|
54
|
+
{% endif %}
|
|
55
|
+
</article>
|
|
56
|
+
{% endfor %}
|
|
57
|
+
</section>
|
|
58
|
+
|
|
59
|
+
<section id="object-properties">
|
|
60
|
+
<h2>Object Properties</h2>
|
|
61
|
+
{% for prop in object_properties %}
|
|
62
|
+
<article class="entity-card" id="prop-{{ prop.qname | qname_local }}">
|
|
63
|
+
<h3>{{ prop.label or prop.qname }} <span class="entity-type object">Object</span></h3>
|
|
64
|
+
<p class="uri">{{ prop.uri }}</p>
|
|
65
|
+
{% if prop.definition %}
|
|
66
|
+
<p class="definition">{{ prop.definition }}</p>
|
|
67
|
+
{% endif %}
|
|
68
|
+
{% if prop.domain %}
|
|
69
|
+
<p><strong>Domain:</strong>
|
|
70
|
+
{% for uri in prop.domain %}
|
|
71
|
+
<code>{{ uri }}</code>{% if not loop.last %}, {% endif %}
|
|
72
|
+
{% endfor %}
|
|
73
|
+
</p>
|
|
74
|
+
{% endif %}
|
|
75
|
+
{% if prop.range %}
|
|
76
|
+
<p><strong>Range:</strong>
|
|
77
|
+
{% for uri in prop.range %}
|
|
78
|
+
<code>{{ uri }}</code>{% if not loop.last %}, {% endif %}
|
|
79
|
+
{% endfor %}
|
|
80
|
+
</p>
|
|
81
|
+
{% endif %}
|
|
82
|
+
</article>
|
|
83
|
+
{% endfor %}
|
|
84
|
+
</section>
|
|
85
|
+
|
|
86
|
+
<section id="datatype-properties">
|
|
87
|
+
<h2>Datatype Properties</h2>
|
|
88
|
+
{% for prop in datatype_properties %}
|
|
89
|
+
<article class="entity-card" id="prop-{{ prop.qname | qname_local }}">
|
|
90
|
+
<h3>{{ prop.label or prop.qname }} <span class="entity-type datatype">Datatype</span></h3>
|
|
91
|
+
<p class="uri">{{ prop.uri }}</p>
|
|
92
|
+
{% if prop.definition %}
|
|
93
|
+
<p class="definition">{{ prop.definition }}</p>
|
|
94
|
+
{% endif %}
|
|
95
|
+
{% if prop.domain %}
|
|
96
|
+
<p><strong>Domain:</strong>
|
|
97
|
+
{% for uri in prop.domain %}
|
|
98
|
+
<code>{{ uri }}</code>{% if not loop.last %}, {% endif %}
|
|
99
|
+
{% endfor %}
|
|
100
|
+
</p>
|
|
101
|
+
{% endif %}
|
|
102
|
+
{% if prop.range %}
|
|
103
|
+
<p><strong>Range:</strong>
|
|
104
|
+
{% for uri in prop.range %}
|
|
105
|
+
<code>{{ uri }}</code>{% if not loop.last %}, {% endif %}
|
|
106
|
+
{% endfor %}
|
|
107
|
+
</p>
|
|
108
|
+
{% endif %}
|
|
109
|
+
</article>
|
|
110
|
+
{% endfor %}
|
|
111
|
+
</section>
|
|
112
|
+
|
|
113
|
+
{% if annotation_properties %}
|
|
114
|
+
<section id="annotation-properties">
|
|
115
|
+
<h2>Annotation Properties</h2>
|
|
116
|
+
{% for prop in annotation_properties %}
|
|
117
|
+
<article class="entity-card" id="prop-{{ prop.qname | qname_local }}">
|
|
118
|
+
<h3>{{ prop.label or prop.qname }} <span class="entity-type annotation">Annotation</span></h3>
|
|
119
|
+
<p class="uri">{{ prop.uri }}</p>
|
|
120
|
+
{% if prop.definition %}
|
|
121
|
+
<p class="definition">{{ prop.definition }}</p>
|
|
122
|
+
{% endif %}
|
|
123
|
+
</article>
|
|
124
|
+
{% endfor %}
|
|
125
|
+
</section>
|
|
126
|
+
{% endif %}
|
|
127
|
+
|
|
128
|
+
{% if instances and config.include_instances %}
|
|
129
|
+
<section id="instances">
|
|
130
|
+
<h2>Instances</h2>
|
|
131
|
+
{% for inst in instances %}
|
|
132
|
+
<article class="entity-card" id="inst-{{ inst.qname | qname_local }}">
|
|
133
|
+
<h3>{{ inst.label or inst.qname }} <span class="entity-type instance">Instance</span></h3>
|
|
134
|
+
<p class="uri">{{ inst.uri }}</p>
|
|
135
|
+
{% if inst.definition %}
|
|
136
|
+
<p class="definition">{{ inst.definition }}</p>
|
|
137
|
+
{% endif %}
|
|
138
|
+
{% if inst.types %}
|
|
139
|
+
<p><strong>Types:</strong>
|
|
140
|
+
{% for uri in inst.types %}
|
|
141
|
+
<code>{{ uri }}</code>{% if not loop.last %}, {% endif %}
|
|
142
|
+
{% endfor %}
|
|
143
|
+
</p>
|
|
144
|
+
{% endif %}
|
|
145
|
+
</article>
|
|
146
|
+
{% endfor %}
|
|
147
|
+
</section>
|
|
148
|
+
{% endif %}
|
|
149
|
+
|
|
150
|
+
<section id="namespaces">
|
|
151
|
+
<h2>Namespaces</h2>
|
|
152
|
+
<table>
|
|
153
|
+
<thead>
|
|
154
|
+
<tr>
|
|
155
|
+
<th>Prefix</th>
|
|
156
|
+
<th>Namespace URI</th>
|
|
157
|
+
</tr>
|
|
158
|
+
</thead>
|
|
159
|
+
<tbody>
|
|
160
|
+
{% for prefix, namespace in ontology.namespaces.items() | sort %}
|
|
161
|
+
<tr>
|
|
162
|
+
<td><code>{{ prefix }}</code></td>
|
|
163
|
+
<td><code>{{ namespace }}</code></td>
|
|
164
|
+
</tr>
|
|
165
|
+
{% endfor %}
|
|
166
|
+
</tbody>
|
|
167
|
+
</table>
|
|
168
|
+
</section>
|
|
169
|
+
{% endblock %}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"""RDF ontology linting module.
|
|
2
|
+
|
|
3
|
+
Provides static analysis for RDF ontologies to detect quality issues,
|
|
4
|
+
structural problems, and best practice violations.
|
|
5
|
+
|
|
6
|
+
Example usage:
|
|
7
|
+
|
|
8
|
+
from rdf_construct.lint import LintEngine, LintConfig
|
|
9
|
+
|
|
10
|
+
# Basic usage
|
|
11
|
+
engine = LintEngine()
|
|
12
|
+
result = engine.lint_file(Path("ontology.ttl"))
|
|
13
|
+
|
|
14
|
+
for issue in result.issues:
|
|
15
|
+
print(issue)
|
|
16
|
+
|
|
17
|
+
# With configuration
|
|
18
|
+
config = LintConfig(level="strict")
|
|
19
|
+
engine = LintEngine(config)
|
|
20
|
+
|
|
21
|
+
# Multiple files
|
|
22
|
+
summary = engine.lint_files([Path("a.ttl"), Path("b.ttl")])
|
|
23
|
+
print(f"Exit code: {summary.exit_code}")
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
from .rules import (
|
|
27
|
+
LintIssue,
|
|
28
|
+
RuleSpec,
|
|
29
|
+
Severity,
|
|
30
|
+
get_all_rules,
|
|
31
|
+
get_rule,
|
|
32
|
+
list_rules,
|
|
33
|
+
)
|
|
34
|
+
from .engine import (
|
|
35
|
+
LintConfig,
|
|
36
|
+
LintEngine,
|
|
37
|
+
LintResult,
|
|
38
|
+
LintSummary,
|
|
39
|
+
)
|
|
40
|
+
from .config import (
|
|
41
|
+
load_lint_config,
|
|
42
|
+
find_config_file,
|
|
43
|
+
create_default_config,
|
|
44
|
+
)
|
|
45
|
+
from .formatters import (
|
|
46
|
+
Formatter,
|
|
47
|
+
TextFormatter,
|
|
48
|
+
JsonFormatter,
|
|
49
|
+
get_formatter,
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
__all__ = [
|
|
54
|
+
# Rules
|
|
55
|
+
"LintIssue",
|
|
56
|
+
"RuleSpec",
|
|
57
|
+
"Severity",
|
|
58
|
+
"get_all_rules",
|
|
59
|
+
"get_rule",
|
|
60
|
+
"list_rules",
|
|
61
|
+
# Engine
|
|
62
|
+
"LintConfig",
|
|
63
|
+
"LintEngine",
|
|
64
|
+
"LintResult",
|
|
65
|
+
"LintSummary",
|
|
66
|
+
# Config
|
|
67
|
+
"load_lint_config",
|
|
68
|
+
"find_config_file",
|
|
69
|
+
"create_default_config",
|
|
70
|
+
# Formatters
|
|
71
|
+
"Formatter",
|
|
72
|
+
"TextFormatter",
|
|
73
|
+
"JsonFormatter",
|
|
74
|
+
"get_formatter",
|
|
75
|
+
]
|