CoolFace
Datasetpublic

Kandil7/Athar-Datasets

πŸ•Œ Athar Islamic QA Datasets 18.7M passages from classical Islamic books spanning 1,400 years of scholarship A comprehensive collection of Islamic texts covering Quran, Hadith, Fiqh, Tafsir, Aqeedah, Seerah, and more β€” sourced from the Shamela library and enriched with scholarly metadata for RAG-based Islamic QA systems. Based on the Fanar-Sadiq Architecture for grounded, citation-backed Islamic question answering. πŸ“Š Dataset Summary Metric Value… See the full description on the dataset page: https://huggingface.co/datasets/Kandil7/Athar-Datasets.

sourceHugging Facemitupdated 5mo agoView on Hugging Face
8likes152downloads
Dataset Card

πŸ•Œ Athar Islamic QA Datasets

18.7M passages from classical Islamic books spanning 1,400 years of scholarship

A comprehensive collection of Islamic texts covering Quran, Hadith, Fiqh, Tafsir, Aqeedah, Seerah, and more β€” sourced from the Shamela library and enriched with scholarly metadata for RAG-based Islamic QA systems.

Based on the Fanar-Sadiq Architecture for grounded, citation-backed Islamic question answering.


πŸ“Š Dataset Summary

MetricValue
Total Passages18,701,966
Total Size~40 GB
Collections10
SourceElShamela Library (Ψ§Ω„Ω…ΩƒΨͺΨ¨Ψ© Ψ§Ω„Ψ΄Ψ§Ω…Ω„Ψ©)
LanguagesArabic (primary), English (metadata)
Time Span0-1400 AH (7th-21st century CE)

πŸ“š Collections

#CollectionPassagesSizeDescription
1hadith_passages5,059,54711 GBProphetic traditions (Sahih Bukhari, Muslim, etc.)
2general_islamic3,410,4366.1 GBGeneral Islamic knowledge, spirituality, ethics
3fiqh_passages2,397,9886.6 GBIslamic jurisprudence (Hanafi, Maliki, Shafi'i, Hanbali)
4islamic_history_passages2,850,2885.6 GBIslamic history (Prophetic to Ottoman era)
5quran_tafsir2,128,6064.9 GBQuranic exegesis (Tabari, Qurtubi, Ibn Kathir, etc.)
6arabic_language_passages1,015,3112.2 GBArabic grammar, linguistics, rhetoric
7aqeedah_passages738,0031.7 GBIslamic creed and theology
8spirituality_passages438,7761.1 GBSufism, tasawwuf, purification of the heart
9usul_fiqh368,388874 MBPrinciples of Islamic jurisprudence
10seerah_passages294,623755 MBProphet Muhammad's biography

πŸ“‹ Schema

Each passage contains the following fields:

FieldTypeDescription
contentstringMain passage text (Arabic)
content_typestringType of content
book_idint64Unique book identifier
book_titlestringTitle of the source book
categorystringCategory (e.g., "Ψ§Ω„ΨΉΩ‚ΩŠΨ―Ψ©", "الفقه")
authorstringAuthor name
author_deathint64Author's death year (Hijri)
collectionstringCollection name
page_numberint64Page number in source
section_titlestringSection heading
hierarchylistHierarchical path [book, chapter, section]
titlestringPassage title
chapterstringChapter name
sectionstringSection name
pageint64Page number

Example Entry

json
{
  "content": "Ψ§Ω„Ψ­Ω…Ψ― Ω„Ω„Ω‡ Ω†Ψ­Ω…Ψ―Ω‡ ΩˆΩ†Ψ³ΨͺΨΉΩŠΩ†Ω‡ ΩˆΩ†Ψ³ΨͺΨΊΩΨ±Ω‡ΨŒ ΩˆΩ†ΨΉΩˆΨ° Ψ¨Ψ§Ω„Ω„Ω‡ Ω…Ω† شرور أنفسنا...",
  "book_id": 1234,
  "book_title": "Ψ§Ω„ΩΩˆΨ§Ψ¦Ψ― Ψ§Ω„ΨΉΨ°Ψ§Ψ¨ في Ψ§Ω„Ψ±Ψ― ΨΉΩ„Ω‰ Ω…Ω† Ω„Ω… ΩŠΨ­ΩƒΩ… Ψ§Ω„Ψ³Ω†Ψ© ΩˆΨ§Ω„ΩƒΨͺΨ§Ψ¨",
  "category": "Ψ§Ω„ΨΉΩ‚ΩŠΨ―Ψ©",
  "author": "Ψ­Ω…Ψ― Ψ¨Ω† Ω†Ψ§Ψ΅Ψ± Ψ’Ω„ Ω…ΨΉΩ…Ψ±",
  "author_death": 1225,
  "collection": "aqeedah_passages",
  "page_number": 1,
  "section_title": "Ω…Ω‚Ψ―Ω…Ψ© Ψ§Ω„Ω…Ψ­Ω‚Ω‚",
  "hierarchy": ["Ψ§Ω„ΩΩˆΨ§Ψ¦Ψ― Ψ§Ω„ΨΉΨ°Ψ§Ψ¨", "Ω…Ω‚Ψ―Ω…Ψ© Ψ§Ω„Ω…Ψ­Ω‚Ω‚"],
  "title": "Ω…Ω‚Ψ―Ω…Ψ© Ψ§Ω„Ω…Ψ­Ω‚Ω‚",
  "chapter": null,
  "section": null,
  "page": 1
}

πŸ“Š Collection Breakdown

Passages Distribution

hadith_passages              β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ  5,059,547 (27%)
general_islamic              β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ             3,410,436 (18%)
fiqh_passages                β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ                    2,397,988 (13%)
islamic_history_passages     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ                    2,850,288 (15%)
quran_tafsir                 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ                      2,128,606 (11%)
arabic_language_passages     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ                            1,015,311 (5%)
aqeedah_passages             β–ˆβ–ˆβ–ˆβ–ˆ                               738,003 (4%)
spirituality_passages        β–ˆβ–ˆ                                 438,776 (2%)
usul_fiqh                    β–ˆ                                  368,388 (2%)
seerah_passages              β–ˆ                                  294,623 (2%)

πŸ”§ How to Load

Using HuggingFace Datasets

python
from datasets import load_dataset

# Load full dataset
ds = load_dataset("Kandil7/Athar-Datasets")

# Access specific collection
for row in ds['train']:
    if row['collection'] == 'fiqh_passages':
        print(row['content'][:200])
        break

# Filter by collection
hadith_ds = ds['train'].filter(lambda x: x['collection'] == 'hadith_passages')

Streaming Mode (Memory Efficient)

python
from datasets import load_dataset

# Stream without downloading
ds = load_dataset("Kandil7/Athar-Datasets", split="train", streaming=True)

for i, passage in enumerate(ds):
    if i >= 5:
        break
    print(f"{passage['collection']}: {passage['title']}")

Direct JSONL Access

python
import json

# Load specific collection
with open('hadith_passages.jsonl', 'r', encoding='utf-8') as f:
    passages = [json.loads(line) for line in f]

print(f"Loaded {len(passages):,} hadith passages")

πŸ’‘ Usage Examples

Example 1: Semantic Search with RAG

python
from sentence_transformers import SentenceTransformer
import numpy as np
import json

# Load embedding model
model = SentenceTransformer('BAAI/bge-m3')

# Load a sample collection
with open('fiqh_passages.jsonl', 'r', encoding='utf-8') as f:
    passages = [json.loads(line) for line in f][:1000]

# Create embeddings
texts = [p['content'] for p in passages]
embeddings = model.encode(texts)

# Search
query = "Ω…Ψ§ Ψ­ΩƒΩ… Ψ΅Ω„Ψ§Ψ© Ψ§Ω„Ψ¬Ω…Ψ§ΨΉΨ©ΨŸ"
query_embedding = model.encode([query])[0]

# Find most similar
scores = np.dot(embeddings, query_embedding)
top_idx = np.argsort(scores)[-5:][::-1]

for idx in top_idx:
    print(f"Score: {scores[idx]:.3f}")
    print(passages[idx]['content'][:200])
    print("---")

Example 2: Filter by Era

python
# Filter classical era scholars (200-500 AH)
classical_passages = [
    p for p in passages
    if 200 <= p.get('author_death', 0) <= 500
]

# Filter by author
imam_bukhari = [
    p for p in hadith_passages
    if 'Bukhari' in p.get('author', '')
]

Example 3: Citation-Enhanced QA with Athar

python
# Use the Athar system for grounded answers
# See: https://github.com/Kandil7/Athar

from Athar import FiqhAgent

agent = FiqhAgent()
result = await agent.execute(
    query="Ω…Ψ§ Ψ­ΩƒΩ… Ψ΅Ω„Ψ§Ψ© Ψ§Ω„Ψ¬Ω…Ψ§ΨΉΨ©ΨŸ",
    filters={"era": "classical"}
)

# Result includes citations
for citation in result.citations:
    print(citation.source)
    print(citation.text)

πŸ“– Source: ElShamela Library (Ψ§Ω„Ω…ΩƒΨͺΨ¨Ψ© Ψ§Ω„Ψ΄Ψ§Ω…Ω„Ψ©)

This dataset is derived from ElShamela Library (Ψ§Ω„Ω…ΩƒΨͺΨ¨Ψ© Ψ§Ω„Ψ΄Ψ§Ω…Ω„Ψ©) β€” the largest comprehensive digital library of Islamic texts.

About ElShamela

ElShamela (Ψ§Ω„Ω…ΩƒΨͺΨ¨Ψ© Ψ§Ω„Ψ΄Ψ§Ω…Ω„Ψ©) is a free, open-access digital library that has been digitizing and preserving classical Islamic texts for over two decades.

Website: https://shamela.ws/

Processing Pipeline

  1. 1.Extracted books from ElShamela Library format
  2. 2.Converted from proprietary Shamela format to plain text
  3. 3.Split into pages and passages for granular retrieval
  4. 4.Enriched with metadata:
  5. 5.Author names and death years (Hijri)
  6. 6.Book titles and categories
  7. 7.Chapter and section headings
  8. 8.Page numbers
  9. 9.Organized into 10 scholarly collections

πŸ—οΈ Scholarly Eras

EraRange (AH)Range (CE)Description
Prophetic0-100622-718Companions of Prophet ο·Ί
Tabi'un100-200718-815Successors
Classical200-500815-1106Golden age of Islamic scholarship
Medieval500-9001106-1496Post-classical period
Ottoman900-13001496-1883Ottoman era
Modern1300+1883+Modern period

🀝 Related Projects

  • β€”[Athar](https://github.com/Kandil7/Athar) β€” Production-ready Islamic QA system using this dataset
  • β€”[Fanar-Sadiq Architecture](docs/Fanar-Sadiq%20A%20Multi-Agent%20Architecture%20for%20Grounded%20Islamic%20QA.pdf) β€” Research paper

πŸ“ Citation

bibtex
@misc{athar-datasets-2026,
  title={Athar Islamic QA Datasets},
  author={Kandil, Ahmed},
  year={2026},
  url={https://huggingface.co/datasets/Kandil7/Athar-Datasets},
  note={18.7M passages from 10 Islamic collections}
}

⚠️ Usage Notes

  1. 1.Scholarly Context: These texts represent classical Islamic scholarship. Always consult qualified scholars for religious rulings.
  1. 1.Hadith Authenticity: Hadith passages include chains of narration (esnad). Use authenticity grading to evaluate reliability.
  1. 1.Fiqh Diversity: The fiqh collection represents multiple schools of thought (Hanafi, Maliki, Shafi'i, Hanbali).
  1. 1.Language: Primary content is in Classical Arabic. Metadata includes English translations.
  1. 1.Licensing: MIT License β€” free for research and commercial use.

πŸ“ File Structure

Athar-Datasets/
β”œβ”€β”€ hadith_passages.jsonl              # 5,059,547 passages (11 GB)
β”œβ”€β”€ general_islamic.jsonl              # 3,410,436 passages (6.1 GB)
β”œβ”€β”€ fiqh_passages.jsonl                # 2,397,988 passages (6.6 GB)
β”œβ”€β”€ islamic_history_passages.jsonl     # 2,850,288 passages (5.6 GB)
β”œβ”€β”€ quran_tafsir.jsonl                 # 2,128,606 passages (4.9 GB)
β”œβ”€β”€ arabic_language_passages.jsonl      # 1,015,311 passages (2.2 GB)
β”œβ”€β”€ aqeedah_passages.jsonl             # 738,003 passages (1.7 GB)
β”œβ”€β”€ spirituality_passages.jsonl         # 438,776 passages (1.1 GB)
β”œβ”€β”€ usul_fiqh.jsonl                    # 368,388 passages (874 MB)
└── seerah_passages.jsonl              # 294,623 passages (755 MB)

πŸ“ž Contact & Support

  • β€”GitHub: https://github.com/Kandil7/Athar
  • β€”HuggingFace: https://huggingface.co/Kandil7

<div align="center">

Built with ❀️ for the Muslim community

πŸ•Œ Athar Islamic QA β€’ 18.7M passages β€’ 10 collections β€’ 1,400 years of scholarship

</div>