The model treats axiom annotations as axioms:
%% axiomAnnotation(?Axiom, ?AnnotationProperty, ?AnnotationValue)
so the intention is that you should be able to do this:
assert_axiom( axiomAnnotation( propertyAssertion( preys_on, lion, zebra ), 'rdfs:comment', literal('Comment on the preys_on property between Lion and Zebra'))).
however, a couple of warnings:
[1] this _should_ also have the effect of assertion the core propertyAssertion axiom, but it won't. In OWL2-DL it's syntactically impossible to have an axiom annotation without the axiom being in the model.
[2] There is an issue on the tracker on round-tripping axiom annotations to rdf/xml
The first should be easy to address. I may need Vangelis to take a look at [2].
I'm using axiom annotations a lot so am keen to see this part of the library completed!
Cheers
Chris
In the model, all annotations on axioms or ontologies or annotations themselves are stored as annotation/3.
so this should work:
assert_axiom( annotation( propertyAssertion( preys_on, lion, zebra ), 'rdfs:comment', literal('Comment on the preys_on property between Lion and Zebra'))).
However, annotation/3 isn't itself treated as an axiom. I think it would be cleaner if it were.
V, what do you think about re-instating this line:
% axiom(annotation(A,B,C)) :- annotation(A,B,C).
> Chris,Jochem,
>
> 1/ annotations/3 is used as to store all OWL2 mode Annotation axioms (all 3, axiomAnnotations, ontologyAnnotations and annotationAnnotations).
> 2/ Jochem: indeed you should assert the annotation/3 axiom as Chris suggests. See the attached modified test file
> 3/ Chris: annotation/3 is not defined as axiom/1 (commented out) but this does not impact the roundtripping between RDF/XML and the model.
There are many cases where it's useful to iterate over all axioms performing some operation. For example, the prolog dumper simply does al
forall(axiom(A),
format('~q.~n',[A]).
I suppose we can add a new predicate axiomOrAnnotation that can be used in its place - although using axiom/1 is kind of hard-coded in my brain now...
> 4/ A bug was found for the issue 8 and fixed in the *axiomannotations* branch. Chris can you verify? to me it seems correct.
See comments - looks fine - in fact this might have been working before, the problem being I was checking the parsing by dumping prolog using the above method!
There's one more potential issue. The current rdf/xml exporter uses bNodes to avoid exporting the same structure again and again. I have fixed this on the pkb branch by commenting out this:
% NO STRUCTURE SHARING IN OWL2
%as2rdf_bnode(X,Node) :-
% blanknode_gen(Node,X),
% debug(bnode,'bnode REUSE ~w ==> ~w',[X,Node]),
% !.
however, the owl2_export_annotation/5 clauses still forces bNodes when there are axioms annotations where the target of the axiom is anonymous. This is technically invalid OWL2-DL, and Protege4 seems to have a problem with it (this is really annoying as using bnodes is a nice way to cut down on the excessive rdf/xml verbiage, ah well)
> <annotations_test.pl><ontology-test.owl>
Many thanks for developing a solution. I've downloaded the
axiomannotation branch and will try to use it to implement OWL
export/import functionality in our tool.
Thanks for a very nice library!
Best regards,
Jochem
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Jochem Liem, MSc.
Informatics Institute
Faculty of Science
University of Amsterdam
http://www.science.uva.nl/~jliem/
Phone: +31 (0)20 525 6801
Mobile: +31 (0)6 4321 9992
Fax: +31 (0)20 525 7490
Visitor address:
Science Park 904, C2.248
1098 XH Amsterdam
Mailing address:
Postbus 94323
1090 GH Amsterdam
The Netherlands
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=