تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
للتحقّق من صحة الكيانات عند إنشاء خلاصتك أو تعديلها، استخدِم مخطّطات JSON التالية. تستند المخططات إلى مواصفات مخطّط JSON.
من خلال إضافة اختبار وحدة للتحقّق من صحة الكيانات التي تنشئها، يمكنك رصد
المشاكل التي قد تؤثّر في جودة الخلاصة. يمكنك أيضًا استخدام هذه المخططات أثناء تطوير خلاصتك لتجنّب الأخطاء الشائعة.
يتحقق مخطّط التلفزيون المباشر من صحة العناصر BroadcastEvent وBroadcastService وCableOrSatelliteService وMovie وOrganization وSportsEvent وTelevisionChannel وTVEpisode وTVSeason وTVSeries.
يُجري Music Schema عمليات تحقّق من عناصر MusicAlbum وMusicGroup وMusicPlaylist وMusicRecording.
يُجري مخطّط الراديو عمليات تحقّق من RadioBroadcastService عنصر.
استخدِم المواصفات الواردة في هذا الموقع الإلكتروني كمصدر للمعلومات الصحيحة، لأنّه قد لا يتم تنفيذ جميع الميزات في هذه المخططات.
تمّت كتابة المخططات المقدّمة بتنسيق مسودة 7، لذا يجب أن يكون التنفيذ الذي تختاره متوافقًا مع هذا الإصدار لكي يعمل بشكلٍ سليم.
مثال على التحقّق من الصحة
يوضّح المثال التالي كيفية التحقّق من صحة جميع الكيانات المتوفّرة في ملف
feed.json باستخدام ملف المخطّط schema.json ووحدة python jsonschema. تكون الكيانات في
الملكية dataFeedElement كما هو محدّد في مستندات مغلف خلاصة البيانات.
importjsonfromjsonschemaimportvalidate# Loading the schema filewithopen("schema.json","r")asfp:schema=json.load(fp)# Opening the feedwithopen("feed.json","r")asfp:feed=json.load(fp)# Validating each entity in the feedforentityinfeed["dataFeedElement"]:try:validate(schema=schema,instance=entity)print("Entity validated successfully")exceptExceptionase:# e may contain an explanation as to why the entity wasn't validprint("Failed to validate the entity")
[[["يسهُل فهم المحتوى.","easyToUnderstand","thumb-up"],["ساعَدني المحتوى في حلّ مشكلتي.","solvedMyProblem","thumb-up"],["غير ذلك","otherUp","thumb-up"]],[["لا يحتوي على المعلومات التي أحتاج إليها.","missingTheInformationINeed","thumb-down"],["الخطوات معقدة للغاية / كثيرة جدًا.","tooComplicatedTooManySteps","thumb-down"],["المحتوى قديم.","outOfDate","thumb-down"],["ثمة مشكلة في الترجمة.","translationIssue","thumb-down"],["مشكلة في العيّنات / التعليمات البرمجية","samplesCodeIssue","thumb-down"],["غير ذلك","otherDown","thumb-down"]],[],[[["\u003cp\u003eJSON Schemas are provided to validate entities when creating or updating your data feed, ensuring data quality and consistency.\u003c/p\u003e\n"],["\u003cp\u003eChoose the appropriate Media Actions schema (VOD, Live TV, Music, or Radio) based on the type of entities in your feed.\u003c/p\u003e\n"],["\u003cp\u003eSelect a validator implementation that supports JSON Schema draft 7 and integrate it into your workflow for automated validation.\u003c/p\u003e\n"],["\u003cp\u003eRefer to the specification on this site as the primary source of truth for entity requirements, as schemas may not include all features.\u003c/p\u003e\n"],["\u003cp\u003eUtilize the provided example code snippet to validate entities within your feed using the chosen schema and a compatible validator.\u003c/p\u003e\n"]]],["To validate feed entities, use the provided JSON Schemas, based on the JSON Schema specification, for different media types: Video On Demand, Live TV, Music, and Radio. Add unit tests for validation to detect issues and avoid errors during feed development. Choose a validator implementation supporting draft 7, such as the `jsonschema` python module. Validate entities by loading the schema and feed, then iterating through entities in the `dataFeedElement` property and testing with the selected implementation, printing the results.\n"],null,[]]