Dataset Viewer

The dataset viewer is not available because its heuristics could not detect any supported data files. You can try uploading some data files, or configuring the data files location manually.

Indonesian Legal Regulations - SQLite Database

Dataset Description

This is a SQLite database version of the Indonesian Legal Regulations Knowledge Graph dataset, optimized for easy querying and integration.

Database Statistics

  • Total Regulations: 199,998
  • Total Embeddings: 199,998
  • Total TF-IDF Vectors: 199,998
  • Database Size: 33062.38 MB

Database Schema

Main Tables

  1. regulations - Core regulation data with KG features
  2. embeddings - 1024D semantic embeddings (BLOB storage)
  3. tfidf_vectors - 20000D TF-IDF vectors (BLOB storage)
  4. kg_json_data - Knowledge Graph JSON data
  5. regulations_fts - Full-Text Search virtual table

Features

  • Optimized Indexing: Fast queries on common fields
  • Full-Text Search: FTS5 for content search
  • Normalized Storage: Separate tables for vectors
  • BLOB Storage: Efficient storage for large vectors
  • Foreign Keys: Referential integrity

Usage Example

import sqlite3
import numpy as np
from huggingface_hub import hf_hub_download

# Download database
db_path = hf_hub_download(
    repo_id="Azzindani/ID_REG_DB_2510",
    filename="id_regulations.db",
    repo_type="dataset"
)

# Connect
conn = sqlite3.connect(db_path)
cursor = conn.cursor()

# Query regulations
cursor.execute("""
    SELECT global_id, content, kg_authority_score 
    FROM regulations 
    WHERE regulation_type = 'UU' 
    ORDER BY year DESC 
    LIMIT 10
""")

for row in cursor.fetchall():
    print(row)

# Get embedding
cursor.execute("""
    SELECT embedding, dimension 
    FROM embeddings 
    WHERE global_id = ?
""", ('some_id',))

row = cursor.fetchone()
if row:
    embedding_blob, dim = row
    embedding = np.frombuffer(embedding_blob, dtype=np.float32)
    print(f"Embedding shape: {embedding.shape}")

# Full-text search
cursor.execute("""
    SELECT global_id, content 
    FROM regulations_fts 
    WHERE regulations_fts MATCH 'pajak OR perpajakan'
    LIMIT 10
""")

# Close
conn.close()

Query Examples

Find regulations by domain

SELECT * FROM regulations 
WHERE kg_primary_domain = 'tax' 
ORDER BY kg_authority_score DESC;

Search content with FTS

SELECT * FROM regulations_fts 
WHERE regulations_fts MATCH 'undang-undang pajak';

Get regulation with embedding

SELECT r.*, e.embedding 
FROM regulations r
JOIN embeddings e ON r.global_id = e.global_id
WHERE r.regulation_type = 'UU' AND r.year >= 2020;

Find highly cited regulations

SELECT * FROM regulations 
WHERE kg_pagerank > 0.001 
ORDER BY kg_pagerank DESC 
LIMIT 20;

Source Dataset

This database was created from: Azzindani/ID_REG_KG_2510

License

CC-BY-4.0

Citation

@dataset{indonesian_legal_db_2024,
  author = {Azzindani},
  title = {Indonesian Legal Regulations - SQLite Database},
  year = {2024},
  publisher = {HuggingFace},
  url = {https://huggingface.co/datasets/Azzindani/ID_REG_DB_2510}
}
Downloads last month
23