<commit_before>/**
 * Created by Spadon on 19/08/2015.
 */

var should = require('should');
var fs = require('fs');
var path = require('path');
var mime = require('mime-types');

var Logics = require('../hylar/core/Logics/Logics');
var OWL2RL = require('../hylar/core/OWL2RL');

var H = require('../hylar/hylar');
var owl, ontology, Hylar = new H();

var reasoningMethod = process.env.rm;
var triples = fs.readFileSync(path.resolve(__dirname + '/ontologies/University0_14.nt')).toString();
var baseOntoTxt = fs.readFileSync(path.resolve(__dirname + '/ontologies/univ-bench-base-onto.ttl')).toString();

var univ1 = baseOntoTxt + fs.readFileSync(path.resolve(__dirname + '/ontologies/University0_0.ttl')).toString();
var univ2 = baseOntoTxt + fs.readFileSync(path.resolve(__dirname + '/ontologies/University0_5.ttl')).toString();
var univ3 = baseOntoTxt + fs.readFileSync(path.resolve(__dirname + '/ontologies/University0_14.ttl')).toString();

//Hylar.setRules(OWL2RL.equality);
//Hylar.setRules(OWL2RL.equivalence);
//Hylar.setRules(OWL2RL.subsumption);
//Hylar.setRules(OWL2RL.transitivityInverse);

describe('CLASSIFICATION UNIV 1', function () {
    it('should parse and classify the ontology', function () {
        return Hylar.load(univ1, 'text/turtle', reasoningMethod)
    });
});

describe('INSERT UNIV 1', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'INSERT DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('DELETE UNIV 1', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'DELETE DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('REINSERT UNIV 1', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'INSERT DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('SELECT', function () {
    var queryText = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX ub: <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#> SELECT ?X ?Y ?Z WHERE {?X rdf:type ub:GraduateStudent . ?Y rdf:type ub:University . ?Z rdf:type ub:Department . ?X ub:memberOf ?Z . ?Z ub:subOrganizationOf ?Y . ?X ub:undergraduateDegreeFrom ?Y}';
    it('insert data and derivations', function () {
        return Hylar.query(queryText);
    });
});

// ------------------------------------------------------------------------

describe('CLASSIFICATION UNIV 2', function () {
    it('should parse and classify the ontology', function () {
        return Hylar.load(univ2, 'text/turtle', reasoningMethod)
    });
});


describe('INSERT UNIV 2', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'INSERT DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('DELETE UNIV 2', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'DELETE DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('REINSERT UNIV 2', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'INSERT DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('SELECT', function () {
    var queryText = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX ub: <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#> SELECT ?X ?Y ?Z WHERE {?X rdf:type ub:GraduateStudent . ?Y rdf:type ub:University . ?Z rdf:type ub:Department . ?X ub:memberOf ?Z . ?Z ub:subOrganizationOf ?Y . ?X ub:undergraduateDegreeFrom ?Y}';
    it('insert data and derivations', function () {
        return Hylar.query(queryText);
    });
});

// ------------------------------------------------------------------------

describe('CLASSIFICATION UNIV 3', function () {
    it('should parse and classify the ontology', function () {
        return Hylar.load(univ3, 'text/turtle', reasoningMethod)
    });
});


describe('INSERT UNIV 3', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'INSERT DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('DELETE UNIV 3', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'DELETE DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('REINSERT UNIV 3', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'INSERT DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('SELECT', function () {
    var queryText = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX ub: <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#> SELECT ?X ?Y ?Z WHERE {?X rdf:type ub:GraduateStudent . ?Y rdf:type ub:University . ?Z rdf:type ub:Department . ?X ub:memberOf ?Z . ?Z ub:subOrganizationOf ?Y . ?X ub:undergraduateDegreeFrom ?Y}';
    it('insert data and derivations', function () {
        return Hylar.query(queryText);
    });
});<commit_msg>Saving files before refreshing line endings<commit_after>/**
 * Created by Spadon on 19/08/2015.
 */

var should = require('should');
var fs = require('fs');
var path = require('path');
var mime = require('mime-types');

var Logics = require('../hylar/core/Logics/Logics');
var OWL2RL = require('../hylar/core/OWL2RL');

var H = require('../hylar/hylar');
var owl, ontology, Hylar = new H();

var reasoningMethod = process.env.rm;
var triples = fs.readFileSync(path.resolve(__dirname + '/ontologies/University0_14.nt')).toString();
var baseOntoTxt = fs.readFileSync(path.resolve(__dirname + '/ontologies/univ-bench-base-onto.ttl')).toString();

var univ1 = baseOntoTxt + fs.readFileSync(path.resolve(__dirname + '/ontologies/University0_0.ttl')).toString();
var univ2 = baseOntoTxt + fs.readFileSync(path.resolve(__dirname + '/ontologies/University0_5.ttl')).toString();
var univ3 = baseOntoTxt + fs.readFileSync(path.resolve(__dirname + '/ontologies/University0_14.ttl')).toString();

//Hylar.setRules(OWL2RL.equality);
//Hylar.setRules(OWL2RL.equivalence);
//Hylar.setRules(OWL2RL.subsumption);
//Hylar.setRules(OWL2RL.transitivityInverse);

describe('CLASSIFICATION UNIV 1', function () {
    it('should parse and classify the ontology', function () {
        return Hylar.load(univ1, 'text/turtle', reasoningMethod)
    });
});

describe('INSERT UNIV 1', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'INSERT DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('DELETE UNIV 1', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'DELETE DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('REINSERT UNIV 1', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'INSERT DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('SELECT', function () {
    var queryText = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX ub: <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#> SELECT ?X ?Y ?Z WHERE {?X rdf:type ub:GraduateStudent . ?Y rdf:type ub:University . ?Z rdf:type ub:Department . ?X ub:memberOf ?Z . ?Z ub:subOrganizationOf ?Y . ?X ub:undergraduateDegreeFrom ?Y}';
    it('insert data and derivations', function () {
        return Hylar.query(queryText);
    });
});

// ------------------------------------------------------------------------

describe('CLASSIFICATION UNIV 2', function () {
    it('should parse and classify the ontology', function () {
        return Hylar.load(univ2, 'text/turtle', reasoningMethod)
    });
});

describe('INSERT UNIV 2', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'INSERT DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('DELETE UNIV 2', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'DELETE DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('REINSERT UNIV 2', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'INSERT DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('SELECT', function () {
    var queryText = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX ub: <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#> SELECT ?X ?Y ?Z WHERE {?X rdf:type ub:GraduateStudent . ?Y rdf:type ub:University . ?Z rdf:type ub:Department . ?X ub:memberOf ?Z . ?Z ub:subOrganizationOf ?Y . ?X ub:undergraduateDegreeFrom ?Y}';
    it('insert data and derivations', function () {
        return Hylar.query(queryText);
    });
});

// ------------------------------------------------------------------------

describe('CLASSIFICATION UNIV 3', function () {
    it('should parse and classify the ontology', function () {
        return Hylar.load(univ3, 'text/turtle', reasoningMethod)
    });
});


describe('INSERT UNIV 3', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'INSERT DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('DELETE UNIV 3', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'DELETE DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('REINSERT UNIV 3', function () {
    var query, results;
    it('insert data and derivations', function () {
        var queryText = 'INSERT DATA { ' + triples + ' }';
        return Hylar.query(queryText);
    });
});

describe('SELECT', function () {
    var queryText = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX ub: <http://www.lehigh.edu/~zhp2/2004/0401/univ-bench.owl#> SELECT ?X ?Y ?Z WHERE {?X rdf:type ub:GraduateStudent . ?Y rdf:type ub:University . ?Z rdf:type ub:Department . ?X ub:memberOf ?Z . ?Z ub:subOrganizationOf ?Y . ?X ub:undergraduateDegreeFrom ?Y}';
    it('insert data and derivations', function () {
        return Hylar.query(queryText);
    });
});
{'fraction_non_alphanumeric': 0.19031563173175986, 'fraction_numerical': 0.01798257937622928, 'mean_word_length': 3.1085032704886495, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 12, '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': '5489683', 'n_tokens_mistral': 3662, 'n_tokens_neox': 3448, 'n_words': 803}