|
12 | 12 | }, |
13 | 13 | { |
14 | 14 | "cell_type": "code", |
15 | | - "execution_count": 1, |
| 15 | + "execution_count": null, |
16 | 16 | "id": "a9b58411-88af-4972-b5c8-b01391df58fc", |
17 | 17 | "metadata": { |
18 | 18 | "scrolled": true |
|
24 | 24 | }, |
25 | 25 | { |
26 | 26 | "cell_type": "code", |
27 | | - "execution_count": 2, |
| 27 | + "execution_count": null, |
28 | 28 | "id": "feb70a18-b9e7-40db-b369-4e6c927301e5", |
29 | 29 | "metadata": {}, |
30 | 30 | "outputs": [], |
|
36 | 36 | }, |
37 | 37 | { |
38 | 38 | "cell_type": "code", |
39 | | - "execution_count": 3, |
| 39 | + "execution_count": null, |
40 | 40 | "id": "690c0219-d7f5-4b0d-a897-59cf8f354149", |
41 | 41 | "metadata": {}, |
42 | 42 | "outputs": [], |
|
46 | 46 | }, |
47 | 47 | { |
48 | 48 | "cell_type": "code", |
49 | | - "execution_count": 4, |
| 49 | + "execution_count": null, |
50 | 50 | "id": "d4d871e0-5bff-42f7-a27d-f1f0337dd964", |
51 | 51 | "metadata": { |
52 | 52 | "scrolled": true |
53 | 53 | }, |
54 | | - "outputs": [ |
55 | | - { |
56 | | - "name": "stdout", |
57 | | - "output_type": "stream", |
58 | | - "text": [ |
59 | | - "@prefix dcterms: <http://purl.org/dc/terms/> .\n", |
60 | | - "@prefix ex: <https://example.org#> .\n", |
61 | | - "@prefix foaf: <http://xmlns.com/foaf/0.1/> .\n", |
62 | | - "@prefix hdf: <http://purl.allotrope.org/ontologies/hdf5/1.8#> .\n", |
63 | | - "@prefix prov: <http://www.w3.org/ns/prov#> .\n", |
64 | | - "@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .\n", |
65 | | - "\n", |
66 | | - "ex:tmp0.hdf a hdf:File ;\n", |
67 | | - " hdf:rootGroup <https://example.org#tmp0.hdf/> .\n", |
68 | | - "\n", |
69 | | - "<https://example.org#tmp0.hdf/> a hdf:Group ;\n", |
70 | | - " hdf:member <https://example.org#tmp0.hdf/contact>,\n", |
71 | | - " <https://example.org#tmp0.hdf/nd-array>,\n", |
72 | | - " <https://example.org#tmp0.hdf/test> ;\n", |
73 | | - " hdf:name \"/\"^^xsd:string .\n", |
74 | | - "\n", |
75 | | - "<https://example.org#tmp0.hdf/contact> a hdf:Group ;\n", |
76 | | - " hdf:attribute <https://example.org#tmp0.hdf/contact@fname>,\n", |
77 | | - " <https://example.org#tmp0.hdf/contact@hint>,\n", |
78 | | - " <https://example.org#tmp0.hdf/contact@lname> ;\n", |
79 | | - " hdf:name \"/contact\"^^xsd:string ;\n", |
80 | | - " dcterms:relation <https://orcid.org/0000-0001-8729-0482> .\n", |
81 | | - "\n", |
82 | | - "<https://example.org#tmp0.hdf/contact@fname> a hdf:StringAttribute ;\n", |
83 | | - " hdf:data \"Matthias\"^^xsd:string ;\n", |
84 | | - " hdf:name \"fname\" .\n", |
85 | | - "\n", |
86 | | - "<https://example.org#tmp0.hdf/contact@hint> a hdf:StringAttribute ;\n", |
87 | | - " hdf:data \"This group could be representing a person.\"^^xsd:string ;\n", |
88 | | - " hdf:name \"hint\" .\n", |
89 | | - "\n", |
90 | | - "<https://example.org#tmp0.hdf/contact@lname> a hdf:StringAttribute ;\n", |
91 | | - " hdf:data \"Probst\"^^xsd:string ;\n", |
92 | | - " hdf:name \"lname\" .\n", |
93 | | - "\n", |
94 | | - "<https://example.org#tmp0.hdf/nd-array> a hdf:Dataset ;\n", |
95 | | - " hdf:chunk <https://example.org#tmp0.hdf/nd-array__chunk_dimensions> ;\n", |
96 | | - " hdf:dataspace <https://example.org#tmp0.hdf/nd-array__dataspace> ;\n", |
97 | | - " hdf:datatype hdf:H5T_IEEE_F64LE,\n", |
98 | | - " \"H5T_FLOAT\" ;\n", |
99 | | - " hdf:layout hdf:H5D_CHUNKED ;\n", |
100 | | - " hdf:maximumSize 6 ;\n", |
101 | | - " hdf:name \"/nd-array\" ;\n", |
102 | | - " hdf:rank 2 ;\n", |
103 | | - " hdf:size 6 .\n", |
104 | | - "\n", |
105 | | - "<https://example.org#tmp0.hdf/nd-array__chunk_dimension_0> a hdf:DataspaceDimension ;\n", |
106 | | - " hdf:dimensionIndex 0 ;\n", |
107 | | - " hdf:size 1 .\n", |
108 | | - "\n", |
109 | | - "<https://example.org#tmp0.hdf/nd-array__chunk_dimension_1> a hdf:DataspaceDimension ;\n", |
110 | | - " hdf:dimensionIndex 1 ;\n", |
111 | | - " hdf:size 3 .\n", |
112 | | - "\n", |
113 | | - "<https://example.org#tmp0.hdf/nd-array__chunk_dimensions> a hdf:ChunkDimension ;\n", |
114 | | - " hdf:dimension <https://example.org#tmp0.hdf/nd-array__chunk_dimension_0>,\n", |
115 | | - " <https://example.org#tmp0.hdf/nd-array__chunk_dimension_1> .\n", |
116 | | - "\n", |
117 | | - "<https://example.org#tmp0.hdf/nd-array__dataspace> a hdf:SimpleDataspace ;\n", |
118 | | - " hdf:dimension <https://example.org#tmp0.hdf/nd-array__dataspace_dimension_0>,\n", |
119 | | - " <https://example.org#tmp0.hdf/nd-array__dataspace_dimension_1> .\n", |
120 | | - "\n", |
121 | | - "<https://example.org#tmp0.hdf/nd-array__dataspace_dimension_0> a hdf:DataspaceDimension ;\n", |
122 | | - " hdf:dimensionIndex 0 ;\n", |
123 | | - " hdf:size 2 .\n", |
124 | | - "\n", |
125 | | - "<https://example.org#tmp0.hdf/nd-array__dataspace_dimension_1> a hdf:DataspaceDimension ;\n", |
126 | | - " hdf:dimensionIndex 1 ;\n", |
127 | | - " hdf:size 3 .\n", |
128 | | - "\n", |
129 | | - "<https://example.org#tmp0.hdf/test> a hdf:Dataset ;\n", |
130 | | - " hdf:dataspace <https://example.org#tmp0.hdf/test__dataspace> ;\n", |
131 | | - " hdf:datatype hdf:H5T_IEEE_F64LE,\n", |
132 | | - " \"H5T_FLOAT\" ;\n", |
133 | | - " hdf:layout hdf:H5D_CONTIGUOUS ;\n", |
134 | | - " hdf:maximumSize -1 ;\n", |
135 | | - " hdf:name \"/test\" ;\n", |
136 | | - " hdf:rank 0 ;\n", |
137 | | - " hdf:size 1 ;\n", |
138 | | - " hdf:value 4.3e+00 .\n", |
139 | | - "\n", |
140 | | - "<https://example.org#tmp0.hdf/test__dataspace> a hdf:ScalarDataspace .\n", |
141 | | - "\n", |
142 | | - "<https://orcid.org/0000-0001-8729-0482> a prov:Person ;\n", |
143 | | - " foaf:firstName \"Matthias\"^^xsd:string ;\n", |
144 | | - " foaf:lastName \"Probst\"^^xsd:string .\n", |
145 | | - "\n", |
146 | | - "hdf:H5T_IEEE_F64LE a hdf:Datatype .\n", |
147 | | - "\n", |
148 | | - "\n" |
149 | | - ] |
150 | | - } |
151 | | - ], |
| 54 | + "outputs": [], |
152 | 55 | "source": [ |
153 | 56 | "with h5tbx.File() as h5:\n", |
154 | 57 | " h5.create_dataset(name='test', data=4.3)\n", |
|
167 | 70 | }, |
168 | 71 | { |
169 | 72 | "cell_type": "code", |
170 | | - "execution_count": 5, |
| 73 | + "execution_count": null, |
171 | 74 | "id": "064a9e31-1fd0-429e-9189-663e950bc52f", |
172 | 75 | "metadata": {}, |
173 | 76 | "outputs": [], |
|
180 | 83 | }, |
181 | 84 | { |
182 | 85 | "cell_type": "code", |
183 | | - "execution_count": 6, |
| 86 | + "execution_count": null, |
184 | 87 | "id": "ce1a26f6-ad59-4014-b5b2-dcee38f11a26", |
185 | 88 | "metadata": {}, |
186 | 89 | "outputs": [], |
|
190 | 93 | }, |
191 | 94 | { |
192 | 95 | "cell_type": "code", |
193 | | - "execution_count": 7, |
| 96 | + "execution_count": null, |
194 | 97 | "id": "78c9adf7-43f0-4aa1-8740-149bf3a5f74f", |
195 | 98 | "metadata": {}, |
196 | 99 | "outputs": [], |
|
203 | 106 | }, |
204 | 107 | { |
205 | 108 | "cell_type": "code", |
206 | | - "execution_count": 8, |
| 109 | + "execution_count": null, |
207 | 110 | "id": "e8d13d2e-d66e-4028-8909-7192cfef1bf6", |
208 | 111 | "metadata": {}, |
209 | | - "outputs": [ |
210 | | - { |
211 | | - "name": "stdout", |
212 | | - "output_type": "stream", |
213 | | - "text": [ |
214 | | - "Warning: When cdn_resources is 'local' jupyter notebook has issues displaying graphics on chrome/safari. Use cdn_resources='in_line' or cdn_resources='remote' if you have issues viewing graphics in a notebook.\n" |
215 | | - ] |
216 | | - } |
217 | | - ], |
| 112 | + "outputs": [], |
218 | 113 | "source": [ |
219 | 114 | "pyvis_graph = subgraph.build_pyvis_graph(notebook=True, style=VIS_STYLE)\n", |
220 | 115 | "# pyvis_graph.show('graph.html', notebook=True)\n", |
|
232 | 127 | }, |
233 | 128 | { |
234 | 129 | "cell_type": "code", |
235 | | - "execution_count": 9, |
| 130 | + "execution_count": null, |
236 | 131 | "id": "a44f0039-00b8-44c5-b237-ccba12993bdd", |
237 | 132 | "metadata": {}, |
238 | | - "outputs": [ |
239 | | - { |
240 | | - "name": "stdout", |
241 | | - "output_type": "stream", |
242 | | - "text": [ |
243 | | - "{\n", |
244 | | - " \"@context\": {\n", |
245 | | - " \"dcterms\": \"http://purl.org/dc/terms/\",\n", |
246 | | - " \"foaf\": \"http://xmlns.com/foaf/0.1/\",\n", |
247 | | - " \"prov\": \"http://www.w3.org/ns/prov#\"\n", |
248 | | - " },\n", |
249 | | - " \"@graph\": [\n", |
250 | | - " {\n", |
251 | | - " \"@id\": \"prov:Person\",\n", |
252 | | - " \"foaf:firstName\": \"Matthias\",\n", |
253 | | - " \"foaf:lastName\": \"Probst\"\n", |
254 | | - " },\n", |
255 | | - " {\n", |
256 | | - " \"@id\": \"https://example.org#tmp1.hdf/contact\",\n", |
257 | | - " \"dcterms:relation\": {\n", |
258 | | - " \"@id\": \"prov:Person\"\n", |
259 | | - " }\n", |
260 | | - " }\n", |
261 | | - " ]\n", |
262 | | - "}\n" |
263 | | - ] |
264 | | - } |
265 | | - ], |
| 133 | + "outputs": [], |
266 | 134 | "source": [ |
267 | 135 | "with h5tbx.File() as h5:\n", |
268 | 136 | " h5.create_dataset(name='test', data=4.3)\n", |
|
280 | 148 | }, |
281 | 149 | { |
282 | 150 | "cell_type": "code", |
283 | | - "execution_count": 10, |
| 151 | + "execution_count": null, |
284 | 152 | "id": "077911e8-8bc3-4b58-a480-df605bdceae4", |
285 | 153 | "metadata": {}, |
286 | 154 | "outputs": [], |
|
295 | 163 | }, |
296 | 164 | { |
297 | 165 | "cell_type": "code", |
298 | | - "execution_count": 11, |
| 166 | + "execution_count": null, |
299 | 167 | "id": "67f99459-8351-4819-8a67-2b58d4b1e398", |
300 | 168 | "metadata": {}, |
301 | | - "outputs": [ |
302 | | - { |
303 | | - "name": "stdout", |
304 | | - "output_type": "stream", |
305 | | - "text": [ |
306 | | - "Warning: When cdn_resources is 'local' jupyter notebook has issues displaying graphics on chrome/safari. Use cdn_resources='in_line' or cdn_resources='remote' if you have issues viewing graphics in a notebook.\n" |
307 | | - ] |
308 | | - } |
309 | | - ], |
| 169 | + "outputs": [], |
310 | 170 | "source": [ |
311 | 171 | "kg_from_jsonld = kglab.KnowledgeGraph().load_rdf_text(\n", |
312 | 172 | " graph.serialize(format=\"ttl\")\n", |
|
353 | 213 | "name": "python", |
354 | 214 | "nbconvert_exporter": "python", |
355 | 215 | "pygments_lexer": "ipython3", |
356 | | - "version": "3.10.18" |
| 216 | + "version": "3.9.23" |
357 | 217 | } |
358 | 218 | }, |
359 | 219 | "nbformat": 4, |
|
0 commit comments