Graph Data Science: an abstraction layer in Python for building knowledge graphs, integrated with popular graph libraries – atop Pandas, NetworkX, RAPIDS, RDFlib, pySHACL, PyVis, morph-kgc, pslpython, pyarrow, etc.
Note that get_ns_dict() only returns the prefix:uri pairs that have been added explicitly to a kglab.KnowledgeGraph object instances.
It should be returning the union of the namespaces referenced by each of the parses, loads, and explicit namespace additions.
Here's example code to fix the method's returned value:
kg = kglab.KnowledgeGraph()
kg.load_rdf("dat/wtm.ttl", format="ttl")
nm = kg.rdf_graph().namespace_manager
ns = {
prefix: uri
for prefix, uri in nm.namespaces()
}
return ns
Note that
get_ns_dict()
only returns the prefix:uri pairs that have been added explicitly to akglab.KnowledgeGraph
object instances.It should be returning the union of the namespaces referenced by each of the parses, loads, and explicit namespace additions.
Here's example code to fix the method's returned value: