استعلام قواعد البيانات بلغة طبيعية
يخلّي غير المحلّلين يسألون أسئلة بيانات بإنجليزية بسيطة ويحصّلون إجابات من مستودع بيانات الشركة أو قاعدة تقاريرها. يترجم السؤال لاستعلام، ويشغّله، ويعرض النتيجة مع الأرقام الأساسية والـ SQL خلفها. يختلف عن text-to-SQL العام لأن النمط يشتغل مقابل نموذج بيانات الشركة الفعلي بدلالات موثّقة — يعرف وش يعني “عميل نشط” في شغلك، مو وش ممكن يعني “عميل نشط” عموماً. يرفض أسئلة ما يقدر يبنيها على المخطّط، ويبرز عدم اليقين بدل التخمين. قيمة النمط طيّ حلقة “بسأل فريق البيانات وأسمع منهم الأسبوع الجاي” لشي يصير في الاجتماع اللي طلع فيه السؤال.
المتطلبات تصف قدرات يحتاجها النمط في بيئتك، مو الموردين اللي لازم تشتريهم. أي نظام يملأ متطلباً يحقّقه — وهذا اللي يخلّي الكتالوج قابلاً للنقل عبر الذيل الطويل من أدوات الشركات الصغيرة والمتوسطة.
queryable_data_storeThe structured data warehouse, BI database, or curated tables the pattern queries against.
- data warehouse with curated marts
- BI database with denormalized reporting tables
- operational database with read replica for analytical queries
semantic_layer_documentationWhat things actually mean in this business. The single most important component: without explicit semantics, the pattern guesses and gets it wrong.
- semantic layer in the BI tool
- structured data dictionary maintained by the data team
- metric definitions library
- dbt model documentation
user_query_surfaceWhere users ask their questions, in their working environment.
- chat bot for data questions
- search bar in the BI tool
- embedded query interface in the company portal
- browser extension for the data team
permission_resolverWhat data the asking user is allowed to see. Critical: permissions are not an afterthought, they're a constraint on every query.
- data warehouse row-level security
- BI tool permission model
- explicit permission groups maintained by the data team
answer_destinationWhere the answer goes back to the user with the result, the query, and the trail.
- chat reply with embedded chart and expandable query
- answer panel in the BI tool
- dedicated result view linked from the asker's working tools
query_audit_logEvery query the pattern runs gets logged for audit, performance review, and learning.
- query log in the data platform
- structured audit trail in the data warehouse
- compliance archive of data access
answer_feedback_loopHow users confirm or correct the pattern's interpretation, used to tune the semantic layer and the query generation.
- thumbs widget after each answer with correction interface
- weekly review with the data team of low-confidence answers
- structured feedback capture in the answer destination
- 01User asks a question through the query surface
user_query_surface - 02Resolve user permissions to scope the question
permission_resolver - 03Match question to semantic layer: which entities, metrics, time ranges, segments
semantic_layer_documentation - 04Generate query with full schema awareness; if uncertain about interpretation, surface options rather than guess
queryable_data_storeقرار If interpretation is ambiguous, ask the user before running rather than guessing. - 05Execute query against the data store with permission constraints applied
queryable_data_store - 06Present the result with the underlying query visible, plus context (what was filtered, what assumptions were made)
answer_destination - 07Log query for audit
query_audit_log - 08Capture feedback for tuning
answer_feedback_loop
مخرجات منظّمة ينتجها هذا النمط. أنماط ثانية وأنظمة العملاء تقدر تشترك فيها، وهكذا يتركّب الكتالوج مع الوقت.
query_pattern_signalWhat people actually ask about, useful for data team prioritization of marts and metrics.
- data team roadmap
- semantic layer maintenance
- analytics priorities
semantic_gap_signalQuestions the pattern couldn't answer well due to missing definitions or model gaps.
- semantic layer authoring
- data modeling priorities
- dbt project priorities
data_literacy_signalAggregate view of who's asking what across the firm, useful for understanding which teams use data and how.
- enablement priorities
- data team capacity planning
- data culture metrics