iolanta 2.1.10__py3-none-any.whl → 2.1.12__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.
- iolanta/facets/facet.py +15 -9
- iolanta/facets/mermaid_roadmap/__init__.py +0 -0
- iolanta/facets/mermaid_roadmap/facet.py +133 -0
- iolanta/facets/mermaid_roadmap/inference/blocks.sparql +13 -0
- iolanta/facets/mermaid_roadmap/inference/has-task-default-type.sparql +16 -0
- iolanta/facets/mermaid_roadmap/inference/task.sparql +26 -0
- iolanta/facets/mermaid_roadmap/inference/unblocked.sparql +21 -0
- iolanta/facets/mermaid_roadmap/mermaid_roadmap.yamlld +59 -0
- iolanta/facets/mermaid_roadmap/sparql/edges.sparql +25 -0
- iolanta/facets/mermaid_roadmap/sparql/nodes.sparql +17 -0
- iolanta/iolanta.py +146 -55
- iolanta/mcp/cli.py +1 -17
- iolanta/mermaid/models.py +61 -36
- iolanta/parse_quads.py +18 -15
- iolanta/sparqlspace/processor.py +250 -255
- iolanta/sparqlspace/redirects.py +79 -0
- {iolanta-2.1.10.dist-info → iolanta-2.1.12.dist-info}/METADATA +2 -2
- {iolanta-2.1.10.dist-info → iolanta-2.1.12.dist-info}/RECORD +20 -12
- {iolanta-2.1.10.dist-info → iolanta-2.1.12.dist-info}/entry_points.txt +1 -0
- iolanta/mcp/prompts/nanopublication_assertion_authoring_rules.md +0 -63
- iolanta/mcp/prompts/rules.md +0 -83
- {iolanta-2.1.10.dist-info → iolanta-2.1.12.dist-info}/WHEEL +0 -0
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import re
|
|
2
|
+
from types import MappingProxyType
|
|
3
|
+
|
|
4
|
+
from rdflib import URIRef
|
|
5
|
+
|
|
6
|
+
from iolanta.namespaces import (
|
|
7
|
+
DC,
|
|
8
|
+
DCTERMS,
|
|
9
|
+
FOAF,
|
|
10
|
+
OWL,
|
|
11
|
+
PROV,
|
|
12
|
+
RDF,
|
|
13
|
+
RDFS,
|
|
14
|
+
VANN,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
REDIRECTS = MappingProxyType({
|
|
18
|
+
# FIXME This is presently hardcoded; we need to
|
|
19
|
+
# - either find a way to resolve these URLs automatically,
|
|
20
|
+
# - or create a repository of those redirects online.
|
|
21
|
+
'http://purl.org/vocab/vann/': URIRef(
|
|
22
|
+
'https://vocab.org/vann/vann-vocab-20100607.rdf',
|
|
23
|
+
),
|
|
24
|
+
URIRef(str(DC)): URIRef(str(DCTERMS)),
|
|
25
|
+
URIRef(str(RDF)): URIRef(str(RDF)),
|
|
26
|
+
URIRef(str(RDFS)): URIRef(str(RDFS)),
|
|
27
|
+
URIRef(str(OWL)): URIRef(str(OWL)),
|
|
28
|
+
|
|
29
|
+
# Add # fragment to OWL and RDFS namespace URIs
|
|
30
|
+
# (fixes bug reported at https://stackoverflow.com/q/78934864/1245471)
|
|
31
|
+
URIRef('http://www.w3.org/2002/07/owl'): URIRef('http://www.w3.org/2002/07/owl#'),
|
|
32
|
+
URIRef('http://www.w3.org/2000/01/rdf-schema'): URIRef('http://www.w3.org/2000/01/rdf-schema#'),
|
|
33
|
+
|
|
34
|
+
# Redirect FOAF namespace to GitHub mirror
|
|
35
|
+
URIRef('https?://xmlns.com/foaf/0.1/.+'): URIRef(
|
|
36
|
+
'https://raw.githubusercontent.com/foaf/foaf/refs/heads/master/xmlns.com/htdocs/foaf/0.1/index.rdf',
|
|
37
|
+
),
|
|
38
|
+
URIRef('https://www.nanopub.org/nschema'): URIRef(
|
|
39
|
+
'https://www.nanopub.net/nschema#',
|
|
40
|
+
),
|
|
41
|
+
URIRef('https://nanopub.org/nschema'): URIRef(
|
|
42
|
+
'https://nanopub.net/nschema#',
|
|
43
|
+
),
|
|
44
|
+
|
|
45
|
+
# Convert lexvo.org/id URLs to lexvo.org/data URLs
|
|
46
|
+
r'http://lexvo\.org/id/(.+)': r'http://lexvo.org/data/\1',
|
|
47
|
+
r'https://lexvo\.org/id/(.+)': r'http://lexvo.org/data/\1',
|
|
48
|
+
r'https://www\.lexinfo\.net/(.+)': r'http://www.lexinfo.net/\1',
|
|
49
|
+
# Convert Wikidata https:// to http:// (Wikidata JSON-LD uses http:// URIs)
|
|
50
|
+
r'https://www\.wikidata\.org/entity/(.+)': r'http://www.wikidata.org/entity/\1',
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
def apply_redirect(source: URIRef) -> URIRef: # noqa: WPS210
|
|
55
|
+
"""
|
|
56
|
+
Rewrite the URL using regex patterns and group substitutions.
|
|
57
|
+
|
|
58
|
+
For each pattern in REDIRECTS:
|
|
59
|
+
- If the pattern matches the source URI
|
|
60
|
+
- Replace the source with the destination, substituting any regex groups
|
|
61
|
+
"""
|
|
62
|
+
source_str = str(source)
|
|
63
|
+
|
|
64
|
+
for pattern, destination in REDIRECTS.items():
|
|
65
|
+
pattern_str = str(pattern)
|
|
66
|
+
destination_str = str(destination)
|
|
67
|
+
|
|
68
|
+
match = re.match(pattern_str, source_str)
|
|
69
|
+
if match:
|
|
70
|
+
# Replace any group references in the destination
|
|
71
|
+
# (like \1, \2, etc.)
|
|
72
|
+
redirected_uri = re.sub(
|
|
73
|
+
pattern_str,
|
|
74
|
+
destination_str,
|
|
75
|
+
source_str,
|
|
76
|
+
)
|
|
77
|
+
return URIRef(redirected_uri)
|
|
78
|
+
|
|
79
|
+
return source
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: iolanta
|
|
3
|
-
Version: 2.1.
|
|
3
|
+
Version: 2.1.12
|
|
4
4
|
Summary: Semantic Web browser
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Anatoly Scherbakov
|
|
@@ -34,7 +34,7 @@ Requires-Dist: rich (>=13.3.1)
|
|
|
34
34
|
Requires-Dist: textual (>=0.83.0)
|
|
35
35
|
Requires-Dist: typer (>=0.9.0)
|
|
36
36
|
Requires-Dist: watchfiles (>=1.0.4)
|
|
37
|
-
Requires-Dist: yaml-ld (>=1.1.
|
|
37
|
+
Requires-Dist: yaml-ld (>=1.1.16)
|
|
38
38
|
Requires-Dist: yarl (>=1.9.4)
|
|
39
39
|
Description-Content-Type: text/markdown
|
|
40
40
|
|
|
@@ -30,7 +30,7 @@ iolanta/facets/cli/record.py,sha256=-nIhe6hXkoI5LJtZhqBoT8ZkYGxlLwMDbPc-xmwNhrE,
|
|
|
30
30
|
iolanta/facets/cli/sparql/link.sparql,sha256=WtWEfLAvdGc2gP0IhZil6Vglkydc3VO24vk4GwRnR5I,163
|
|
31
31
|
iolanta/facets/cli/sparql/record.sparql,sha256=GBWkmNelvaSDbvl7v0-LsJHdjFPbsSAW49kNFOUeoGQ,63
|
|
32
32
|
iolanta/facets/errors.py,sha256=sEBmnzhFcRIgOT18hfNwyMMjry0waa6IB-jC2NVTA50,4124
|
|
33
|
-
iolanta/facets/facet.py,sha256=
|
|
33
|
+
iolanta/facets/facet.py,sha256=TeVvT0FAgelM5i6Fw6i9R3L1eTacEAoai87pJkbzwEA,2395
|
|
34
34
|
iolanta/facets/foaf_person_title/__init__.py,sha256=oj4MNVQvv8Dysb27xiWjtZCii8-nT7-WFa3WMWUwbtU,67
|
|
35
35
|
iolanta/facets/foaf_person_title/facet.py,sha256=_lKtRosZWuKpjKZ3Ssdq79jVhiLE53jaf22Rnq4HCxs,634
|
|
36
36
|
iolanta/facets/foaf_person_title/sparql/names.sparql,sha256=p_2hHZXhEaJ8IwGlvLoN0vb0vhGqo44uAVRpDyTzflU,107
|
|
@@ -46,6 +46,15 @@ iolanta/facets/html/default.py,sha256=Dmf_kYiL2M954iigyYsiWrMstwZ1nvxKetuR6aW3xY
|
|
|
46
46
|
iolanta/facets/icon.py,sha256=Dubh9eCvb4kj-ppEJsTno_mn78og8YIRnDrmcefOsgs,495
|
|
47
47
|
iolanta/facets/locator/sparql/get-query-to-facet.sparql,sha256=ZoXrclgZPy0FpPhVVMb6VnIXLIUgIc-Q7Pa5ySsNSSU,114
|
|
48
48
|
iolanta/facets/locator.py,sha256=swDkDqo_N8GEPtkDRh-Tp7npyLuPUaZpZDHZPUc2Om4,9089
|
|
49
|
+
iolanta/facets/mermaid_roadmap/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
50
|
+
iolanta/facets/mermaid_roadmap/facet.py,sha256=ctBmuHKvuv0dLCqFhNul9cMcMAqWc_uV1aVwk3_lqAk,4041
|
|
51
|
+
iolanta/facets/mermaid_roadmap/inference/blocks.sparql,sha256=3HIr-sOCHtWwAAlSXIW6DNcTktaY20CYdXoEAL5P900,243
|
|
52
|
+
iolanta/facets/mermaid_roadmap/inference/has-task-default-type.sparql,sha256=EFNHBsAk_CsjCq_Jy8iiGfz_drrIrhr4OuOR4iUA7Ew,439
|
|
53
|
+
iolanta/facets/mermaid_roadmap/inference/task.sparql,sha256=ljZn05sAqC16xneJdkea1Cg9UaGnK7iK5xrlaHqgu9E,798
|
|
54
|
+
iolanta/facets/mermaid_roadmap/inference/unblocked.sparql,sha256=ZstZzpVzlrVLfOiwzcL9_aQ8E8PoXGkgLFbRUvMggsU,430
|
|
55
|
+
iolanta/facets/mermaid_roadmap/mermaid_roadmap.yamlld,sha256=Sv7BoGaTS-r6cfNBYLNyht1CPxMSwjhNzSfEg4QZpWg,1205
|
|
56
|
+
iolanta/facets/mermaid_roadmap/sparql/edges.sparql,sha256=rZcMXrAZwmKh-z-PJUQoKPaat9YRJr_94MZddGDjo-M,675
|
|
57
|
+
iolanta/facets/mermaid_roadmap/sparql/nodes.sparql,sha256=4CPFGOTpfzbUYeUJy_cWw8IgEDAptaBHyesCI1NYY6I,561
|
|
49
58
|
iolanta/facets/mkdocs_material_insiders_markdown/__init__.py,sha256=v5vnYeWJDYIZhXDbuKdhwjkq2Y13dPHNiQuBMAwzEgI,164
|
|
50
59
|
iolanta/facets/mkdocs_material_insiders_markdown/data/mkdocs_material_insiders_markdown.yamlld,sha256=_eTa2_Hqd-QqufBrKD8-wWv1XnKs3QCJar4ONGXH3Nk,549
|
|
51
60
|
iolanta/facets/mkdocs_material_insiders_markdown/facet.py,sha256=EY-H4gR5YgiDVt2pFbhXDuuDlAdo43vuwOvfhqFuRr4,2504
|
|
@@ -109,26 +118,24 @@ iolanta/facets/title/title.yamlld,sha256=FjfqNPl3EAzZNLYAZNQ6mHfNmFkfxMm1A43gygf
|
|
|
109
118
|
iolanta/facets/wikibase_statement_title/__init__.py,sha256=_yk1akxgSJOiUBJIc8QGrD2vovvmx_iw_vJDuv1rD7M,91
|
|
110
119
|
iolanta/facets/wikibase_statement_title/facets.py,sha256=gNRqiwOTMxyyHYvb_vIrfd-4ipb8wfyJ4GgPcQdyy9E,726
|
|
111
120
|
iolanta/facets/wikibase_statement_title/sparql/statement-title.sparql,sha256=n07DQWxKqB5c3CA4kacq2HSN0R0dLgnMnLP1AxMo5YA,320
|
|
112
|
-
iolanta/iolanta.py,sha256=
|
|
121
|
+
iolanta/iolanta.py,sha256=rfaPXuiV88mZGi1PFAf4EiUs-F14xbV9oOqYXApSHZ0,13681
|
|
113
122
|
iolanta/labeled_triple_set/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
114
123
|
iolanta/labeled_triple_set/data/labeled_triple_set.yamlld,sha256=P3oAPSPsirpbcRXej-VekuYFTpWqrkysYsxghZc3bTk,1008
|
|
115
124
|
iolanta/labeled_triple_set/labeled_triple_set.py,sha256=o4IgvTvPd0mzBtpgHYd4n1xpujYdAvWBr6gIYwp5vnA,4061
|
|
116
125
|
iolanta/labeled_triple_set/sparql/triples.sparql,sha256=VsCmYN5AX7jSIiFm-SqLcRcOvUVj8yyZI4PSzKROtQw,82
|
|
117
126
|
iolanta/mcp/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
118
|
-
iolanta/mcp/cli.py,sha256=
|
|
119
|
-
iolanta/mcp/prompts/nanopublication_assertion_authoring_rules.md,sha256=Z5YL9YwcLHCqA4zQK2ziSQYgyR4SlhUO9LV_zHGf0JQ,2643
|
|
120
|
-
iolanta/mcp/prompts/rules.md,sha256=LddpoNfUACfvWBNJ_ArAyJfP2zlQstlXS2QA6GCl9QI,4651
|
|
127
|
+
iolanta/mcp/cli.py,sha256=wlDandYo_VoMIg9oDGPJsIsMmiPo4j4-RBytIKWDtEI,484
|
|
121
128
|
iolanta/mermaid/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
122
129
|
iolanta/mermaid/facet.py,sha256=8mLOBrzlY84jiWhtJNY5BkXPDpRhL2OB1LUwwwNS1X0,4065
|
|
123
130
|
iolanta/mermaid/mermaid.yamlld,sha256=G_8lqNfs6S7pz9koDC8xAaic4EaHsYnFLgexDVyMuCU,552
|
|
124
|
-
iolanta/mermaid/models.py,sha256=
|
|
131
|
+
iolanta/mermaid/models.py,sha256=5lvIu_M3FtoM2tAU7dL6WOMzHwr1ix0BdfOKtiU7Y-Q,4969
|
|
125
132
|
iolanta/mermaid/sparql/ask-has-triples.sparql,sha256=mOYJ_rutEG_15PKTCHSv2GqzbkAawIn1U2kjkIr_Me0,41
|
|
126
133
|
iolanta/mermaid/sparql/graph.sparql,sha256=mDGf05od3CUFhzI6rcqt5ZMVy-gSKDu-WxmV_zpIsVI,62
|
|
127
134
|
iolanta/mermaid/sparql/subgraphs.sparql,sha256=VuoOYr_ZtKXXRrBpAEJek0mBRzR9EV-KnKENgAbkzCs,71
|
|
128
135
|
iolanta/models.py,sha256=2VrJGQE1YXbbVB1K5McCXe2CLAlzOUhA8FvbRI10nCc,3131
|
|
129
136
|
iolanta/namespaces.py,sha256=S4fSjWrL33jylItDf6y2_CIJ4B-RQXDhBsZkB-SV9mw,1107
|
|
130
137
|
iolanta/node_to_qname.py,sha256=a82_qpgT87cbekY_76tTkl4Z-6Rz6am4UGIQChUf9Y0,794
|
|
131
|
-
iolanta/parse_quads.py,sha256=
|
|
138
|
+
iolanta/parse_quads.py,sha256=ZYohKUh4WN3emq5xr6Sgf5gIw3_NFoUgYTZ3DOL-rQY,4876
|
|
132
139
|
iolanta/plugin.py,sha256=MSxpuOIx93AgBahfS8bYh31MEgcwtUSQhj4Js7fgdSI,1096
|
|
133
140
|
iolanta/query_result.py,sha256=VLLBkewUEymtzfB0jeIeRE3Np6pAgo959RPgNsEmiq8,1545
|
|
134
141
|
iolanta/reformat_blank_nodes.py,sha256=MAVcXusUioKzAoTEHAMume5Gt9vBEpxJGrngqFzmkJI,712
|
|
@@ -141,12 +148,13 @@ iolanta/sparqlspace/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSu
|
|
|
141
148
|
iolanta/sparqlspace/cli.py,sha256=pb6q03lzrU8OaZ4A3QAQEmaFYcQ_-sHUrPhRs6GE88w,1590
|
|
142
149
|
iolanta/sparqlspace/inference/wikidata-prop-label.sparql,sha256=JYLAs28Z3a77cMcv44aZplwwrdqB-yshZn1dDZmRFAU,250
|
|
143
150
|
iolanta/sparqlspace/inference/wikidata-statement-label.sparql,sha256=_Dp9jKCpCp2pLk0uacNUhUvvQ2Hov-WiMFprtuYTRyY,759
|
|
144
|
-
iolanta/sparqlspace/processor.py,sha256=
|
|
151
|
+
iolanta/sparqlspace/processor.py,sha256=hRQ38YNKm6iEO73dnTDyGN1Y4DFxJVtV311gLf_z1j0,25744
|
|
152
|
+
iolanta/sparqlspace/redirects.py,sha256=ZYLb8rsjk9JG-mT5OQAzELer7okev34Le2VnACwpYzM,2657
|
|
145
153
|
iolanta/sparqlspace/sparqlspace.py,sha256=Y8_ZPXwuGEXbEes6XQjaQWA2Zv9y8SWxMPDFdqVBGFo,796
|
|
146
154
|
iolanta/widgets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
147
155
|
iolanta/widgets/description.py,sha256=98Qd3FwT9r8sYqKjl9ZEptaVX9jJ2ULWf0uy3j52p5o,800
|
|
148
156
|
iolanta/widgets/mixin.py,sha256=nDRCOc-gizCf1a5DAcYs4hW8eZEd6pHBPFsfm0ncv7E,251
|
|
149
|
-
iolanta-2.1.
|
|
150
|
-
iolanta-2.1.
|
|
151
|
-
iolanta-2.1.
|
|
152
|
-
iolanta-2.1.
|
|
157
|
+
iolanta-2.1.12.dist-info/METADATA,sha256=T4Ee-_-SCeBpfvtXKzAmtNRG3Af_EoWeHGYu1uaUYYE,2317
|
|
158
|
+
iolanta-2.1.12.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
|
|
159
|
+
iolanta-2.1.12.dist-info/entry_points.txt,sha256=2WLr6410ZI7lwzxevIn74trs3U_y4Rx8aK3N3NT_YPw,1786
|
|
160
|
+
iolanta-2.1.12.dist-info/RECORD,,
|
|
@@ -8,6 +8,7 @@ boolean=iolanta.facets.generic:BoolLiteral
|
|
|
8
8
|
icon=iolanta.facets.icon:IconFacet
|
|
9
9
|
labeled-triple-set=iolanta.labeled_triple_set.labeled_triple_set:LabeledTripleSet
|
|
10
10
|
mermaid-graph=iolanta.mermaid.facet:Mermaid
|
|
11
|
+
mermaid-roadmap=iolanta.facets.mermaid_roadmap.facet:MermaidRoadmap
|
|
11
12
|
mkdocs-material-insiders-markdown-datatype=iolanta.facets.mkdocs_material_insiders_markdown:MkDocsMaterialInsidersMarkdownFacet
|
|
12
13
|
qname=iolanta.facets.qname:QNameFacet
|
|
13
14
|
rich-declension-table=iolanta.declension.facet:RichDeclensionTable
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
# How to author Nanopublication Assertions with Iolanta
|
|
2
|
-
|
|
3
|
-
## What are Nanopublications?
|
|
4
|
-
|
|
5
|
-
Nanopublications are a special type of Linked Data that contain structured knowledge statements with three main components:
|
|
6
|
-
|
|
7
|
-
1. **Assertion** - The core knowledge claim or statement
|
|
8
|
-
2. **Provenance** - Information about how the assertion was derived (sources, methods, contributors)
|
|
9
|
-
3. **Publication Info** - Metadata about the nanopublication itself (author, creation date, etc.)
|
|
10
|
-
|
|
11
|
-
Nanopublications are cryptographically signed and published in the decentralized **Nanopublication Registry**, making them:
|
|
12
|
-
- Irrevocably attributed to the author
|
|
13
|
-
- Protected from tampering
|
|
14
|
-
- Referenceable by unique IDs
|
|
15
|
-
- Machine readable and reusable
|
|
16
|
-
- Decentralized and persistent
|
|
17
|
-
|
|
18
|
-
## Assertion-Only Workflow
|
|
19
|
-
|
|
20
|
-
**NP00.** Nanopublication assertion graphs must also satisfy the general rules for Linked Data authoring and workflow. That is provided in the MCP prompt named `ld_authoring_rules`.
|
|
21
|
-
|
|
22
|
-
**NP01.** We focus only on writing the **assertion graph** of the nanopublication.
|
|
23
|
-
|
|
24
|
-
**NP02.** Follow the standard YAML-LD authoring rules (R00-R23) for creating the assertion.
|
|
25
|
-
|
|
26
|
-
**NP03.** The assertion should express a single, clear knowledge claim that can stand alone.
|
|
27
|
-
|
|
28
|
-
**NP04.** Use proper Linked Data vocabularies and resolvable URIs for all entities and relationships.
|
|
29
|
-
|
|
30
|
-
**NP05.** After the assertion graph is ready, follow this workflow:
|
|
31
|
-
|
|
32
|
-
```bash
|
|
33
|
-
# Expand the YAML-LD to JSON-LD
|
|
34
|
-
pyld expand assertion.yamlld > expanded.jsonld
|
|
35
|
-
|
|
36
|
-
# Create nanopublication from the assertion
|
|
37
|
-
np create from-assertion expanded.jsonld > nanopublication.trig
|
|
38
|
-
|
|
39
|
-
# Publish the nanopublication (when ready)
|
|
40
|
-
np publish nanopublication.trig
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
**NP06.** The `pyld expand` command converts YAML-LD to expanded JSON-LD format.
|
|
44
|
-
|
|
45
|
-
**NP07.** The `np create from-assertion` command automatically generates the provenance and publication info components.
|
|
46
|
-
|
|
47
|
-
**NP08.** The `np publish` command cryptographically signs and publishes the nanopublication to the registry.
|
|
48
|
-
|
|
49
|
-
**NP09.** Use the Iolanta MCP `render_uri` tool to validate the assertion before proceeding with the workflow.
|
|
50
|
-
|
|
51
|
-
**NP10.** Save Mermaid visualizations of the assertion for documentation purposes.
|
|
52
|
-
|
|
53
|
-
## Best Practices for Assertions
|
|
54
|
-
|
|
55
|
-
**NP11.** Keep assertions focused on a single, verifiable claim.
|
|
56
|
-
|
|
57
|
-
**NP12.** Use canonical URIs from established knowledge bases (DBpedia, Wikidata, etc.).
|
|
58
|
-
|
|
59
|
-
**NP13.** Include sufficient context and metadata to make the assertion meaningful.
|
|
60
|
-
|
|
61
|
-
**NP14.** Ensure the assertion can be understood independently of external context.
|
|
62
|
-
|
|
63
|
-
**NP15.** Use standard vocabularies and well-established ontologies for relationships.
|
iolanta/mcp/prompts/rules.md
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
# How to author Linked Data with Iolanta
|
|
2
|
-
|
|
3
|
-
**R00.** Follow this YAML-LD authoring workflow:
|
|
4
|
-
- Draft YAML-LD from user text
|
|
5
|
-
- Use the Iolanta MCP `render_uri` tool with `as_format: labeled-triple-set` to validate and get feedback
|
|
6
|
-
- Address the feedback, correct the YAML-LD document appropriately
|
|
7
|
-
- **After each change to the YAML-LD file, re-run the validation to check for new feedback**
|
|
8
|
-
|
|
9
|
-
**R01.** Acceptance Criteria:
|
|
10
|
-
|
|
11
|
-
- The document fits the original statement the user wanted to express;
|
|
12
|
-
- No negative feedback is received.
|
|
13
|
-
|
|
14
|
-
**R02.** Use YAML-LD format, which is JSON-LD in YAML syntax, for writing Linked Data.
|
|
15
|
-
|
|
16
|
-
**R03.** Always quote the @ character in YAML since it's reserved. Use `"@id":` instead of `@id:`.
|
|
17
|
-
|
|
18
|
-
**R04.** Prefer YAML-LD Convenience Context which maps @-keywords to $-keywords that don't need quoting: `"@type"` → `$type`, `"@id"` → `$id`, `"@graph"` → `$graph`.
|
|
19
|
-
|
|
20
|
-
**R05.** Use the dollar-convenience context with `@import` syntax instead of array syntax. This provides cleaner, more readable YAML-LD documents.
|
|
21
|
-
|
|
22
|
-
Example:
|
|
23
|
-
```yaml
|
|
24
|
-
"@context":
|
|
25
|
-
"@import": "https://json-ld.org/contexts/dollar-convenience.jsonld"
|
|
26
|
-
|
|
27
|
-
schema: "https://schema.org/"
|
|
28
|
-
wd: "https://www.wikidata.org/entity/"
|
|
29
|
-
|
|
30
|
-
author:
|
|
31
|
-
"@id": "https://schema.org/author"
|
|
32
|
-
"@type": "@id"
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
Instead of:
|
|
36
|
-
```yaml
|
|
37
|
-
"@context":
|
|
38
|
-
- "https://json-ld.org/contexts/dollar-convenience.jsonld"
|
|
39
|
-
- schema: "https://schema.org/"
|
|
40
|
-
- wd: "https://www.wikidata.org/entity/"
|
|
41
|
-
- author:
|
|
42
|
-
"@id": "https://schema.org/author"
|
|
43
|
-
"@type": "@id"
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
**R06.** Reduce quoting when not required by YAML syntax rules.
|
|
47
|
-
|
|
48
|
-
**R07.** Do not use mock URLs like `https://example.org`. Use resolvable URLs that preferably point to Linked Data.
|
|
49
|
-
|
|
50
|
-
**R08.** Use URIs that convey meaning and are renderable with Linked Data visualization tools. Search for appropriate URIs from sources like DBPedia or Wikidata.
|
|
51
|
-
|
|
52
|
-
**R09.** Use the Iolanta MCP `render_uri` tool with `as_format: mermaid` to generate Mermaid graph visualizations of Linked Data. If the user asks, you can save them to `.mmd` files for preview and documentation purposes.
|
|
53
|
-
|
|
54
|
-
**R10.** For language tags, use YAML-LD syntax: `rdfs:label: { $value: "text", $language: "lang" }` instead of Turtle syntax `"text"@lang`.
|
|
55
|
-
|
|
56
|
-
**R11.** Do not attach labels to external URIs that are expected to return Linked Data. Iolanta will fetch those URIs and render labels from the fetched data.
|
|
57
|
-
|
|
58
|
-
**R12.** Use `"@type": "@id"` in the context to coerce properties to IRIs instead of using `$id` wrappers in the document body.
|
|
59
|
-
|
|
60
|
-
**R13.** For software packages, use `schema:SoftwareApplication` as the main type rather than `codemeta:SoftwareSourceCode`.
|
|
61
|
-
|
|
62
|
-
**R14.** Use Wikidata entities for programming languages (e.g., `https://www.wikidata.org/entity/Q28865` for Python) instead of string literals.
|
|
63
|
-
|
|
64
|
-
**R15.** Use proper ORCID URIs for authors (e.g., `https://orcid.org/0009-0001-8740-4213`) and coerce them to IRIs in the context.
|
|
65
|
-
|
|
66
|
-
**R16.** For tools that provide both library and CLI functionality, classify as `schema:Tool` with `schema:applicationSubCategory: Command-line tool`.
|
|
67
|
-
|
|
68
|
-
**R17.** Use real, resolvable repository URLs (e.g., `https://github.com/iolanta-tech/python-yaml-ld`) instead of placeholder URLs.
|
|
69
|
-
|
|
70
|
-
**R18.** Include comprehensive metadata: name, description, author, license, programming language, version, repository links, and application category.
|
|
71
|
-
|
|
72
|
-
**R19.** Use standard vocabularies: schema.org, RDFS, RDF, DCTerms, FOAF, and CodeMeta when appropriate.
|
|
73
|
-
|
|
74
|
-
**R20.** Validate Linked Data using the Iolanta MCP `render_uri` tool with `as_format: labeled-triple-set` to check for URL-as-literal issues and proper IRI handling.
|
|
75
|
-
|
|
76
|
-
**R21.** Do not add `rdfs:label` to external URIs that are expected to return Linked Data. If a URI does not exist or cannot be resolved, do not mask this fact by adding labels. Instead, use a different, existing URI or document the issue with a comment.
|
|
77
|
-
|
|
78
|
-
**R22.** Define URI coercion in the context using `"@type": "@id"` rather than using `$id` wrappers in the document body. This keeps the document body clean and readable while ensuring proper URI handling.
|
|
79
|
-
|
|
80
|
-
**R23.** When defining local shortcuts for URIs in the context, use dashed-case (e.g., `appears-in`, `named-after`) instead of camelCase (e.g., `appearsIn`, `namedAfter`). This improves readability and follows common YAML conventions.
|
|
81
|
-
|
|
82
|
-
**R24.** Do not rely upon `owl:sameAs` or `schema:sameAs` to express identity relationships. This necessitates OWL inference at the side of the reader, which is performance-taxing and tends to create conflicts. Instead, use direct URIs for entities without relying on sameAs statements for identity.
|
|
83
|
-
|
|
File without changes
|