<commit_before>:- module(
  rdf_file,
  [
    is_rdf_file/1, % +File:atom
    rdf_file_correct_extension/2, % +FromFile:atom
                                  % -ToFile:atom
    rdf_directory_files/2, % +Directory:atom
                           % -Files:list(atom)
    rdf_merge_directory/4 % +Options:list(nvpair)
                          % +FromDirectory:atom
                          % +ToFile:atom
                          % +SaveOptions:list(nvpair)
  ]
).

/** <module> RDF file

Support for RDF files and file types.

@author <NAME>
@version 2012/01, 2012/03, 2012/09, 2012/11, 2013/01-2013/06,
         2013/08-2013/09, 2013/11, 2014/01-2014/04
*/

:- use_module(library(apply)).
:- use_module(library(lists)).
:- use_module(library(semweb/rdf_db)).

:- use_module(os(dir_ext)).
:- use_module(os(file_ext)).
:- use_module(os(file_mime)).
:- use_module(rdf_file(rdf_file_db)).
:- use_module(plRdf(rdf_meta)).



%! is_rdf_file(+File:atom) is semidet.
% Succeeds if the given file contains an RDF serialization.

is_rdf_file(File):-
  file_mime(File, MIME),
  rdf_mime(MIME), !.
is_rdf_file(File):-
  file_name_extension(_, Ext, File),
  rdf_extension(Ext, _).


%! rdf_directory_files(+Directory:atom, -RdfFiles:list(atom)) is det.
%! rdf_directory_files(
%!   +Options:list(nvpair),
%!   +Directory:atom,
%!   -RdfFiles:list(atom)
%! ) is det.
% Returns RDF files from the given directory.
% This is based on parsing (the top of) the contents of these files.<commit_msg>* [FIX] Module import.<commit_after>:- module(
  rdf_file,
  [
    is_rdf_file/1, % +File:atom
    rdf_file_correct_extension/2, % +FromFile:atom
                                  % -ToFile:atom
    rdf_directory_files/2, % +Directory:atom
                           % -Files:list(atom)
    rdf_merge_directory/4 % +Options:list(nvpair)
                          % +FromDirectory:atom
                          % +ToFile:atom
                          % +SaveOptions:list(nvpair)
  ]
).

/** <module> RDF file

Support for RDF files and file types.

@author <NAME>
@version 2012/01, 2012/03, 2012/09, 2012/11, 2013/01-2013/06,
         2013/08-2013/09, 2013/11, 2014/01-2014/04
*/

:- use_module(library(apply)).
:- use_module(library(lists)).
:- use_module(library(semweb/rdf_db)).

:- use_module(os(dir_ext)).
:- use_module(os(file_ext)).
:- use_module(os(file_mime)).

:- use_module(plRdf(rdf_meta)).
:- use_module(plRdf_serial(rdf_file_db)).



%! is_rdf_file(+File:atom) is semidet.
% Succeeds if the given file contains an RDF serialization.

is_rdf_file(File):-
  file_mime(File, MIME),
  rdf_mime(MIME), !.
is_rdf_file(File):-
  file_name_extension(_, Ext, File),
  rdf_extension(Ext, _).


%! rdf_directory_files(+Directory:atom, -RdfFiles:list(atom)) is det.
%! rdf_directory_files(
%!   +Options:list(nvpair),
%!   +Directory:atom,
%!   -RdfFiles:list(atom)
%! ) is det.
% Returns RDF files from the given directory.
% This is based on parsing (the top of) the contents of these files.
{'fraction_non_alphanumeric': 0.14842175957018133, 'fraction_numerical': 0.04701141705842848, 'mean_word_length': 2.899214659685864, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6507558', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1096, 'n_words': 194}