<commit_before>module DbdOnto
  class Provenance < Base

    PROV_ATTRIBUTES = %w(context encryption source license)
    DCTERMS_ATTRIBUTES = %w(creator created)

    def initialize
      super
      self << meta_provenance
      self << prov_resources
      self << dcterms_resources
    end

  private

    def prov_resources
      PROV_ATTRIBUTES.map do |attribute|
        resource = resource_with_meta_provenance
        resource << fact_defines_predicate_prov(attribute)
        resource << fact_label(attribute)
      end
    end

    # NOTE using dcterms:creator is not exact for now as the range
    #      should be a dcterms:Agent and it is a Literal here.
    def dcterms_resources
      DCTERMS_ATTRIBUTES.map do |attribute|<commit_msg>Add NOTE about W3C Provenance WG (PROV 2013-04-30)<commit_after>module DbdOnto
  class Provenance < Base

    # NOTE This complete implementation probably needs to be
    #      adapted to use the recent W3C Provenance work:
    #      http://www.w3.org/TR/2013/NOTE-prov-overview-20130430/
    PROV_ATTRIBUTES = %w(context encryption source license)
    DCTERMS_ATTRIBUTES = %w(creator created)

    def initialize
      super
      self << meta_provenance
      self << prov_resources
      self << dcterms_resources
    end

  private

    def prov_resources
      PROV_ATTRIBUTES.map do |attribute|
        resource = resource_with_meta_provenance
        resource << fact_defines_predicate_prov(attribute)
        resource << fact_label(attribute)
      end
    end

    # NOTE using dcterms:creator is not exact for now as the range
    #      should be a dcterms:Agent and it is a Literal here.
    def dcterms_resources
      DCTERMS_ATTRIBUTES.map do |attribute|
{'fraction_non_alphanumeric': 0.05581395348837209, 'fraction_numerical': 0.013372093023255814, 'mean_word_length': 2.850111856823266, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6058443', 'n_tokens_mistral': 555, 'n_tokens_neox': 525, 'n_words': 149}