001: /*****************************************************************************
002: * Source code information
003: * -----------------------
004: * Original author Ian Dickinson, HP Labs Bristol
005: * Author email ian.dickinson@hp.com
006: * Package Jena 2
007: * Web http://sourceforge.net/projects/jena/
008: * Created 11-Sep-2003
009: * Filename $RCSfile: TestPellet.java,v $
010: * Revision $Revision: 1.4 $
011: * Release status $State: Exp $
012: *
013: * Last modified on $Date: 2008/01/02 12:10:28 $
014: * by $Author: andy_seaborne $
015: *
016: * (c) Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
017: * [See end of file]
018: *****************************************************************************/package com.hp.hpl.jena.reasoner.dig.test;
019:
020: // Imports
021: ///////////////
022: import com.hp.hpl.jena.ontology.*;
023: import com.hp.hpl.jena.rdf.model.ModelFactory;
024: import com.hp.hpl.jena.reasoner.dig.DIGAdapter;
025: import com.hp.hpl.jena.reasoner.test.TestUtil;
026:
027: import junit.framework.*;
028:
029: /**
030: * <p>
031: * Unit test suite for DIG reasoner interface to Pellet - note <b>not</b> part of standard Jena test
032: * suite, since it requires a running Pellet reasoner.
033: * </p>
034: *
035: * @author Ian Dickinson, HP Labs (<a href="mailto:Ian.Dickinson@hp.com">email</a>)
036: * @version Release @release@ ($Id: TestPellet.java,v 1.4 2008/01/02 12:10:28 andy_seaborne Exp $)
037: */
038: public class TestPellet extends TestCase {
039: // Constants
040: //////////////////////////////////
041:
042: // Static variables
043: //////////////////////////////////
044:
045: // Instance variables
046: //////////////////////////////////
047:
048: // Constructors
049: //////////////////////////////////
050:
051: // External signature methods
052: //////////////////////////////////
053:
054: public void setUp() {
055: // ensure the ont doc manager is in a consistent state
056: OntDocumentManager.getInstance().reset(true);
057: }
058:
059: public void testPelletName() {
060: DIGAdapter r = new DIGAdapter(OntModelSpec.OWL_DL_MEM,
061: ModelFactory.createOntologyModel().getGraph());
062: assertEquals("Name should be Pellet", "Pellet", r
063: .getDigIdentifier().getName());
064: }
065:
066: public void testPelletVersion() {
067: DIGAdapter r = new DIGAdapter(OntModelSpec.OWL_DL_MEM,
068: ModelFactory.createOntologyModel().getGraph());
069: assertNotNull("Version should be non-null", r
070: .getDigIdentifier().getVersion());
071: }
072:
073: public void testPelletMessage() {
074: DIGAdapter r = new DIGAdapter(OntModelSpec.OWL_DL_MEM,
075: ModelFactory.createOntologyModel().getGraph());
076: assertNotNull("Message should be non-null", r
077: .getDigIdentifier().getMessage());
078: }
079:
080: public void testPelletSupportsLanguage() {
081: DIGAdapter r = new DIGAdapter(OntModelSpec.OWL_DL_MEM,
082: ModelFactory.createOntologyModel().getGraph());
083: TestUtil.assertIteratorValues(this , r.getDigIdentifier()
084: .supportsLanguage(), new Object[] { "top", "bottom",
085: "catom", "ratom", "and", "or", "not", "some", "all",
086: "atmost", "atleast", "inverse", "attribute",
087: "intequals", "stringequals", "iset" });
088: }
089:
090: public void testPelletSupportsTell() {
091: DIGAdapter r = new DIGAdapter(OntModelSpec.OWL_DL_MEM,
092: ModelFactory.createOntologyModel().getGraph());
093: TestUtil.assertIteratorValues(this , r.getDigIdentifier()
094: .supportsTell(), new Object[] { "defconcept",
095: "defrole", "defattribute", "defindividual", "impliesc",
096: "equalc", "disjoint", "impliesr", "domain", "range",
097: "rangeint", "transitive", "functional", "instanceof",
098: "related", "value", "equalr", "rangestring" });
099: }
100:
101: public void testPelletSupportsAsk() {
102: DIGAdapter r = new DIGAdapter(OntModelSpec.OWL_DL_MEM,
103: ModelFactory.createOntologyModel().getGraph());
104: TestUtil.assertIteratorValues(this , r.getDigIdentifier()
105: .supportsAsk(), new Object[] { "allConceptNames",
106: "allRoleNames", "allIndividuals", "satisfiable",
107: "subsumes", "disjoint", "parents", "children",
108: "descendants", "ancestors", "equivalents", "rparents",
109: "rchildren", "rancestors", "rdescendants", "instances",
110: "types", "instance", "roleFillers",
111: "relatedIndividuals", "toldValues", });
112: }
113:
114: // Internal implementation methods
115: //////////////////////////////////
116:
117: //==============================================================================
118: // Inner class definitions
119: //==============================================================================
120:
121: }
122:
123: /*
124: * (c) Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
125: * All rights reserved.
126: *
127: * Redistribution and use in source and binary forms, with or without
128: * modification, are permitted provided that the following conditions
129: * are met:
130: * 1. Redistributions of source code must retain the above copyright
131: * notice, this list of conditions and the following disclaimer.
132: * 2. Redistributions in binary form must reproduce the above copyright
133: * notice, this list of conditions and the following disclaimer in the
134: * documentation and/or other materials provided with the distribution.
135: * 3. The name of the author may not be used to endorse or promote products
136: * derived from this software without specific prior written permission.
137: *
138: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
139: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
140: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
141: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
142: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
143: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
144: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
145: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
146: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
147: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
148: */
|