Skip to content

Latest commit

 

History

History
32 lines (24 loc) · 1.12 KB

File metadata and controls

32 lines (24 loc) · 1.12 KB

Currently the morph-kgc package is pinned to use rdflib <7.3.0 due to unit

tests breaking with later versions: morph-kgc/morph-kgc#345

The following code has been temporarily removed from the kglab/serde.py module:

import morph_kgc

def materialize (
    self,
    config: str,
    ) -> "KnowledgeGraph": # type: ignore
    """

Binding to the Morph-KGC materialize() method.

config:

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

returns:

this KnowledgeGraph object – used for method chaining """ if len(self._g) == 0: # type: ignore # generate the triples and load them to an RDFlib graph self._g = morph_kgc.materialize(config) else: # merge # for caveats about merging this way: # https://rdflib.readthedocs.io/en/stable/merging.html self._g.parse(morph_kgc.materialize(config)) # type: ignore

    return self