forked from vangelisv/thea
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathowl2_xml.pl
517 lines (420 loc) · 17.7 KB
/
owl2_xml.pl
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
/* -*- Mode: Prolog -*- */
:- module(owl2_xml,
[
owl_parse_xml/1,
owl_parse_xml/2,
axiom_xml/3,
xml_axiom/3,
desc_xml/3,
axioms_elts/3,
xml_desc/3
]).
:- use_module(owl2_model).
:- use_module(owl2_xml).
:- use_module(owl2_metamodel).
:- use_module(owl2_io).
:- use_module(library(sgml)).
:- use_module(library(semweb/rdf_db)).
% DEPENDENCY: SWI-Prolog or Yap
%:- use_module(library('semweb/rdf_db')).
% ----------------------------------------
% TRANSLATING FROM XML
% ----------------------------------------
:- multifile owl2_io:load_axioms_hook/3.
owl2_io:load_axioms_hook(File,owlx,Opts) :-
owl_parse_xml(File,Opts).
owl_parse_xml(File) :-
owl_parse_xml(File,[]).
owl_parse_xml(File,_Opts) :-
load_structure(File,[XML],[dialect(xmlns),space(remove)]),
xml_ontology(XML,Ont,Axioms),
assert_axiom(Ont),
forall(member(Axiom,Axioms),
assert_axiom(Axiom)),
!.
owl_parse_xml(File,_) :-
throw(no_parse(File)).
xsb_owl_parse_xml(File,_Opts) :-
load_structure(file(File),[XML],[dialect(xmlns),space(remove)]),
xml_ontology(XML,Ont,Axioms),
assert_axiom(Ont),
forall(member(Axiom,Axioms),
assert_axiom(Axiom)),
!.
%% xml_ontology(+XML, ?Ont, ?Axioms:list) is det
% Translate XML term conforming to OWLX to a collecton of owl2_model axioms
xml_ontology(element(_:'Ontology',Atts,Elts),ontology(O),Axioms) :-
%atts_iri(Atts,O),
member('ontologyIRI'=O,Atts),
% TODO: imports
elts_axioms(O,Elts,Axioms).
%% elts_axioms(+O, +Elts:list, ?Axioms:list) is det
% recursively translate a list of XML elements to OWL axioms,
% use xml_axiom/3 to map an axiom XML term to an owl2_model axiom
elts_axioms(_,[],[]).
elts_axioms(O,[E|Elts],Axioms2):-
xml_axiom(O,E,A),
!,
elts_axioms(O,Elts,Axioms),
( is_list(A)
-> append(A,Axioms,Axioms2)
; Axioms2=[A|Axioms]).
elts_axioms(O,[E|_],_) :-
throw(error(cannot_translate_axiom(E,O))).
%% xml_axiom(+O,+XML,?Axiom)
% translate a single element to an axiom
% ANNOTATIONS: TODO: this is P4 style
xml_axiom(Ont,element(_:'EntityAnnotation',_Atts,[Decl|Elts]),[EntityAxiom|Annots]) :-
!,
xml_axiom(Ont,Decl,EntityAxiom),
EntityAxiom=..[_,E],
findall(annotationAssertion(E,P,V),
( member(AX,Elts),
xml_annotation(AX,annotation(P,V))),
Annots).
% TODO: clarify. P4 exports declarations directly
xml_axiom(Ont,element(_:'Declaration',_,[Decl]),Axiom) :-
!,
xml_axiom(Ont,Decl,Axiom).
% translate an entity axiom (OWLClass, OWLIndividual, etc)
xml_axiom(_Ont,element(_:Name,Atts,_),Axiom) :-
xmle_entity(Name,Axiom,[IRI]),
!,
atts_iri(Atts,IRI).
% translate a full axiom (SubClassOf etc), translating each
% argument to descriptions
xml_axiom(_Ont,element(_:Name,_Atts,Sub),Axiom) :-
xmle_axiom(Name,Axiom,Args),
!,
maplist(axiom_xml_arg(Name),Sub,Args).
xml_axiom(Ont,Elt,_) :-
throw(xml_axiom(Ont,Elt)).
% if axiom argument is a class expression then call the
% desc_xml
% VV 18/12/2009 for OWLlink individual support
axiom_xml_arg(ParentAxiom,Element,c(Arg)) :-
desc_xml(ParentAxiom,Arg,Element),!.
% everything else return the argument itself eg. property, individual
%
axiom_xml_arg(_ParentAxiom,element(OWL_NS:'NamedIndividual',Atts,[]),i(IRI)) :-
iri_att(IRIAtt),member(IRIAtt=IRI,Atts),owl_ns(OWL_NS),!.
axiom_xml_arg(_ParentAxiom,element('http://www.w3.org/2006/12/owl2-xml#':'ObjectProperty',Atts,[]),op(IRI)) :-
iri_att(IRIAtt),member(IRIAtt=IRI,Atts),!.
axiom_xml_arg(_ParentAxiom,element('http://www.w3.org/2006/12/owl2-xml#':'DataProperty',Atts,[]),dp(IRI)) :-
iri_att(IRIAtt),member(IRIAtt=IRI,Atts),!.
axiom_xml_arg(_ParentAxiom,element('http://www.w3.org/2006/12/owl2-xml#':'AnnotationProperty',Atts,[]),ap(IRI)) :-
iri_att(IRIAtt),member(IRIAtt=IRI,Atts),!.
axiom_xml_arg(_ParentAxiom,X,X) :- !.
%% xml_desc(+ParentElementName, +XML, ?Description)
% translate an OWL XML term to an owl2_model description
% eg someValuesFrom(PE,X)
xml_desc(_Parent,element(_:Name,_Atts,[PEX|Elts]),Desc) :-
xmle_PEdescription(Name,Pred),
!,
%xml_propertyExpr(Name,PEX,PE),
xml_desc(Name,PEX,PE),
maplist(xml_desc(Name),Elts,Fillers),
Desc=..[Pred,PE|Fillers].
% eg minCardinality(Card,PE,X)
xml_desc(_Parent,element(_:Name,Atts,[PEX|FillersX]),Desc) :-
xmle_functor(Name,F),
!,
member(cardinality=Card,Atts),
%xml_propertyExpr(Name,PEX,PE),
xml_desc(Name,PEX,PE),
maplist(xml_desc(Name),FillersX,Fillers),
Desc=..[F,Card,PE|Fillers].
% eg intersectionOf(L)
xml_desc(_Parent,element(_:Name,_Atts,Elts),Desc) :-
xmle_functor(Name,Pred),
!,
maplist(xml_desc(Name),Elts,Fillers),
Desc=..[Pred,Fillers].
% eg OWLClass
% TODO: counts as declaration?
xml_desc(_Parent,element(_:_Name,Atts,[]),IRI) :-
% TODO: _Name
iri_att(A),
member(A=IRI,Atts),
!.
%VV add 15/10 for OWLLink support
xml_desc(_Parent,element('owl:Class',Atts,[]),IRI) :-
% TODO: _Name
iri_att(A),
member(A=IRI,Atts),
!.
xml_desc(Parent,Elt,_) :-
throw(xml_desc(Elt,in(Parent))).
% TODO: this is P4 style
xml_annotation(element(_:'Annotation',Atts,Elts),annotation(P,V)) :-
!,
member(annotationURI=P,Atts),
Elts=[element(_:'Constant',_,[V])].
atts_iri(Atts,TIRI) :-
tiri_iri(TIRI, IRI),
iri_att(A),
member(A=IRI,Atts).
tiri_iri(i(IRI), IRI) :- !.
tiri_iri(c(IRI), IRI) :- !.
tiri_iri(op(IRI), IRI) :- !.
tiri_iri(dp(IRI), IRI) :- !.
tiri_iri(IRI, IRI) :- % JW: not entirely sure here. The original code
var(IRI). % is definitely wrong though.
iri_att('URI'). % TODO clarify. P4 uses this
iri_att('abbreviatedIRI'). % VV add 15/10 for OWLLink support
iri_att('IRI'). % VV add 15/10 for OWLLink support
% ----------------------------------------
% GENERATING XML
% ----------------------------------------
:- rdf_register_ns(owlx,'http://www.w3.org/2006/12/owl2-xml#').
owl_ns(OWL_NS) :- rdf_db:ns(owl,OWL_NS),!.
owl_ns(OWL_NS) :- rdf_db:ns(owlx,OWL_NS),!.
:- multifile owl2_io:save_axioms_hook/3.
owl2_io:save_axioms_hook(File,owlx,Opts) :-
owl_generate_xml(File,Opts).
owl_generate_xml(File) :-
owl_generate_xml(File,[]).
owl_generate_xml(File,_Opts) :-
findall(Axiom,axiom(Axiom),Axioms),
( select(ontology(Ont),Axioms,Axioms2)
-> true
; Ont='http://example.com',Axioms2=Axioms),
ontology_xml(Ont,Axioms2,XML),
debug(owl_exporter,'Writing to ~w',[XML]),
( nonvar(File)
-> open(File,write,IO,[dialect(xml)])
; open(pipe(cat),write,IO,[dialect(xml)])),
xml_write(IO,XML,[
% nsmap([owlx='http://www.w3.org/2006/12/owl2-xml#'])
]),
close(IO),
!.
owl_generate_xml(File,_) :-
throw(no_generate(File)).
ontology_xml(O,Axioms,element(OWL_NS:'Ontology',Atts,Elts)) :-
iri_att(IRIAtt),member(IRIAtt=O,Atts),owl_ns(OWL_NS),!,
debug(owl_exporter,'Writing ~w',[O]),
axioms_elts(O,Axioms,Elts).
axioms_elts(_,[],[]).
%% cjm 2010-06-24 - assume processed elsewhere
axioms_elts(O,[ontology(_)|Axioms],Elts):-
!,
axioms_elts(O,Axioms,Elts).
axioms_elts(O,[A|Axioms],[E|Elts]):-
axiom_xml(O,A,E),
!,
axioms_elts(O,Axioms,Elts).
axioms_elts(O,[A|_],_) :-
throw(error(axiom_elts(A,O))).
% translate entity axiom to XML
axiom_xml(_Ont,Axiom,XML) :-
% TODO: annotations
xmle_entity(_Name,Axiom,[Arg]),
axiom_arg_xml(Axiom,Arg,XML),!.
% translate full axiom to XML, translating description arguments also
axiom_xml(_Ont,Axiom,element(OWL_NS,[],Subs)) :-
xmle_axiom(Name,Axiom,Args),owl_ns(OWL_NS),
!,
debug(owl_exporter,'Axiom: ~w',[Axiom]),
maplist(axiom_arg_xml(Name),Args,Subs).
axiom_xml(_Ont,Axiom,_) :-
throw(error(xmle_axiom(Axiom))).
% if axiom argument is a class expression then call the
% desc_xml
% VV 18/12/2009 for OWLlink individual support
axiom_arg_xml(ParentAxiom,c(Arg),Element) :-
desc_xml(ParentAxiom,Arg,Element),!.
% everything else return the argument itself eg. property, individual
%
axiom_arg_xml(_ParentAxiom,c(IRI),element(OWL_NS:'Class',Atts,[])) :-
iri_att(IRIAtt),member(IRIAtt=IRI,Atts),owl_ns(OWL_NS),!.
axiom_arg_xml(_ParentAxiom,i(IRI),element(OWL_NS:'NamedIndividual',Atts,[])) :-
iri_att(IRIAtt),member(IRIAtt=IRI,Atts),owl_ns(OWL_NS),!.
axiom_arg_xml(_ParentAxiom,i(IRI),element(OWL_NS:'Individual',Atts,[])) :-
iri_att(IRIAtt),member(IRIAtt=IRI,Atts),owl_ns(OWL_NS),!.
axiom_arg_xml(_ParentAxiom,op(IRI),element(OWL_NS:'ObjectProperty',Atts,[])) :-
iri_att(IRIAtt),member(IRIAtt=IRI,Atts),owl_ns(OWL_NS),!.
axiom_arg_xml(_ParentAxiom,dp(IRI),element(OWL_NS:'DataProperty',Atts,[])) :-
iri_att(IRIAtt),member(IRIAtt=IRI,Atts),owl_ns(OWL_NS),!.
axiom_arg_xml(_ParentAxiom,ap(IRI),element(OWL_NS:'AnnotationProperty',Atts,[])) :-
iri_att(IRIAtt),member(IRIAtt=IRI,Atts),owl_ns(OWL_NS),!.
axiom_arg_xml(_ParentAxiom,X,X) :- !.
% property chains
desc_xml(_Parent,propertyChain(PL),element(OWL_NS:'ObjectPropertyChain',_,Elts)) :-
owl_ns(OWL_NS),!,
maplist(desc_xml('ObjectPropertyChain'),PL,Elts).
% TODO!!! this is just guessing
% see wine.owl, if we do not follow imports, cannot determine what PotableLiquid is,
% except by guesswork
desc_xml(_Parent,IRI,element(OWL_NS:'Class',Atts,[])) :-
iri_att(IRIAtt),member(IRIAtt=IRI,Atts),owl_ns(OWL_NS),
atom(IRI),
!.
% eg unionOf
desc_xml(_Parent,Desc,element(OWL_NS:Name,_Atts,Elts)) :-
% e.g. someValuesFrom(P,D)
owl_ns(OWL_NS),
Desc=..[Pred,Args],
is_list(Args),
owlpredicate_typed(Pred,TypedPred),
xmle_PEdescription(Name,TypedPred),
Test=..[TypedPred,Desc],
Test,
debug(owl_exporter,'Desc: ~w Typed: ~w',[Desc,TypedPred]),
!,
maplist(desc_xml(Name),Args,Elts).
% translate object property expressions, eg
desc_xml(_Parent,Desc,element(OWL_NS:Name,_Atts,Elts)) :-
% e.g. someValuesFrom(P,D)
owl_ns(OWL_NS),
Desc=..[Pred|Args],
owlpredicate_typed(Pred,TypedPred),
xmle_PEdescription(Name,TypedPred),
Test=..[TypedPred,Desc],
Test,
debug(owl_exporter,'Desc: ~w Typed: ~w',[Desc,TypedPred]),
!,
maplist(desc_xml(Name),Args,Elts).
% eg minCardinality(Card,PE,X)
desc_xml(_Parent,Desc,element(OWL_NS:Name,[cardinality=Card],Elts)) :-
% e.g. unionOf(L)
owl_ns(OWL_NS),
Desc=..[Pred,Card|Args],
owlpredicate_typed(Pred,TypedPred),
xmle_functor(Name,TypedPred),
Test=..[TypedPred,Desc],
Test,
!,
maplist(desc_xml(Name),Args,Elts).
% eg intersectionOf(L)
desc_xml(_Parent,Desc,element(OWL_NS:Name,[],Elts)) :-
owl_ns(OWL_NS),
Desc=..[Pred|Fillers],
xmle_functor(Name,Pred),
!,
debug(owl_exporter,'Desc: ~w',[Desc]),
maplist(desc_xml(Name),Fillers,Elts).
% eg OWLClass
% TODO: counts as declaration?
desc_xml(_Parent,IRI,element(OWL_NS:Name,Atts,[])) :-
owl_ns(OWL_NS),
iri_att(IRIAtt),member(IRIAtt=IRI,Atts),
atom(IRI),
xmle_entity(Name,Goal,[IRI]),
Goal,
!.
desc_xml(_Ont,Desc,_) :-
throw(description(Desc)).
% ----------------------------------------
% METAMODEL
% ----------------------------------------
% TODO: use owl2_metamodel
xmle_cardpred('ObjectMinCardinality',minCardinality).
xmle_cardpred('ObjectMaxCardinality',maxCardinality).
xmle_cardpred('ObjectExactCardinality',exactCardinality).
xmle_cardpred('DataMinCardinality',minCardinality).
xmle_cardpred('DataMaxCardinality',maxCardinality).
xmle_cardpred('DataExactCardinality',exactCardinality).
xmle_PEdescription('ObjectIntersectionOf',objectIntersectionOf).
xmle_PEdescription('ObjectUnionOf',objectUnionOf).
xmle_PEdescription('ObjectComplementOf',objectComplementOf).
xmle_PEdescription('ObjectOneOf',objectOneOf).
xmle_PEdescription('ObjectSomeValuesFrom',objectSomeValuesFrom).
xmle_PEdescription('ObjectAllValuesFrom',objectAllValuesFrom).
xmle_PEdescription('ObjectHasValue',objectHasValue).
xmle_PEdescription('ObjectHasSelf',objectHasSelf).
xmle_PEdescription('DataIntersectionOf',dataIntersectionOf).
xmle_PEdescription('DataUnionOf',dataUnionOf).
xmle_PEdescription('DataComplementOf',dataComplementOf).
xmle_PEdescription('DataOneOf',dataOneOf).
xmle_PEdescription('DataSomeValuesFrom',dataSomeValuesFrom).
xmle_PEdescription('DataAllValuesFrom',dataAllValuesFrom).
xmle_PEdescription('DataHasValue',dataHasValue).
xmle_functor('ObjectMinCardinality',objectMinCardinality).
xmle_functor('ObjectMaxCardinality',objectMaxCardinality).
xmle_functor('ObjectExactCardinality',objectExactCardinality).
xmle_functor('DataSomeValuesFrom',dataSomeValuesFrom).
xmle_functor('DataAllValuesFrom',dataAllValuesFrom).
xmle_functor('DataHasValue',dataHasValue).
xmle_functor('DataMinCardinality',dataMinCardinality).
xmle_functor('DataMaxCardinality',dataMaxCardinality).
xmle_functor('DataExactCardinality',dataExactCardinality).
% axiompred(P/A),functor(H,P,A),H=..[P|Args],atom_chars(P,[C|Chars]),upcase_atom(C,C2),atom_chars(P2,[C2|Chars]),formatq('xmle_axiom(~q,~w,~w).~n',[P2,H,Args]),fail.
% declarations
xmle_entity('Class',class(A),[c(A)]).
%xmle_entity('OWLClass',class(A),[A]). % TODO: clarify. Protege4 exports this
xmle_entity('Datatype',datatype(A),[dt(A)]).
xmle_entity('ObjectProperty',objectProperty(A),[op(A)]).
xmle_entity('DataProperty',dataProperty(A),[dp(A)]).
xmle_entity('AnnotationProperty',annotationProperty(A),[ap(A)]).
xmle_entity('NamedIndividual',namedIndividual(A),[i(A)]). % TODO - check
xmle_entity('Individual',individual(A),[i(A)]).
xmle_axiom('SubClassOf',subClassOf(A, B),[c(A), c(B)]).
xmle_axiom('EquivalentClasses',equivalentClasses(A),A1) :- maplist(iri_type(c),A,A1).
xmle_axiom('DisjointClasses',disjointClasses(A),A1) :- maplist(iri_type(c),A,A1).
xmle_axiom('DisjointUnion',disjointUnion(A, B),[c(A), c(B)]).
xmle_axiom('SubObjectPropertyOf',subPropertyOf(A, B),[op(A), op(B)]).
xmle_axiom('SubDataPropertyOf',subPropertyOf(A, B),[dp(A), dp(B)]).
xmle_axiom('EquivalentObjectProperties',equivalentProperties(A),A1) :- maplist(iri_type(op),A,A1).
xmle_axiom('EquivalentDataProperties',equivalentProperties(A),A1) :- maplist(iri_type(dp),A,A1).
xmle_axiom('DisjointObjectProperties',disjointProperties(A),A1) :- maplist(iri_type(op),A,A1).
xmle_axiom('DisjointDataProperties',disjointProperties(A),A1) :- maplist(iri_type(dp),A,A1).
xmle_axiom('InverseObjectProperties',inverseProperties(A, B),[op(A), op(B)]).
xmle_axiom('ObjectPropertyDomain',propertyDomain(A, B),[op(A), c(B)]).
xmle_axiom('DataPropertyDomain',propertyDomain(A, B),[dp(A), c(B)]).
xmle_axiom('ObjectPropertyRange',propertyRange(A, B),[op(A), c(B)]).
xmle_axiom('DataPropertyRange',propertyRange(A, B),[dp(A), c(B)]).
xmle_axiom('FunctionalObjectProperty',functionalProperty(A),[op(A)]).
xmle_axiom('FunctionalDataProperty',functionalProperty(A),[dp(A)]).
xmle_axiom('InverseFunctionalObjectProperty',inverseFunctionalProperty(A),[op(A)]).
xmle_axiom('ReflexiveObjectProperty',reflexiveProperty(A),[op(A)]).
xmle_axiom('IrreflexiveObjectProperty',irreflexiveProperty(A),[op(A)]).
xmle_axiom('SymmetricObjectProperty',symmetricProperty(A),[op(A)]).
xmle_axiom('AsymmetricObjectProperty',asymmetricProperty(A),[op(A)]).
xmle_axiom('TransitiveObjectProperty',transitiveProperty(A),[op(A)]).
% individual axioms
xmle_axiom('SameIndividual',sameIndividual(A),A1) :- maplist(iri_type(i),A,A1).
xmle_axiom('DifferentIndividuals',differentIndividuals(A),A1) :- maplist(iri_type(i),A,A1).
xmle_axiom('ClassAssertion',classAssertion(A, B),[c(A), i(B)]).
xmle_axiom('ObjectPropertyAssertion',propertyAssertion(A, B, C),[op(A), i(B), i(C)]).
xmle_axiom('DataPropertyAssertion',propertyAssertion(A, B, C),[dp(A), i(B), C]).
xmle_axiom('NegativeObjectPropertyAssertion',negativePropertyAssertion(A, B, C),[op(A), i(B), i(C)]).
xmle_axiom('NegativeDataPropertyAssertion',negativePropertyAssertion(A, B, C),[dp(A), i(B), C]).
xmle_axiom('AnnotationAssertion',annotationAssertion(A, B, C),[ap(A), i(B), C]).
%xmle_axiom('OntologyAnnotation',ontologyAnnotation(A, B, C),[A, B, C]).
%xmle_axiom('AxiomAnnotation',axiomAnnotation(A, B, C),[A, B, C]).
%xmle_axiom('AnnotationAnnotation',annotationAnnotation(A, B, C),[A, B, C]).
%xmle_axiom('Ontology',ontology(A),[A]).
%xmle_axiom('OntologyAxiom',ontologyAxiom(A, B),[A, B]).
%xmle_axiom('OntologyImport',ontologyImport(A, B),[A, B]).
%xmle_axiom('OntologyVersionInfo',ontologyVersionInfo(A, B),[A, B]).
%mle_axiom('Implies',implies(A, B),[A, B]).
iri_type(Type,Arg,TypedArg) :-
TypedArg =.. [Type,Arg].
/** <module> Generation and parsing of OWL-XML from owl2_model
---+ Synopsis
Use this module via owl2_io.pl
==
:- use_module(library('thea2/owl2_io')).
:- use_module(library('thea2/owl2_model')).
test :-
load_axioms('testfiles/rnao.owlx',owlx),
forall(axiom(A),writeln(A)).
==
---+ Details
http://www.w3.org/TR/2008/WD-owl2-xml-serialization-20081202/
The XML syntax of OWL 2 corresponds closely to the structural
specification of OWL 2, so it is fully typed. It thus differs somewhat
from the functional-style syntax of OWL 2 [OWL 2 Specification]. For
example, whereas the functional-style syntax uses a nonterminal
SomeValuesFrom for existential restrictions on both the object and
data properties, the XML syntax provides two elements
owl:ObjectSomeValuesFrom and owl:DataSomeValuesFrom.
---++ Status
Alpha - use owl2_from_rdf.pl and OWL-RDF serializations for reliable parsing
---+ Additional Information
@author Chris Mungall
@version $Revision$
@see README
@license License
*/