01: /*
02: * Copyright Aduna (http://www.aduna-software.com/) (c) 2007.
03: *
04: * Licensed under the Aduna BSD-style license.
05: */
06: package org.openrdf.sail.inferencer.fc.config;
07:
08: import org.openrdf.sail.Sail;
09: import org.openrdf.sail.config.SailConfigException;
10: import org.openrdf.sail.config.SailFactory;
11: import org.openrdf.sail.config.SailImplConfig;
12: import org.openrdf.sail.inferencer.fc.ForwardChainingRDFSInferencer;
13:
14: /**
15: * A {@link SailFactory} that creates {@link ForwardChainingRDFSInferencer}s
16: * based on RDF configuration data.
17: *
18: * @author Arjohn Kampman
19: */
20: public class ForwardChainingRDFSInferencerFactory implements
21: SailFactory {
22:
23: /**
24: * The type of repositories that are created by this factory.
25: *
26: * @see SailFactory#getSailType()
27: */
28: public static final String SAIL_TYPE = "openrdf:ForwardChainingRDFSInferencer";
29:
30: /**
31: * Returns the Sail's type: <tt>openrdf:ForwardChainingRDFSInferencer</tt>.
32: */
33: public String getSailType() {
34: return SAIL_TYPE;
35: }
36:
37: public SailImplConfig getConfig() {
38: return new ForwardChainingRDFSInferencerConfig();
39: }
40:
41: public Sail getSail(SailImplConfig config)
42: throws SailConfigException {
43: if (!SAIL_TYPE.equals(config.getType())) {
44: throw new SailConfigException("Invalid Sail type: "
45: + config.getType());
46: }
47:
48: return new ForwardChainingRDFSInferencer();
49: }
50: }
|