Clover coverage report - Maven Clover report
Coverage timestamp: Tue Sep 16 2008 01:16:37 EEST
file stats: LOC: 98   Methods: 1
NCLOC: 51   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
NodeOntology.java 0% 0% 0% 0%
coverage
 1    /*
 2    wsmo4j - a WSMO API and Reference Implementation
 3   
 4    Copyright (c) 2006, University of Innsbruck, Austria
 5   
 6    This library is free software; you can redistribute it and/or modify it under
 7    the terms of the GNU Lesser General Public License as published by the Free
 8    Software Foundation; either version 2.1 of the License, or (at your option)
 9    any later version.
 10    This library is distributed in the hope that it will be useful, but WITHOUT
 11    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 12    FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 13    details.
 14    You should have received a copy of the GNU Lesser General Public License along
 15    with this library; if not, write to the Free Software Foundation, Inc.,
 16    59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 17    */
 18    package org.deri.wsmo4j.io.serializer.rdf;
 19   
 20    import java.io.IOException;
 21   
 22    import org.deri.wsmo4j.io.parser.rdf.RDFExprParser;
 23    import org.omwg.ontology.*;
 24    import org.openrdf.vocabulary.RDF;
 25    import org.openrdf.vocabulary.RDFS;
 26   
 27    /**
 28    * Helper type to serialize/deserialize xml element ontology
 29    *
 30    * @author not attributable
 31    */
 32    class NodeOntology {
 33   
 34  0 static void serialize(Ontology ontology, WsmlRdfSerializer serializer) {
 35    // keep in mind the ontology id (for better roundtripping)
 36  0 try {
 37  0 serializer.getWriter().writeStatement(
 38    serializer.getFactory().createURI(ontology.getIdentifier().toString()),
 39    serializer.getFactory().createURI(RDFExprParser.WSML_ONTOLOGY_ID),
 40    serializer.getFactory().createURI(ontology.getIdentifier().toString()));
 41    } catch (IOException e) {
 42  0 throw new RuntimeException();
 43    }
 44  0 if (!ontology.listNFPValues().isEmpty()) {
 45  0 NodeNFP.serialize(ontology, serializer);
 46    }
 47   
 48  0 if (!ontology.listConcepts().isEmpty()) {
 49  0 Object[] concepts = ontology.listConcepts().toArray();
 50  0 for (int i = 0; i < concepts.length; i++) {
 51  0 NodeConcept.serialize((Concept) concepts[i], serializer);
 52    }
 53    }
 54   
 55  0 if (!ontology.listInstances().isEmpty()) {
 56  0 Object[] instances = ontology.listInstances().toArray();
 57  0 for (int i = 0; i < instances.length; i++) {
 58  0 NodeInstance.serialize((Instance) instances[i],serializer);
 59    }
 60    }
 61   
 62  0 if (!ontology.listRelations().isEmpty()) {
 63  0 Object[] relations = ontology.listRelations().toArray();
 64  0 for (int i = 0; i < relations.length; i++)
 65  0 NodeRelation.serialize((Relation) relations[i],serializer);
 66    }
 67   
 68  0 if (!ontology.listRelationInstances().isEmpty()) {
 69  0 Object[] relationInstances = ontology.listRelationInstances().toArray();
 70  0 for (int i = 0; i < relationInstances.length; i++) {
 71  0 NodeRelationInstance.serialize(
 72    (RelationInstance) relationInstances[i], serializer);
 73    }
 74    }
 75   
 76  0 if (!ontology.listAxioms().isEmpty()) {
 77  0 Object[] axioms = ontology.listAxioms().toArray();
 78  0 for (int i = 0; i < axioms.length; i++) {
 79  0 NodeLogExp.serialize((Axiom) axioms[i], serializer);
 80    }
 81    }
 82   
 83    }
 84    }
 85   
 86    /*
 87    * $Log$
 88    * Revision 1.2 2006/11/16 14:35:09 ohamano
 89    * *** empty log message ***
 90    *
 91    * Revision 1.1 2006/11/10 15:02:59 ohamano
 92    * *** empty log message ***
 93    *
 94    * Revision 1.1 2006/11/10 10:08:42 ohamano
 95    * *** empty log message ***
 96    *
 97    *
 98    */