This repository has been archived by the owner on Aug 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
RESTful API
Hendy Irawan edited this page Sep 26, 2015
·
34 revisions
Sanad RESTful API v0.1
- Add-on men-scan laman web yang sedang dibuka, sesuai struktur (karena bisa ada penyesuaian untuk beberapa struktur page yang dikenali, khususnya social media seperti Facebook, Twitter, atau software forum diskusi seperti vBulletin/phpBB), mengekstrak semua kalimat yang relevan
- Normalisasi kalimat tersebut sesuai kaidah bahasa: menstandarkan tanda baca, line ending, whitespace, kapitalisasi, dll.
- Maksud dari sesuai kaidah bahasa, misalnya di bahasa Indonesia tidak mengenal huruf beraksen seperti "å" maka huruf-huruf tersebut diganti "a".
- Untuk bahasa-bahasa yang dikenali di Eropa, dilakukan normalisasi aksen.
- Untuk kaidah bahasa Arab, lakukan normalisasi tashkeel alias menjadi Arab gundul: "بِسْمِ ٱللهِ" menjadi "بسم الله", semua alif dinormalisasi jadi "ا"
- Karakter yang tidak dikenali akan dibuang.
- TODO: Hash teks yang dinormalisasi, misal "zakat itu wajib" -> "z4 i2 w4". (see https://github.com/soluvas/sanad/issues/4)
- Kirim data teks ini ke server
- Cocokkan data dari server dengan struktur di sisi client
- Lakukan anotasi DOM HTML berdasarkan data yang match
- Kumpulkan teks ingin dicek
- Normalisasi teks tersebut sesuai kaidah bahasa (lihat "Browser add-on" untuk detail)
- Optionally hashed
- Kirim data teks normalized/fingerprinted ini ke server
- Cocokkan data dari server dengan struktur di sisi client
- Tampilkan teks sesuai kebutuhan aplikasi dengan anotasi yang diterima
- Kumpulkan teks ingin dicek
- Normalisasi teks tersebut sesuai kaidah bahasa (lihat "Browser add-on" untuk detail)
- Optionally hashed
- Kirim data teks normalized/fingerprinted ini ke server Sanad
- Cocokkan data dari server Sanad dengan struktur di sisi consumer
- Tampilkan teks atau lakukan pengolahan data sesuai kebutuhan consumer dengan anotasi yang diterima
Sebetulnya logika periwayatan sangat relevan sekarang:
- matan... tujuannya/substansinya apa, jika tujuannya menjelek-jelekkan ini harus dianggap meragukan dan harus dilihat lebih lanjut
- rawi-nya, bagaimana kredibilitas sumber, apakah dikenal memilik bias? apakah pernah sengaja menyebarkan kebohongan (biar dng tujuan syiasah sekalipun)
- sanad, bagaimana rangkaian periwayatannya, apakah tersambung ke sumber utamanya, atau terputus. Imam Bukhari ra, mengimplementasikan metoda di atas atas 500.000 hadits dan hanya menerima 5000 buah.
- API menuruti kaidah JSON API
- Dokumentasi RESTful API normatif akan disediakan dalam format Swagger 1.x via swagger-springmvc
- Implementasi server-side menggunakan Spring HATEOAS
- Data modeling menggunakan kaidah Linked Data, schema.org, SKOS
- Markup language AsciiDoc
-
TypeLink
.a
/rdfs:type
link. This is an instance of the referenced class. -
SameAsLink
.owl:sameAs
link. This instance or class is a synonym of the other. Usually the referenced resource is the definitive one. -
Article
/ScholarlyArticle
/Hadith
. A definitive narration. Every narration is anArticle
s, however can be promoted toScholarlyArticle
orHadith
by one or more testimonies. AHadith
is a subclass ofScholarlyArticle
, e.g. using data from http://qaalarasulallah.com/ -
Variation
. A variation of one or more narration(s), the purpose is evaluated independently of the referenced narration(s). -
Scholar
. Information about a person/scholar (can be deceased), which have been verified by anPerson
orOrganization
. e.g. using data from http://muslimscholars.info/ - Bibliography of a CreativeWork, e.g. Book, NewsArticle, etc.
The narrators of ahadith were broken up into different grades, ranks or levels based on whether or not ahadith could be accepted from them. Ibn Hajar al-'Asqalani placed the narrators into twelve ranks. The ranks as named and categorized by Ibn Hajar are widely accepted but not universal.
-
companion
. Companions: The first generation of Muslims did not need testimony to their knowledge or character as Allah the Most High has already done so in the Qur'an. -
trustworthiest
. Awthaqun Nas (Thiqa Thiqa): These are the trustworthiest of people outside of the first generation of Muslims and this is the highest rank. They were learned scholars who were also of the most upright moral characters. -
trustworthy
. Thiqat: These narrators are trustworthy in all areas including good retentive memory, but not to a superlative degree like those in the second rank. -
truthful
. Saduq: truthful but less than rank three. -
honest
. Saduq Yahim: Those who are trustworthy but who sometimes made mistakes in narrating ahadith, or have some delusion. -
acceptable
. Maqbool/Layyin: Those who are accepted or acceptable. They transmitted a smaller number of ahadith, and we do not have proof against their reliability (or for them to be extraordinarily sound). -
uncertain
. Majhool al-haal/Mastur (not Thiqa): Those whose situation is not precisely known. He had students who transmitted ahadith from him, but he does not have tawtheeq, or a testimony of trustworthiness, from the scholars of ahadith. There is nothing wrong with him from that which is apparent, but we don't really know anything about him. -
weak
. Da'eef or weak: This means that there is nobody speaking positively on his behalf, and some of the scholars have spoken against him. -
unknown
. Majhool or unknown: This is not the same as majhool al-haal. The majhool al-haal had more than one student narrate from him; the majhool is narrated from by only one individual, and we know nothing of him or his honesty. -
abandoned
. Matruk or abandoned: This rank covers a few categories of narrators. This includes the one who committed many mistakes, the one who has detailed criticisms against him from the scholars, or one who did not meet the requirement for moral character. Also included here are the ones upon major sins (the fasiq) and the one who is unintelligent. -
accused
. Muttaham bi'l kadhib: The one who was accused of lying and/or making up fake ahadith. The ahadith he narrates are considered batil. -
liar
. Kadhdhaab, waddaa': This is the one who is actually called a liar or fabricator. Being labeled with such a title is not the same as merely being accused of committing those acts in some instances. The ahadith he narrates are considered mawdu' or fabricated.
Dokumentasi teknis API ada di http://soluvas.github.io/sanad/
TODO: ganti dengan Swagger API docs
Struktur:
{
"annotations": [ /* Annotation object */
{
id: "s0",
hash: "z4 i2 w4",
normalized: "zakat itu wajib",
adoc: "_Zakat_ itu **wajib**.", /* Asciidoc syntax */
html: "<em>Zakat</em> itu <strong>wajib</strong>.", /* HTML format */
authenticity:
"authentic" /* Ṣaḥīḥ (صَحِيْح)*/ |
"good" /* Ḥasan (حَسَن) */ |
"weak" /* Ḍaʻīf (ضَعِيْف) */
purpose: "good" | "bad", /* matan */
narrator: { /* rawi, Person object */
"id": "hendy",
"name": "Hendy Irawan"
},
successiveness: /* sanad/isnād. mashhur/aziz/gharib implies "singular" ahaad (آحاد) */
"wording" | /* mutawatir (مُتَواتِر) in wording */
"meaning" | /* mutawatir only in meaning, not wording */
"triple" | /* mashhur (مَشْهُوْر) */
"double" | /* aziz (عَزِيْز) */
"single", /* gharib (غَرِيْب) */
testimonies: [
{
"person": {
"id": "febru",
"name": "Febru Wasono"
},
"grade": "companion | ...", /* see Narrator Grades. the grade for the _topic at hand_, at the time of testimony */
"creationTime": "2014-07-07T01:02:03+07:00",
"place": "Kediri, East Java, Indonesia",
"ip4": "202.132.x.x", /* full IPv4 address is logged by system, but only /32 is recorded */
"ip6": "3ffe:1900:4545:3:x:x:x:x", /* full IPv6 address is logged by system, but only /32 is recorded */
"proxy4": "202.100.120.130", /* optional. full IPv4 proxy address is logged and recorded */
"proxy6": "3ffe:1900:4545:3:0:1:2:3" /* optional. full IPv6 proxy address is logged and recorded */
},
...
] /* testimonies */
},
...
]
}
Contoh:
curl -v -d normalized='taqobbalallahu minna wa minkum' sanad.sanad.amidea.dev:8980/annotation
> POST /annotation HTTP/1.1
> User-Agent: curl/7.35.0
> Host: sanad.sanad.amidea.dev:8980
> Accept: */*
> Content-Length: 41
> Content-Type: application/x-www-form-urlencoded
>
< HTTP/1.1 200 OK
< Server: Apache-Coyote/1.1
< Content-Type: application/json;charset=UTF-8
< Transfer-Encoding: chunked
< Date: Wed, 30 Jul 2014 17:38:53 GMT
<
{
"sections" : [ {
"transliterations" : [ {
"adoc" : "taqobbalallahu minna wa minkum",
"html" : "taqobbalallahu minna wa minkum",
"spellings" : [ {
"claims" : [ ],
"id" : "f4317c29-938b-48c3-9084-1a25fcb9870d",
"description" : "lafadznya تقبل الله منا ومنكم",
"descriptionHtml" : "lafadznya تقبل الله منا ومنكم",
"spelling" : "formal"
} ],
"normalized" : "taqobbalallahu minna wa minkum",
"numeronym" : null,
"id" : "6716d949-cfde-4911-8efc-d058a286b1f5"
} ]
} ],
"links" : [ ]
}
Query parameters:
-
normalized
(required, multiple cardinality), normalized text yang ingin di-annotate, misal "zakat itu wajib". Response masing-masing section disediakan secara berurutan. -
format
(optional): text | prefix (prefix numeronym) | numeronym (prefix & suffix numeronym)
Sama seperti `GET tapi di Form Parameters, menggunakan form encoding.
API versi 0.x ini masih memiliki kelemahan di sisi privacy, silakan berkontribusi ke https://github.com/soluvas/sanad/issues/4
-
Islamware Quran & hadith database. Delimited (CSV) file, Arabic, CP1256 encoding. To convert to UTF-8 encoding, use e.g.
iconv -f cp1256 -t utf8 hadith-0.txt -o hadith-0.unicode.txt
. For Sahih Bukhari: 7 MB ZIP -> 24 MB CP1256 -> 45 MB UTF-8 file (5.2 MB xz), numbered from 1 to 7008. Sahih Muslim: 2.5 MB ZIP -> 9.5 MB CP1256 -> 18 MB UTF-8 file (1.9 MB xz), numbered from 1 to 5362. - Database of Islamic hadith
- QaalaRasulallah.com - Comprehensive Hadith Database with interactive Chain
- Muslim Scholars Database
- AQFS Easy Quran wa Hadees (72,000 ahadith, EXE, 308 MB for v4.2), also at Hadices
- Hadith Collection (English, PDF)
- Imaan Star hadith software (EXE)
- Alim.org (online only)
- Hadith Al-Islam. عربي + English + Français + Deutsch + Türkçe + Melayu + Indonesia. Not all languages are complete.
- Al-Eman.com
- Sunnah.com. Arabic + English + Urdu + Indonesian, online only, very good.
- The Hadith Library. English, online only.
- Shamela. Arabic, 6111 books, ~2 GB zipped, 8.4 GB unzipped.
- Harf
- Quran Database
- Quran Download
- Tanzil.net - Online Quran. Used as the source of Quran Database, licensed under Creative Commons Attribution No Derivatives 3.0.