Skip to content

Commit

Permalink
add add method for ontonetwork
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Jul 17, 2023
1 parent 36995f4 commit 3c9018e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pyscal_rdf/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,21 @@ def __init__(self, infile=None):
self.onto = OntoParser(infile)
self.data_prefix = 'value'

def _parse_all(self):
#call methods
self._add_class_nodes()
self._add_object_properties()
self._add_data_properties()

def __add__(self, ontonetwork):
pass

#add onto network
self.onto = self.onto + ontonetwork.onto
#now parse again
self._parse_all()

def __radd__(self, ontonetwork):
return self.__add__(ontonetwork)

def get_shortest_path(self, source, target):
path = nx.shortest_path(self.g, source=source, target=target)
return path
Expand Down

0 comments on commit 3c9018e

Please sign in to comment.