<commit_before>//////// Module Definition ////////////
define([
'util/util.module',
'util/wikidataapi.service',
'util/util.service',
'util/sparql.service',
'i18n/i18n.service',
'util/ruleParser.service'
], function() {
///////////////////////////////////////

angular.module('util').factory('rulesProvider', [
    'wikidataapi', 'util', 'i18n', 'sparql', '$q', '$http', 'ruleParser',
    function(wikidataapi, util, i18n, sparql, $q, $http, ruleParser) {

        var rules = [
            '(?x.P1696 = ?y)@?S -> (?y.P1696 = ?x)@F(?S)',
            '(?x.P1696 = ?y)@?S -> (?y.P1696 = ?x)@?S', // x inverseOf y -> y inverseOf x
            '(?x.P361 = ?y)@?S -> (?y.P527 = ?x)@?S', // x partOf y -> y hasPart x
            '?S:(?att = ?start), (?x.P26 = ?y)@?S -> (?y.P26 = ?x)@{?att = ?start}', // x spouse y [att:start] -> y spouse x[att:start]
            '(?x.P26 = ?y)@(P580 = ?start), (?x.P26 = ?y)@?S -> (?y.P26 = ?x)@?S',
            '?S:(P580 = ?start), (?x.P26 = ?y)@?S -> (?y.P26 = ?x)@?S', // start = ?start in ?S, ?x spouse ?y: ?S -> ?y spouse ?x: ?S
            '?S:[P580 = ?start], (?x.P26 = ?y)@?S -> (?y.P26 = ?x)@?S', // ?S = [start = ?start], ?x spouse ?y: ?S -> ?y spouse ?x: ?S
            '?S:(), (?x.P26 = ?y)@?S -> (?y.P26 = ?x)@?S', // ?S = [...], ?x spouse ?y: ?S -> ?y spouse ?x: ?S
            '(?gf.P21 = Q5481097)@?X, (?gf.P40 = ?f)@?Y, (?f.P40 = ?s)@?Z -> (?s.P1038 = ?gf)@[P1039 = Q9238344]'
        ];

//TODO add rule with >1 qualifiers per pvalue
// var JSONRules = [
// /**
//  * TEST: FUNCTION
//  *
//  *  ?x spouse ?y: ?S, ?x hasRelative ?gf: ?T -> ?y spouse ?x:
//  *<commit_msg>Fix typo in example rule<commit_after>//////// Module Definition ////////////
define([
'util/util.module',
'util/wikidataapi.service',
'util/util.service',
'util/sparql.service',
'i18n/i18n.service',
'util/ruleParser.service'
], function() {
///////////////////////////////////////

angular.module('util').factory('rulesProvider', [
    'wikidataapi', 'util', 'i18n', 'sparql', '$q', '$http', 'ruleParser',
    function(wikidataapi, util, i18n, sparql, $q, $http, ruleParser) {

        var rules = [
            '(?x.P1696 = ?y)@?S -> (?y.P1696 = ?x)@F(?S)',
            '(?x.P1696 = ?y)@?S -> (?y.P1696 = ?x)@?S', // x inverseOf y -> y inverseOf x
            '(?x.P361 = ?y)@?S -> (?y.P527 = ?x)@?S', // x partOf y -> y hasPart x
            '?S:(?att = ?start), (?x.P26 = ?y)@?S -> (?y.P26 = ?x)@{?att = ?start}', // x spouse y [att:start] -> y spouse x[att:start]
            '(?x.P26 = ?y)@(P580 = ?start), (?x.P26 = ?y)@?S -> (?y.P26 = ?x)@?S',
            '?S:(P580 = ?start), (?x.P26 = ?y)@?S -> (?y.P26 = ?x)@?S', // start = ?start in ?S, ?x spouse ?y: ?S -> ?y spouse ?x: ?S
            '?S:[P580 = ?start], (?x.P26 = ?y)@?S -> (?y.P26 = ?x)@?S', // ?S = [start = ?start], ?x spouse ?y: ?S -> ?y spouse ?x: ?S
            '?S:(), (?x.P26 = ?y)@?S -> (?y.P26 = ?x)@?S', // ?S = [...], ?x spouse ?y: ?S -> ?y spouse ?x: ?S
            '(?gf.P21 = Q6581097)@?X, (?gf.P40 = ?f)@?Y, (?f.P40 = ?s)@?Z -> (?s.P1038 = ?gf)@[P1039 = Q9238344]'
        ];

//TODO add rule with >1 qualifiers per pvalue
// var JSONRules = [
// /**
//  * TEST: FUNCTION
//  *
//  *  ?x spouse ?y: ?S, ?x hasRelative ?gf: ?T -> ?y spouse ?x:
//  *
{'fraction_non_alphanumeric': 0.314752078842008, 'fraction_numerical': 0.055435786880197103, 'mean_word_length': 2.174975562072336, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '1197535', 'n_tokens_mistral': 1566, 'n_tokens_neox': 1433, 'n_words': 312}