001: /*
002: (c) Copyright 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
003: All rights reserved - see end of file.
004: $Id: TestAssemblerVocabulary.java,v 1.7 2008/01/02 12:05:57 andy_seaborne Exp $
005: */
006:
007: package com.hp.hpl.jena.assembler.test;
008:
009: import com.hp.hpl.jena.assembler.JA;
010: import com.hp.hpl.jena.rdf.model.*;
011:
012: public class TestAssemblerVocabulary extends AssemblerTestBase {
013: public TestAssemblerVocabulary(String name) {
014: super (name);
015: }
016:
017: protected Class getAssemblerClass() {
018: return null;
019: }
020:
021: public void testVocabulary() {
022: assertEquals("http://jena.hpl.hp.com/2005/11/Assembler#", JA
023: .getURI());
024: assertEquals("http://jena.hpl.hp.com/2005/11/Assembler#",
025: JA.uri);
026: //
027: assertLocalname("this", JA.This);
028: assertLocalname("Expanded", JA.Expanded);
029: //
030: assertLocalname("Object", JA.Object);
031: //
032: assertLocalname("Model", JA.Model);
033: assertLocalname("MemoryModel", JA.MemoryModel);
034: assertLocalname("DefaultModel", JA.DefaultModel);
035: assertLocalname("InfModel", JA.InfModel);
036: assertLocalname("OntModel", JA.OntModel);
037: assertLocalname("NamedModel", JA.NamedModel);
038: assertLocalname("RDBModel", JA.RDBModel);
039: assertLocalname("FileModel", JA.FileModel);
040: assertLocalname("OntModel", JA.OntModel);
041: assertLocalname("OntModelSpec", JA.OntModelSpec);
042: //
043: assertLocalname("Connection", JA.Connection);
044: assertLocalname("PrefixMapping", JA.PrefixMapping);
045: assertLocalname("ReasonerFactory", JA.ReasonerFactory);
046: assertLocalname("Content", JA.Content);
047: assertLocalname("LiteralContent", JA.LiteralContent);
048: assertLocalname("ExternalContent", JA.ExternalContent);
049: //
050: assertLocalname("rules", JA.rules);
051: assertLocalname("reasoner", JA.reasoner);
052: assertLocalname("reasonerURL", JA.reasonerURL);
053: assertLocalname("baseModel", JA.baseModel);
054: assertLocalname("literalContent", JA.literalContent);
055: assertLocalname("externalContent", JA.externalContent);
056: assertLocalname("ontModelSpec", JA.ontModelSpec);
057: assertLocalname("assembler", JA.assembler);
058: assertLocalname("loadClass", JA.loadClass);
059: assertLocalname("prefix", JA.prefix);
060: assertLocalname("namespace", JA.namespace);
061: assertLocalname("includes", JA.includes);
062: assertLocalname("directory", JA.directory);
063: assertLocalname("mapName", JA.mapName);
064: assertLocalname("documentManager", JA.documentManager);
065: assertLocalname("ontModelSpec", JA.ontModelSpec);
066: assertLocalname("ontLanguage", JA.ontLanguage);
067: assertLocalname("true", JA.True);
068: assertLocalname("false", JA.False);
069: }
070:
071: protected void assertLocalname(String local, Resource resource) {
072: assertEquals(JA.uri + local, resource.getURI());
073: }
074:
075: public void testObjectTypes() {
076: assertSubclassOf(JA.Model, JA.Object);
077: assertSubclassOf(JA.PrefixMapping, JA.Object);
078: assertSubclassOf(JA.Content, JA.Object);
079: assertSubclassOf(JA.Connection, JA.Object);
080: assertSubclassOf(JA.OntModelSpec, JA.Object);
081: assertSubclassOf(JA.ReasonerFactory, JA.Object);
082: }
083:
084: public void testModelTypes() {
085: assertSubclassOf(JA.MemoryModel, JA.Model);
086: assertSubclassOf(JA.DefaultModel, JA.Model);
087: assertSubclassOf(JA.InfModel, JA.Model);
088: assertSubclassOf(JA.OntModel, JA.InfModel);
089: assertSubclassOf(JA.NamedModel, JA.Model);
090: assertSubclassOf(JA.RDBModel, JA.NamedModel);
091: assertSubclassOf(JA.FileModel, JA.NamedModel);
092: // assertSubclassOf( JA.OntModelSpec, JA.ReasonerFactory );
093: assertSubclassOf(JA.ModelSource, JA.Connectable);
094: }
095:
096: public void testInfModelProperties() {
097: assertDomain(JA.InfModel, JA.baseModel);
098: assertDomain(JA.InfModel, JA.reasoner);
099: }
100:
101: public void testOntModelProperties() {
102: assertDomain(JA.OntModel, JA.ontModelSpec);
103: // assertRange( JA.ReasonerFactory, JA.reasonerURL );
104: }
105: }
106:
107: /*
108: * (c) Copyright 2005, 2006, 2007, 2008 Hewlett-Packard Development Company, LP
109: * All rights reserved.
110: *
111: * Redistribution and use in source and binary forms, with or without
112: * modification, are permitted provided that the following conditions
113: * are met:
114: * 1. Redistributions of source code must retain the above copyright
115: * notice, this list of conditions and the following disclaimer.
116: * 2. Redistributions in binary form must reproduce the above copyright
117: * notice, this list of conditions and the following disclaimer in the
118: * documentation and/or other materials provided with the distribution.
119: * 3. The name of the author may not be used to endorse or promote products
120: * derived from this software without specific prior written permission.
121: *
122: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
123: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
124: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
125: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
126: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
127: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
128: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
129: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
130: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
131: * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
132: */
|