DataSrc:DemoJan25/StrapiEvents: Difference between revisions

    From UNITApedia
    No edit summary
    No edit summary
    Line 1: Line 1:
    == Strapi Events with Subobjects ==
    <!-- 1) Fetch the data with #get_web_data -->
    {{#get_web_data:
    {{#get_web_data:
       |url = https://unitapedia.univ-unita.eu/strapi/api/events
       |url     = https://unitapedia.univ-unita.eu/strapi/api/events
       |format = JSON
       |format = JSON
       |data = eventId = data.*.id
       |data   = eventId = data.*.id, eventCreated = data.*.attributes.createdAt
       |debug = 1
       |debug   = 1
    }}
     
    <!-- 2) Store each array element as a subobject -->
    {{#store_external_table: StrapiEvents
      |id        = {{{eventId}}}
      |created    = {{{eventCreated}}}
    }}
     
    <!-- 3) Query the stored data using Semantic MediaWiki (#ask) -->
    {{#ask: [[-Has subobject::{{FULLPAGENAME}}]]
    |?id
    |?created
    |format=table
    |headers=show
    |mainlabel=-
    }}
    }}

    Revision as of 16:36, 27 January 2025

    Strapi Events with Subobjects