-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathowl2_model.plt
59 lines (43 loc) · 1.4 KB
/
owl2_model.plt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* -*- Mode: Prolog -*- */
:- use_module(owl2_model).
:- begin_tests(owl2_model,[setup(init_axioms),cleanup(retract_all_axioms)]).
init_axioms :-
Axioms=[
ontology(animals),
class(organism),
class(animal),
class(carnivore),
class(herbivore),
objectProperty(eats),
subClassOf(animal,organism),
equivalentClasses([carnivore,intersectionOf([animal,someValuesFrom(eats,animal)])]),
equivalentClasses([herbivore,
intersectionOf([animal,
allValuesFrom(eats,complementOf(animal))])]),
equivalentClasses([auto_carnivore,hasSelf(eats)]),
disjointClasses([herbivore,carnivore])
],
retract_all_axioms,
maplist(assert_axiom,Axioms).
test(loaded) :-
\+ \+ ontology(_).
test(subclasses) :-
findall(A-B,subClassOf(A,B),Axs),
Axs\=[].
test(objectProperty, all(OP == [eats])) :-
objectProperty(OP).
test(class, all(C == [organism,animal,carnivore,herbivore])) :-
class(C).
:- end_tests(owl2_model).
/** <module> tests for OWL2 model
---+ Synopsis
Command line:
==
swipl
?- [owl2_model].
?- load_test_files([]).
?- run_tests.
==
---+ Details
This is a test module for the module owl2_model
*/