Skip to content

Commit 02591f4

Browse files
author
Ismail Ugur Bayindir
authored
Type fix for generate enrichment graph (#44)
* Updated pandasaurus version to 0.3.7 * Refactored generate_enrichment_graph method
1 parent e7865f2 commit 02591f4

File tree

4 files changed

+250
-196
lines changed

4 files changed

+250
-196
lines changed

pandasaurus/graph/graph_generator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import networkx as nx
44
import pandas as pd
5-
from rdflib import RDF, RDFS, Graph, Literal, Namespace, URIRef
5+
from rdflib import OWL, RDF, RDFS, Graph, Literal, Namespace, URIRef
66
from rdflib.plugins.sparql import prepareQuery
77

88
from pandasaurus.graph.graph_generator_utils import (
@@ -37,7 +37,9 @@ def generate_enrichment_graph(enriched_df: pd.DataFrame) -> Graph:
3737
s = cl_namespace[row["s"].split(":")[-1]]
3838
o = cl_namespace[row["o"].split(":")[-1]]
3939
graph.add((s, RDFS.label, Literal(row["s_label"])))
40+
graph.add((s, RDF.type, OWL.Class))
4041
graph.add((o, RDFS.label, Literal(row["o_label"])))
42+
graph.add((o, RDF.type, OWL.Class))
4143
graph.add((s, RDFS.subClassOf, o))
4244
return graph
4345

0 commit comments

Comments
 (0)