MCPcopy Create free account
hub / github.com/BIT-DataLab/LakeBench / findSubClasses

Function findSubClasses

union/Santos/preprocess_yago.py:23–40  ·  view source on GitHub ↗
(path)

Source from the content-addressed store, hash-verified

21 return (parent, child)
22
23def findSubClasses(path):
24 i = 1
25 j = 1
26 dictionary = {}
27 with open(path,'r', encoding = "UTF-8") as infile:
28 for line in infile:
29 line = line.lower()
30 #sample line: <http://yago-knowledge.org/resource/fishing_tackle> <http://www.w3.org/2000/01/rdf-schema#subclassof> <http://schema.org/thing> .
31 j+=1
32 if "rdf-schema#subclassof" in line and "http://schema.org/thing" in line:
33 parent, child = getParentAndChild(line)
34 dictionary[child] =[]
35 i+=1
36 if i % 1000 == 0:
37 print("Written lines:",i)
38 print("Processed lines:",j)
39 print("Class file written in class dictionary.")
40 return dictionary
41
42def findAllEdges(path):
43 i = 1

Callers 1

preprocess_yago.pyFile · 0.85

Calls 1

getParentAndChildFunction · 0.85

Tested by

no test coverage detected