<commit_before><?php header('Content-Type: application/ld+json'); ?>
<?php header('Access-Control-Allow-Origin: *'); ?>
{
    "@context": "<?php echo get_option('ldp_context', 'http://owl.openinitiative.com/oicontext.jsonld'); ?>",
    "@graph": [ {
        "@id" : "",
        "@type" : "http://www.w3.org/ns/ldp#BasicContainer",
        "http://www.w3.org/ns/ldp#contains" : [
          <?php
          $output = 'objects'; // or names
          $terms = get_terms(array('ldp_container'), array('hide_empty'=>false));
          foreach( $terms as $term ) :
             ?>{
                "@id": "<?php echo site_url(); ?>/ldp_resource/<?php echo $term->slug;?>"
            }
        <?php endforeach; ?>
]}
    ]
}<commit_msg>Fixing divergence between 2 templates<commit_after><?php header('Content-Type: application/ld+json'); ?>
<?php header('Access-Control-Allow-Origin: *'); ?>
{
    "@context": "<?php echo get_option('ldp_context', 'http://owl.openinitiative.com/oicontext.jsonld'); ?>",
    "@graph": [ {
        "@id" : "<?php echo 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; ?>",
        "@type" : "http://www.w3.org/ns/ldp#BasicContainer",
        "http://www.w3.org/ns/ldp#contains" : [
            <?php while (have_posts()) : the_post(); ?>{
<?php
                  $values = get_the_terms($post->ID, 'ldp_container');
                  if (empty($values[0])) {
                    $value = reset($values);
                  } else {
                    $value = $values[0];
                  }

                  $termMeta = get_option("ldp_container_$value->term_id");
                  $ldpIncludedFieldsList = isset($termMeta['ldp_included_fields_list']) ? $termMeta['ldp_included_fields_list'] : null;
                  $modelsDecoded = json_decode($termMeta['ldp_model']);

                  $includedFieldsList = !empty($ldpIncludedFieldsList) ? array_map('trim', explode(',', $ldpIncludedFieldsList)) : null;
                  $fields = $modelsDecoded->{$value->slug}->fields;
                  foreach ($fields as $field) {
                    if ((!empty($includedFieldsList) && in_array($field->name, $includedFieldsList))
                          && !empty(get_post_custom_values($field->name)[0])) {
                      echo('                "'.substr($field->name, 4).'": ');
                      echo(json_encode(get_post_custom_values($field->name)[0]) . ",\n");
                    }
                  }

                  $rdfType = isset($termMeta["ldp_rdf_type"]) ? $termMeta["ldp_rdf_type"] : null;
                  if (!empty($rdfType)) echo "                \"@type\" : \"$rdfType\",\n";
                ?>
                "@id": "<?php the_permalink(); ?>"
            }<?php if($wp_query->current_post + 1 < $wp_query->post_count) { echo(",\n"); } else { echo("\n"); } ?>
        <?php endwhile; ?>
]}
    ]
}
{'fraction_non_alphanumeric': 0.19798190675017396, 'fraction_numerical': 0.003827418232428671, 'mean_word_length': 2.108108108108108, 'pattern_counts': {'":': 7, '<': 20, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7557221', 'n_tokens_mistral': 914, 'n_tokens_neox': 887, 'n_words': 126}