(path)
| 21 | return (parent, child) |
| 22 | |
| 23 | def 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 | |
| 42 | def findAllEdges(path): |
| 43 | i = 1 |
no test coverage detected