<commit_before>:- module(
  owl_build,
  [
    owl_assert_class_equivalence/3, % +Class1:class
                                    % +Class2:class
                                    % +Graph:atom
    owl_assert_disjointWith/3, % +Class1:iri
                               % +Class2:iri
                               % +Graph:atom
    owl_assert_resource_identity/3, % +Resource1:class
                                    % +Resource2:class
                                    % +Graph:atom
    owl_retractall_class_equivalence/3, % +Class1:class
                                        % +Class2:class
                                        % +Graph:atom
    owl_retractall_resource_identity/3 % +Resource1:class
                                       % +Resource2:class
                                       % +Graph:atom
  ]
).

/** <module> OWL build

Predicates for building OWL ontologies.

@author <NAME>
@version 2012/12-2013/01, 2013/03, 2013/05, 2013/09
*/

:- use_module(library(semweb/rdf_db), except([rdf_node/1])).

:- rdf_meta(owl_assert_class_equivalence(r,r,+)).
:- rdf_meta(owl_assert_disjointWith(r,r,+)).
:- rdf_meta(owl_assert_resource_identity(r,r,+)).
:- rdf_meta(owl_retractall_class_equivalence(r,r,+)).
:- rdf_meta(owl_retractall_resource_identity(r,r,+)).



%! owl_assert_class_equivalence(+Class1:iri, +Class2:iri, +Graph:atom) is det.

owl_assert_class_equivalence(C1, C2, G):-
  rdf_assert(C1, owl:equivalentClass, C2, G).

owl_assert_disjointWith(C1, C2, G):-
  rdf_assert(C1, owl:disjointWith, C2, G).

%! owl_assert_resource_identity(
%!   +Resource1:iri,
%!   +Resource2:iri,
%!   +Graph:atom
%! ) is det.

owl_assert_resource_identity(Resource1, Resource2, Graph):-
  rdf_assert(Resource1, owl:sameAs, Resource2, Graph).

%! owl_retractall_class_equivalence(
%!   +Class1:iri,
%!   +Class2:iri,
%!   +Graph:atom
%! ) is det.

owl_retractall_class_equivalence(Class1, Class2, Graph):-
  rdf_retractall(Class1, owl:equivalentClass, Class2, Graph).

%! owl_retractall_resource_identity(
%!   +Resource1:iri,
%!   +Resource2:iri,
%!   +Graph:atom
%! ) is det.

owl_retractall_resource_identity(Resource1, Resource2, Graph):-<commit_msg>ADDED: Assert disjointness between an arbitrary number of classes.<commit_after>:- module(
  owl_build,
  [
    owl_assert_class_equivalence/3, % +Class1:class
                                    % +Class2:class
                                    % +Graph:atom
    owl_assert_disjointWith/2, % +Classes:list(iri)
                               % +Graph:atom
    owl_assert_disjointWith/3, % +Class1:iri
                               % +Class2:iri
                               % +Graph:atom
    owl_assert_resource_identity/3, % +Resource1:class
                                    % +Resource2:class
                                    % +Graph:atom
    owl_retractall_class_equivalence/3, % +Class1:class
                                        % +Class2:class
                                        % +Graph:atom
    owl_retractall_resource_identity/3 % +Resource1:class
                                       % +Resource2:class
                                       % +Graph:atom
  ]
).

/** <module> OWL build

Predicates for building OWL ontologies.

@author <NAME>
@version 2012/12-2013/01, 2013/03, 2013/05, 2013/09, 2014/12
*/

:- use_module(library(apply)).
:- use_module(library(semweb/rdf_db), except([rdf_node/1])).

:- use_module(generics(lambda_meta)).

:- rdf_meta(owl_assert_class_equivalence(r,r,+)).
:- rdf_meta(owl_assert_disjointWith(t,+)).
:- rdf_meta(owl_assert_disjointWith(r,r,+)).
:- rdf_meta(owl_assert_resource_identity(r,r,+)).
:- rdf_meta(owl_retractall_class_equivalence(r,r,+)).
:- rdf_meta(owl_retractall_resource_identity(r,r,+)).





%! owl_assert_class_equivalence(+Class1:iri, +Class2:iri, +Graph:atom) is det.

owl_assert_class_equivalence(C1, C2, G):-
  rdf_assert(C1, owl:equivalentClass, C2, G).



%! owl_assert_disjointWith(+Classes:list(iri), +Graph:atom) is det.

owl_assert_disjointWith([], _).
owl_assert_disjointWith([H|T], G):-
  maplist(\C^owl_assert_disjointWith(H, C, G), T),
  owl_assert_disjointWith(T, G).



%! owl_assert_disjointWith(+Class1:iri, +Class2:iri, +Graph:atom) is det.

owl_assert_disjointWith(C1, C2, G):-
  rdf_assert(C1, owl:disjointWith, C2, G).



%! owl_assert_resource_identity(
%!   +Resource1:iri,
%!   +Resource2:iri,
%!   +Graph:atom
%! ) is det.

owl_assert_resource_identity(Resource1, Resource2, Graph):-
  rdf_assert(Resource1, owl:sameAs, Resource2, Graph).



%! owl_retractall_class_equivalence(
%!   +Class1:iri,
%!   +Class2:iri,
%!   +Graph:atom
%! ) is det.

owl_retractall_class_equivalence(Class1, Class2, Graph):-
  rdf_retractall(Class1, owl:equivalentClass, Class2, Graph).



%! owl_retractall_resource_identity(
%!   +Resource1:iri,
%!   +Resource2:iri,
%!   +Graph:atom
%! ) is det.

owl_retractall_resource_identity(Resource1, Resource2, Graph):-
{'fraction_non_alphanumeric': 0.13365833841153768, 'fraction_numerical': 0.031078610603290677, 'mean_word_length': 2.6528189910979227, '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': 29, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6295970', 'n_tokens_mistral': 1878, 'n_tokens_neox': 1722, 'n_words': 230}