def get_title(cat): return title_to_uri(re.sub('^Category:', '', cat['title']), category=True)
def node_to_type_char(title): uri = title_to_uri(title, category=True) return 'Class' if is_class(uri) else 'Individual'
def _parse_line(self, line): title_and_label = line.strip().split(' -> ')[-1] title_, label = title_and_label.strip().split() topic = title_to_uri(title_.strip().replace('_', ' '), category=True) label = self._parse_label(label.strip()) return topic, label
def parse_line(line): title, label = line.strip().split() topic = title_to_uri(title.replace('_', ' '), category=True) type_ = NodeType.by_name(translate_label[label]) return topic, type_