<commit_before>
<!-- doing it like this makes it amenable to using sparql instead -->

<!-- should change the encoding to charset=ISO-8859-1  -->
<!-- should hard code rather than pass literals as parameter -->

<!-- an element  dc publisher thats getting repeated twice probably because of the rp person outside join -->

<!-- perhaps swap the ordering to read more cleanly - same as sparql 
  eg. 

    'select object from _rdf where subject = $1 and predicate = $$dc:title$$ ',
  s p o
-->

<?xml version="1.0" encoding="windows-1252"?>
<rdf:RDF 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:skos="http://www.w3.org/2004/02/skos/core#" 
xmlns:dc="http://purl.org/dc/elements/1.1/" 
xmlns:dcterms="http://purl.org/dc/terms/" 
xmlns:foaf="http://xmlns.com/foaf/0.1/">


-- I think we need further constraints ...
-- to restrict things to the parameter scheme .  how do we code this extra xml ? 
   
-- I think we just need to refine the outer query a little more ...
 

<% @conceptScheme = 'http://vocab.aodn.org.au/def/ClassScheme/parameter1' 
   %>

<skos:ConceptScheme rdf:about="<%= @conceptScheme %>">

	<% for @e in query_objects( 'dc:title',  @conceptScheme ) %>
    <dc:title><%= @e['object'] %></dc:title>
  <% end%>

	<% for @e in query_objects( 'dc:description',  @conceptScheme ) %>
    <dc:description><%= @e['object'] %></dc:description>
  <% end %>

	<% for @e in query_objects( 'dc:creator',  @conceptScheme ) %>
    <dc:creator>
      <foaf:Organisation>
        <foaf:name><%= @e['object'] %></foaf:name>
      <foaf:/Organisation>
    </dc:creator>
  <% end %>

  -- TODO element is repeated twice
  
	<% for @e in query_objects( 'dc:publisher',  @conceptScheme ) %>
    <dc:publisher>
      <foaf:Organisation>
        <foaf:name><%= @e['object'] %></foaf:name>
      <foaf:/Organisation>
    </dc:publisher>
  <% end %>

  <dc:rights>Freely Available For Reuse</dc:rights>

	<% for @e in query_objects( 'dcterms:issued',  @conceptScheme ) %>
  <dcterms:issued><%= @e['object'] %></dcterms:issued>
  <% end %>

</skos:ConceptScheme>






<% for @topConcept in query_subjects2( 'rdf:type',  'skos:TopConcept') %>
<skos:TopConcept rdf:about="<%= @topConcept %>">

    <% for @object in query_objects( 'skos:prefLabel',  @topConcept ) %>
    <skos:prefLabel><%= @object %></skos:prefLabel>
    <% end %>

    <% for @object in query_objects( 'skos:definition',  @topConcept ) %>
    <skos:definition><%= @object %></skos:definition>
    <% end %>

    <% for @object in query_objects( 'dcterms:issued',  @topConcept ) %>
    <dcterms:issued><%= @object %></dcterms:issued>
    <% end %>

    <% for @object in query_objects( 'skos:inScheme',  @topConcept ) %>
    <skos:inScheme><%= @object %></skos:inScheme>
    <% end %>

    <% for @object in query_objects( 'skos:narrower',  @topConcept ) %>
    <skos:narrower><%= @object %></skos:narrower>
    <% end %>

</skos:TopConcept>
<% end %>

-- should be able to use query map function ...

- it would be very nice if we could do this without indexing 
- with the name. eg. e instead of @concept['subject]

<% for @concept in query_subjects2( 'rdf:type',  'skos:Concept') %>

<skos:Concept rdf:about="<%= @concept %>">

    <% for @object in query_objects2( 'skos:inScheme', @concept) %>
    <skos:inScheme><%= @object %></skos:inScheme>
    <% end %>

    <% for @object in query_objects2( 'skos:broader', @concept) %>
    <skos:broader><%= @object %></skos:broader>
    <% end %>

    <% for @object in query_objects2( 'skos:prefLabel', @concept) %>
    <skos:prefLabel><%= @object %></skos:prefLabel>
    <% end %>
<commit_msg>ok, now updated to rdf<commit_after>
<!-- doing it like this makes it amenable to using sparql instead -->

<!-- should change the encoding to charset=ISO-8859-1  -->
<!-- should hard code rather than pass literals as parameter -->

<!-- an element  dc publisher thats getting repeated twice probably because of the rp person outside join -->

<!-- perhaps swap the ordering to read more cleanly - same as sparql 
  eg. 

    'select object from _rdf where subject = $1 and predicate = $$dc:title$$ ',
  s p o
-->

<?xml version="1.0" encoding="windows-1252"?>
<rdf:RDF 
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
xmlns:skos="http://www.w3.org/2004/02/skos/core#" 
xmlns:dc="http://purl.org/dc/elements/1.1/" 
xmlns:dcterms="http://purl.org/dc/terms/" 
xmlns:foaf="http://xmlns.com/foaf/0.1/">


-- I think we need further constraints ...
-- to restrict things to the parameter scheme .  how do we code this extra xml ? 
   
-- I think we just need to refine the outer query a little more ...
 

<% @conceptScheme = 'http://vocab.aodn.org.au/def/ClassScheme/parameter1' %>

<skos:ConceptScheme rdf:about="<%= @conceptScheme %>">

	<% for @object in query_objects2( 'dc:title',  @conceptScheme ) %>
    <dc:title><%= @object %></dc:title>
  <% end%>

	<% for @object in query_objects2( 'dc:description',  @conceptScheme ) %>
    <dc:description><%= @object %></dc:description>
  <% end %>

	<% for @object in query_objects2( 'dc:creator',  @conceptScheme ) %>
    <dc:creator>
      <foaf:Organisation>
        <foaf:name><%= @object %></foaf:name>
      <foaf:/Organisation>
    </dc:creator>
  <% end %>

  -- TODO element is repeated twice
  
	<% for @object in query_objects2( 'dc:publisher',  @conceptScheme ) %>
    <dc:publisher>
      <foaf:Organisation>
        <foaf:name><%= @object %></foaf:name>
      <foaf:/Organisation>
    </dc:publisher>
  <% end %>

  <dc:rights>Freely Available For Reuse</dc:rights>

	<% for @object in query_objects2( 'dcterms:issued',  @conceptScheme ) %>
  <dcterms:issued><%= @object %></dcterms:issued>
  <% end %>

</skos:ConceptScheme>




<% for @topConcept in query_subjects2( 'rdf:type', 'skos:TopConcept') %>
<skos:TopConcept rdf:about="<%= @topConcept %>">

    <% for @object in query_objects( 'skos:prefLabel', @topConcept ) %>
    <skos:prefLabel><%= @object %></skos:prefLabel>
    <% end %>

    <% for @object in query_objects( 'skos:definition', @topConcept ) %>
    <skos:definition><%= @object %></skos:definition>
    <% end %>

    <% for @object in query_objects( 'dcterms:issued', @topConcept ) %>
    <dcterms:issued><%= @object %></dcterms:issued>
    <% end %>

    <% for @object in query_objects( 'skos:inScheme', @topConcept ) %>
    <skos:inScheme><%= @object %></skos:inScheme>
    <% end %>

    <% for @object in query_objects( 'skos:narrower', @topConcept ) %>
    <skos:narrower><%= @object %></skos:narrower>
    <% end %>

</skos:TopConcept>
<% end %>


<% for @concept in query_subjects2( 'rdf:type', 'skos:Concept') %>
<skos:Concept rdf:about="<%= @concept %>">

    <% for @object in query_objects2( 'skos:inScheme', @concept) %>
    <skos:inScheme><%= @object %></skos:inScheme>
    <% end %>

    <% for @object in query_objects2( 'skos:broader', @concept) %>
    <skos:broader><%= @object %></skos:broader>
    <% end %>

    <% for @object in query_objects2( 'skos:prefLabel', @concept) %>
    <skos:prefLabel><%= @object %></skos:prefLabel>
    <% end %>

{'fraction_non_alphanumeric': 0.19123055162659122, 'fraction_numerical': 0.011456859971711458, 'mean_word_length': 3.6397637795275593, 'pattern_counts': {'":': 0, '<': 191, '<?xml version=': 2, '>': 191, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 16}, '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': '6660252', 'n_tokens_mistral': 2809, 'n_tokens_neox': 2510, 'n_words': 598}