Skip to content

Commit 30affab

Browse files
committed
temporarily remove morph-kgc due to their version pinning on older rdflib
1 parent 5d56d79 commit 30affab

File tree

5 files changed

+377
-659
lines changed

5 files changed

+377
-659
lines changed

examples/ex2_1.ipynb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@
2929
"For documentation see <https://morph-kgc.readthedocs.io/en/latest/documentation/>"
3030
]
3131
},
32+
{
33+
"cell_type": "markdown",
34+
"metadata": {},
35+
"source": [
36+
"**UNFORTUNATELY:** due to substantial changes in `RDFlib` which caused unit tests to break in `morph-kgc` and subsequent version pinning (see <https://github.com/morph-kgc/morph-kgc/issues/345>) the support for `kglab.KnowledgeGraph.materialize()` had to be temporarily removed, pending resolution of that issue."
37+
]
38+
},
3239
{
3340
"cell_type": "markdown",
3441
"metadata": {},

kglab/serde.py

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import apeye.url
1717
import chocolate # type: ignore
1818
import csvwlib # type: ignore
19-
import morph_kgc # type: ignore
2019
import pandas as pd # type: ignore
2120

2221
import rdflib # type: ignore
@@ -44,7 +43,6 @@ class SerdeMixin (Mixin):
4443
* JSONLD
4544
* Parquet
4645
* CSV
47-
* Morph-KGC
4846
* ROAM
4947
"""
5048
######################################################################
@@ -558,31 +556,6 @@ def load_csv (
558556
return self.load_rdf_text(new_rdf)
559557

560558

561-
def materialize (
562-
self,
563-
config: str,
564-
) -> "KnowledgeGraph": # type: ignore
565-
"""
566-
Binding to the [Morph-KGC](https://github.com/oeg-upm/morph-kgc) `materialize()` method.
567-
568-
config:
569-
morph-kgc configuration, it can be the path to the config file, or a string with the config; see <https://morph-kgc.readthedocs.io/en/latest/documentation/#library>
570-
571-
returns:
572-
this `KnowledgeGraph` object – used for method chaining
573-
"""
574-
if len(self._g) == 0: # type: ignore
575-
# generate the triples and load them to an RDFlib graph
576-
self._g = morph_kgc.materialize(config)
577-
else:
578-
# merge
579-
# for caveats about merging this way:
580-
# <https://rdflib.readthedocs.io/en/stable/merging.html>
581-
self._g.parse(morph_kgc.materialize(config)) # type: ignore
582-
583-
return self
584-
585-
586559
######################################################################
587560
## Roam Research integration
588561

morph_kgc.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Currently the `morph-kgc` package is pinned to use `rdflib <7.3.0` due to unit
2+
tests breaking with later versions: https://github.com/morph-kgc/morph-kgc/issues/345
3+
4+
# The following code has been temporarily removed from the `kglab/serde.py` module:
5+
6+
import morph_kgc
7+
8+
def materialize (
9+
self,
10+
config: str,
11+
) -> "KnowledgeGraph": # type: ignore
12+
"""
13+
Binding to the [Morph-KGC](https://github.com/oeg-upm/morph-kgc) `materialize()` method.
14+
15+
config:
16+
morph-kgc configuration, it can be the path to the config file, or a string with the config; see <https://morph-kgc.readthedocs.io/en/latest/documentation/#library>
17+
18+
returns:
19+
this `KnowledgeGraph` object – used for method chaining
20+
"""
21+
if len(self._g) == 0: # type: ignore
22+
# generate the triples and load them to an RDFlib graph
23+
self._g = morph_kgc.materialize(config)
24+
else:
25+
# merge
26+
# for caveats about merging this way:
27+
# <https://rdflib.readthedocs.io/en/stable/merging.html>
28+
self._g.parse(morph_kgc.materialize(config)) # type: ignore
29+
30+
return self
31+
32+

0 commit comments

Comments
 (0)