pylode 2.8.3__py2.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 (63) hide show
  1. pyLODE-2.8.3.dist-info/LICENSE +643 -0
  2. pyLODE-2.8.3.dist-info/METADATA +772 -0
  3. pyLODE-2.8.3.dist-info/RECORD +63 -0
  4. pyLODE-2.8.3.dist-info/WHEEL +6 -0
  5. pyLODE-2.8.3.dist-info/entry_points.txt +3 -0
  6. pyLODE-2.8.3.dist-info/top_level.txt +1 -0
  7. pylode/__init__.py +5 -0
  8. pylode/cli.py +191 -0
  9. pylode/common.py +191 -0
  10. pylode/curies.py +2208 -0
  11. pylode/profiles/__init__.py +4 -0
  12. pylode/profiles/base.py +463 -0
  13. pylode/profiles/ontdoc.py +1283 -0
  14. pylode/profiles/prof.py +276 -0
  15. pylode/profiles/profile.py +135 -0
  16. pylode/profiles/vocpub.py +605 -0
  17. pylode/server.py +24 -0
  18. pylode/style/pylode.css +179 -0
  19. pylode/templates/agent.html +11 -0
  20. pylode/templates/agent.md +11 -0
  21. pylode/templates/namespaces.html +9 -0
  22. pylode/templates/namespaces.md +5 -0
  23. pylode/templates/ontdoc/class.html +121 -0
  24. pylode/templates/ontdoc/class.md +40 -0
  25. pylode/templates/ontdoc/classes.html +11 -0
  26. pylode/templates/ontdoc/classes.md +7 -0
  27. pylode/templates/ontdoc/document.html +42 -0
  28. pylode/templates/ontdoc/document.md +16 -0
  29. pylode/templates/ontdoc/metadata.html +127 -0
  30. pylode/templates/ontdoc/metadata.md +111 -0
  31. pylode/templates/ontdoc/named_individual.html +65 -0
  32. pylode/templates/ontdoc/named_individual.md +25 -0
  33. pylode/templates/ontdoc/named_individuals.html +11 -0
  34. pylode/templates/ontdoc/named_individuals.md +7 -0
  35. pylode/templates/ontdoc/properties.html +65 -0
  36. pylode/templates/ontdoc/properties.md +45 -0
  37. pylode/templates/ontdoc/property.html +129 -0
  38. pylode/templates/ontdoc/property.md +37 -0
  39. pylode/templates/orcid.html +19 -0
  40. pylode/templates/orcid.md +1 -0
  41. pylode/templates/prof/prof.html +38 -0
  42. pylode/templates/prof/prof.md +16 -0
  43. pylode/templates/prof/profile.html +90 -0
  44. pylode/templates/prof/profile.md +85 -0
  45. pylode/templates/prof/resource_descriptor.html +49 -0
  46. pylode/templates/prof/resource_descriptor.md +21 -0
  47. pylode/templates/vocpub/collection.html +51 -0
  48. pylode/templates/vocpub/collection.md +23 -0
  49. pylode/templates/vocpub/collections.html +11 -0
  50. pylode/templates/vocpub/collections.md +7 -0
  51. pylode/templates/vocpub/concept.html +115 -0
  52. pylode/templates/vocpub/concept.md +40 -0
  53. pylode/templates/vocpub/concept_hierarchy.html +80 -0
  54. pylode/templates/vocpub/concept_scheme.html +105 -0
  55. pylode/templates/vocpub/concept_scheme.md +102 -0
  56. pylode/templates/vocpub/concepts.html +9 -0
  57. pylode/templates/vocpub/concepts.md +7 -0
  58. pylode/templates/vocpub/taxonomy.html +42 -0
  59. pylode/templates/vocpub/taxonomy.md +17 -0
  60. pylode/tests/__init__.py +0 -0
  61. pylode/tests/test_ont_html_description.py +7 -0
  62. pylode/tests/test_skos.py +8 -0
  63. pylode/tests/tests_all.py +50 -0
@@ -0,0 +1,102 @@
1
+ # {{ title }}
2
+ ### A taxonomy
3
+
4
+ ## Metadata
5
+ * **URI**
6
+ * `{{ uri }}`
7
+ {%- if publishers|length > 0 %}
8
+ * **Publisher(s)**
9
+ {%- for publisher in publishers %}
10
+ * {{ publisher }}
11
+ {%- endfor %}
12
+ {%- endif %}
13
+
14
+ {%- if creators|length > 0 %}
15
+ * **Creators(s)**
16
+ {%- for creator in creators %}
17
+ * {{ creator }}
18
+ {%- endfor %}
19
+ {%- endif %}
20
+
21
+ {%- if contributors|length > 0 %}
22
+ * **Contributor(s)**
23
+ {%- for contributor in contributors %}
24
+ * {{ contributor }}
25
+ {%- endfor %}
26
+ {%- endif %}
27
+
28
+ {%- if created is not none %}
29
+ * **Created**
30
+ * {{ created }}
31
+ {%- endif %}
32
+ {%- if modified is not none %}
33
+ * **Modified**
34
+ * {{ modified }}
35
+ {%- endif %}
36
+ {%- if issued is not none %}
37
+ * **Issued**
38
+ * {{ issued }}
39
+ {%- endif %}
40
+
41
+ {%- if version_info is not none %}
42
+ * **Version Information**
43
+ * {{ version_info }}
44
+ {%- endif %}
45
+ {%- if version_uri is not none %}
46
+ * **Version URI**
47
+ * {{ version_uri }}
48
+ {%- endif %}
49
+
50
+ {%- if imports|length > 0 %}
51
+ * **Imports**
52
+ {%- for import in imports %}
53
+ * {{ import }}
54
+ {%- endfor %}
55
+ {%- endif %}
56
+ {%- if rights is not none and license is not none %}
57
+
58
+ * **License & Rights**
59
+ * {{ license }}
60
+ * {{ rights }}
61
+ {%- elif rights is not none and license is none %}
62
+ * **Rights**
63
+ * {{ rights }}
64
+ {%- elif rights is none and license is not none %}
65
+ * **License**
66
+ * {{ license }}
67
+ {%- endif %}
68
+ {%- if source is not none %}
69
+ * **Source**
70
+ * {{ source }}
71
+ {%- endif %}
72
+
73
+ * **Taxonomy RDF**
74
+ * {{ ont_rdf }}
75
+ {%- if repository is not none %}
76
+ * **Code Repository**
77
+ * <{{ repository }}>
78
+ {%- endif %}
79
+
80
+ {%- if description is not none %}
81
+ ### Description
82
+ {{ description }}
83
+ {%- endif %}
84
+ {% if historyNote is not none %}
85
+ **History Note**
86
+ {{ historyNote }}
87
+ {%- endif %}
88
+
89
+ ## Table of Contents
90
+ {%- if has_collections %}
91
+ 1. [Collections](#collections)
92
+ {%- endif %}
93
+ {%- if has_concepts %}
94
+ 1. [Object Concepts](#concepts)
95
+ {%- endif %}
96
+ 1. [Namespaces](#namespaces)
97
+ 1. [Legend](#legend)
98
+
99
+
100
+ ## Overview
101
+
102
+ **Figure 1:** Ontology overview
@@ -0,0 +1,9 @@
1
+ <section id="concepts">
2
+ <h2>Concepts <span style="float:right; font-size:smaller;"><a href="">&uparrow;</a></span></h2>
3
+ {%- if concept_hierarchy is not none %}
4
+ {{ concept_hierarchy|safe }}
5
+ {%- endif %}
6
+ {%- for concept in concepts %}
7
+ {{ concept[2]|safe }}
8
+ {%- endfor %}
9
+ </section>
@@ -0,0 +1,7 @@
1
+ ## Classes
2
+ {%- if concept_hierarchy is not none %}
3
+ {{ concept_hierarchy|safe }}
4
+ {%- endif %}
5
+ {%- for concept in concepts %}
6
+ {{ concept[2]|safe }}
7
+ {%- endfor %}
@@ -0,0 +1,42 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <title>{{ title }}</title>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6
+ {% if css is not none %}
7
+ <style>
8
+ {{ css }}
9
+ </style>
10
+ {% else %}
11
+ <link rel="stylesheet" type="text/css" href="style.css">
12
+ {% endif %}
13
+ <script type="application/ld+json">
14
+ {{ schemaorg }}
15
+ </script>
16
+ </head>
17
+ <body>
18
+ <div id="pylode">made by <a href="http://github.com/rdflib/pyLODE">
19
+ <span style="color:#329545;">p</span><span style="color:#f9cb33;">y</span>LODE</a>
20
+ <span style="font-size:smaller;">{{ pylode_version }}</span>
21
+ </div>
22
+ {{ concept_scheme }}
23
+
24
+ {%- if has_collections %}
25
+ {{ collections|safe }}
26
+ {%- endif %}
27
+
28
+ {%- if has_concepts %}
29
+ {{ concepts|safe }}
30
+ {%- endif %}
31
+
32
+ {{ namespaces|safe }}
33
+
34
+ <section id="legend">
35
+ <h2>Legend</h2>
36
+ <table class="entity">
37
+ <tr><td><sup class="sup-cl" title="Collections">cl</sup></td><td>Collections</td></tr>
38
+ <tr><td><sup class="sup-cp" title="Concepts">cp</sup></td><td>Concepts</td></tr>
39
+ </table>
40
+ </section>
41
+ </body>
42
+ </html>
@@ -0,0 +1,17 @@
1
+ Markdown documentation created by [pyLODE](http://github.com/rdflib/pyLODE)
2
+
3
+ {{ concept_scheme }}
4
+
5
+ {%- if has_collections %}
6
+ {{ collections|safe }}
7
+ {%- endif %}
8
+
9
+ {%- if has_concepts %}
10
+ {{ concepts|safe }}
11
+ {%- endif %}
12
+
13
+ {{ namespaces|safe }}
14
+
15
+ ## Legend
16
+ * Collections: cl
17
+ * Concepts: cp
File without changes
@@ -0,0 +1,7 @@
1
+ from makedocco import MakeDocco
2
+
3
+
4
+ h = MakeDocco(input_data_file="test_ont_html_description.ttl")
5
+ # generate the HTML doc
6
+ h.document(destination="test_ont_html_description.html")
7
+
@@ -0,0 +1,8 @@
1
+ from makedocco import MakeDocco
2
+
3
+
4
+ h = MakeDocco(profile='skos')
5
+ source_info = ("test_skos_cif.ttl", "turtle")
6
+ # generate the HTML doc
7
+ with open("test_skos_cif.html", "w") as f:
8
+ f.write(h.document(source_info))
@@ -0,0 +1,50 @@
1
+ import pylode
2
+
3
+
4
+ def test_make_fragment_id():
5
+ doc = pylode.HtmlDocument
6
+ doc.fragment_ids = ['x']
7
+
8
+ uri = 'http://example.com/aaa/bbb/ccc'
9
+ print('testing {}'.format(uri))
10
+ assert pylode.make_fragment_id(uri, 'x', doc) == 'ccc'
11
+
12
+ uri = 'http://example.com/aaa/bbb/'
13
+ print('testing {}'.format(uri))
14
+ assert pylode.make_fragment_id(uri, 'x', doc) is None
15
+
16
+ uri = 'http://example.com/aaa/bbb#ccc'
17
+ print('testing {}'.format(uri))
18
+ assert pylode.make_fragment_id(uri, 'x', doc) == 'ccc'
19
+
20
+ uri = 'http://example.com/aaa/bbb#'
21
+ print('testing {}'.format(uri))
22
+ assert pylode.make_fragment_id(uri, 'x', doc) is None
23
+
24
+ uri = 'http://example.com'
25
+ print('testing {}'.format(uri))
26
+ assert pylode.make_fragment_id(uri, 'x', doc) is None
27
+
28
+ uri = 'http://example.'
29
+ print('testing {}'.format(uri))
30
+ assert pylode.make_fragment_id(uri, 'x', doc) is None
31
+
32
+ uri = ''
33
+ print('testing {} <- empty URI'.format(uri))
34
+ assert pylode.make_fragment_id(uri, 'x', doc) is None
35
+
36
+ uri = 'http://example.com/aaa/bbb/Mikołaj'
37
+ print('testing {} <- non-Latin char'.format(uri))
38
+ assert pylode.make_fragment_id(uri, 'x', doc) == 'Mikołaj'
39
+
40
+ uri = 'http://example.com/aaa/bbb/£'
41
+ print('testing {} <- non-Latin char'.format(uri))
42
+ assert pylode.make_fragment_id(uri, 'x', doc) == '£'
43
+
44
+ uri = 'http://example.com/aaa/bbb/\xa3'
45
+ print('testing {} <- non-Latin char, encoded as \\xa3'.format(uri))
46
+ assert pylode.make_fragment_id(uri, 'x', doc) == '\xa3'
47
+
48
+
49
+ if __name__ == '__main__':
50
+ test_make_fragment_id()