-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathowl2_xml.plt
84 lines (60 loc) · 2.79 KB
/
owl2_xml.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* -*- Mode: Prolog -*- */
:- use_module(owl2_model).
:- use_module(owl2_xml).
:- use_module(owl2_io).
:- begin_tests(rna,[setup(load_owlxfile)]).
load_owlxfile :-
load_axioms('testfiles/rnao.owlx',owlx).
test(loaded) :-
\+ \+ ontology(_).
%test(showall) :-
% forall(axiom(A),
% format('~q.~n',[A])).
test(expected) :-
findall(Ax,
( expected(Ax),
debug(test,'Testing for: ~w',[Ax]),
\+ Ax,
debug(test,'** FAILED: ~w',[Ax])),
FailedAxs),
length(FailedAxs,NumFailed),
debug(test,'*** TOTAL FAILED: ~d',[NumFailed]),
FailedAxs=[].
expected(subPropertyOf('http://purl.obofoundry.org/pairs_with_CHH', 'http://purl.obofoundry.org/pairs_with_HH')).
expected(equivalentClasses(['http://purl.obofoundry.org/RNAO_0000003',
objectIntersectionOf(objectComplementOf(objectSomeValuesFrom('http://purl.obofoundry.org/has_part',
objectIntersectionOf('http://purl.obofoundry.org/RNAO_0000028',
objectSomeValuesFrom('http://purl.obofoundry.org/pairs_with_CWW',
'http://purl.obofoundry.org/RNAO_0000028')))),
objectSomeValuesFrom('http://purl.obofoundry.org/has_part',
objectIntersectionOf('http://purl.obofoundry.org/RNAO_0000017',
objectSomeValuesFrom('http://purl.obofoundry.org/pairs_with_CWW',
'http://purl.obofoundry.org/RNAO_0000017'))),
objectExactCardinality('2', 'http://purl.obofoundry.org/has_part', 'http://purl.obofoundry.org/RNAO_0000019'))])).
:- end_tests(rna).
:- begin_tests(write,[setup(roundtrip)]).
roundtrip :-
retract_all_axioms,
load_axioms('testfiles/wine.owl'),
save_axioms('testfiles/wine.owlx',owlx),
retract_all_axioms,
load_axioms('testfiles/wine.owlx',owlx).
test(loaded) :-
\+ \+ ontology(_).
:- end_tests(write).
/** <module> tests for OWL2-XML parser
---+ Synopsis
Command line:
==
swipl
?- [owl2_xml].
?- load_test_files([]).
?- run_tests.
==
Or run from makefile
==
make test-owl2_xml
==
---+ Details
This is a test module for the module owl2_xml.pl
*/