01: /*
02: (c) Copyright 2008 Hewlett-Packard Development Company, LP
03: All rights reserved.
04: $Id: TestConfigVocabulary.java,v 1.1 2008/01/21 14:54:18 chris-dollin Exp $
05: */
06:
07: package com.hp.hpl.jena.reasoner.rulesys.test;
08:
09: import com.hp.hpl.jena.rdf.model.*;
10: import com.hp.hpl.jena.rdf.model.test.ModelTestBase;
11: import com.hp.hpl.jena.reasoner.ReasonerRegistry;
12: import com.hp.hpl.jena.vocabulary.*;
13:
14: /**
15: Tests for configuration vocabulary added as part of ModelSpec removal
16:
17: @author kers
18: */
19: public class TestConfigVocabulary extends ModelTestBase {
20: public TestConfigVocabulary(String name) {
21: super (name);
22: }
23:
24: public void testExistingVocabulary() {
25: assertIsProperty("name", ReasonerVocabulary.nameP);
26: assertIsProperty("description", ReasonerVocabulary.descriptionP);
27: assertIsProperty("version", ReasonerVocabulary.versionP);
28: assertIsProperty("supports", ReasonerVocabulary.supportsP);
29: assertIsProperty("configurationProperty",
30: ReasonerVocabulary.configurationP);
31: assertIsProperty("individualAsThing",
32: ReasonerVocabulary.individualAsThingP);
33: }
34:
35: public void testPropVocavulary() {
36: assertIsPropProperty("derivationLogging",
37: ReasonerVocabulary.PROPderivationLogging);
38: assertIsPropProperty("traceOn", ReasonerVocabulary.PROPtraceOn);
39: assertIsPropProperty("ruleMode",
40: ReasonerVocabulary.PROPruleMode);
41: assertIsPropProperty("enableOWLTranslation",
42: ReasonerVocabulary.PROPenableOWLTranslation);
43: assertIsPropProperty("enableTGCCaching",
44: ReasonerVocabulary.PROPenableTGCCaching);
45: assertIsPropProperty("enableCMPScan",
46: ReasonerVocabulary.PROPenableCMPScan);
47: assertIsPropProperty("setRDFSLevel",
48: ReasonerVocabulary.PROPsetRDFSLevel);
49: assertIsPropProperty("enableFunctorFiltering",
50: ReasonerVocabulary.PROPenableFunctorFiltering);
51: }
52:
53: public void testDirectVocabulary() {
54: assertIsDirectProperty(RDFS.subClassOf,
55: ReasonerVocabulary.directSubClassOf);
56: assertIsDirectProperty(RDFS.subPropertyOf,
57: ReasonerVocabulary.directSubPropertyOf);
58: assertIsDirectProperty(RDF.type,
59: ReasonerVocabulary.directRDFType);
60: }
61:
62: public void testRuleSetVocabulary() {
63: assertIsProperty("ruleSet", ReasonerVocabulary.ruleSet);
64: assertIsProperty("ruleSetURL", ReasonerVocabulary.ruleSetURL);
65: assertIsProperty("hasRule", ReasonerVocabulary.hasRule);
66: assertIsProperty("schemaURL", ReasonerVocabulary.schemaURL);
67: }
68:
69: private void assertIsDirectProperty(Resource r, Property p) {
70: assertEquals(ReasonerRegistry.makeDirect(r.getURI()), p
71: .getURI());
72: }
73:
74: private void assertIsProperty(String name, Property p) {
75: assertEquals(ReasonerVocabulary.getJenaReasonerNS() + name, p
76: .getURI());
77: }
78:
79: private void assertIsPropProperty(String name, Property p) {
80: assertEquals(ReasonerVocabulary.PropURI + "#" + name, p
81: .getURI());
82: }
83: }
|