Skip to content

Commit

Permalink
initial work for meta graph
Browse files Browse the repository at this point in the history
  • Loading branch information
Binh Vu committed Jan 19, 2024
1 parent 801e6f9 commit 1ace2dc
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kgdata/wikidata/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ def __init__(self, datadir: Path) -> None:
self.entity_types_and_degrees = datadir / "076_entity_types_and_degrees"
self.entity_wiki_aliases = datadir / "077_entity_wiki_aliases"

self.meta_graph = datadir / "080_meta_graph"

# deprecated
self.wp2wd = datadir / "wp2wd"
self.search = datadir / "search"
Expand Down
31 changes: 31 additions & 0 deletions kgdata/wikidata/datasets/meta_graph.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
from __future__ import annotations

from collections import defaultdict
from dataclasses import dataclass
from typing import Dict, List, Optional, Tuple, Union

import orjson
from kgdata.dataset import Dataset
from kgdata.wikidata.config import WikidataDirCfg
from kgdata.wikidata.datasets.entities import entities
from kgdata.wikidata.datasets.entity_types import entity_types
from kgdata.wikidata.models.wdentity import WDEntity

# def get_meta_graph_dataset(with_dep: bool = True):
# cfg = WikidataDirCfg.get_instance()

# if with_dep:
# deps = [entities(), entity_types()]
# else:
# deps = []

# return Dataset(
# cfg.main_property_connections / "*.gz",
# deserialize=deser_connection,
# name="property-connections",
# dependencies=deps,
# )


# def meta_graph():
# entity_outlinks()

0 comments on commit 1ace2dc

Please sign in to comment.