forked from conceptsinmotion/thea
-
Notifications
You must be signed in to change notification settings - Fork 0
/
owl2_export_rdf.plt
50 lines (40 loc) · 2.05 KB
/
owl2_export_rdf.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
/* -*- Mode: Prolog -*- */
:- use_module(owl2_io).
:- use_module(owl2_model).
:- use_module(owl2_export_rdf).
:- begin_tests(wine_trip,[setup(roundtrip('testfiles/wine.owl'))]).
roundtrip(F):-
debug(test,'loading ~w',[F]),
load_axioms(F),
atom_concat(F,'.tmp',TempF),
save_axioms(TempF,owl),
retract_all_axioms,
load_axioms(TempF,owl).
test(loaded) :-
\+ \+ ontology(_).
test(subclasses) :-
findall(A-B,subClassOf(A,B),Axs),
%maplist(writeln,Axs),
Axs\=[].
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(objectProperty('http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#locatedIn')).
expected(subClassOf('http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Wine', 'http://www.w3.org/TR/2003/PR-owl-guide-20031209/food#PotableLiquid')).
expected(subClassOf(intersectionOf(['http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Loire',
hasValue('http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#locatedIn',
'http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#ToursRegion')]),
hasValue('http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#madeFromGrape',
'http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#CheninBlancGrape'))).
expected(ontologyAxiom('http://www.w3.org/TR/2003/CR-owl-guide-20030818/wine',
propertyAssertion('http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#hasBody',
'http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#SelaksIceWine',
'http://www.w3.org/TR/2003/PR-owl-guide-20031209/wine#Medium'))).
:- end_tests(wine_trip).