diff options
| author | yzhou <yujiao.zhou@gmail.com> | 2015-04-21 22:45:35 +0100 |
|---|---|---|
| committer | yzhou <yujiao.zhou@gmail.com> | 2015-04-21 22:45:35 +0100 |
| commit | c0f5bdcdb29608532656c71c219680eccd4aad09 (patch) | |
| tree | 5f599adfe2e3f15a1d2b3f1cb8d0bf9ace59badd /src/uk/ac/ox/cs/pagoda/reasoner/QueryReasoner.java | |
| parent | c8a9fc67a3f6ed201d7c917e36128268587eabe5 (diff) | |
| download | ACQuA-c0f5bdcdb29608532656c71c219680eccd4aad09.tar.gz ACQuA-c0f5bdcdb29608532656c71c219680eccd4aad09.zip | |
fixed some bugs in windows server
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/reasoner/QueryReasoner.java')
| -rw-r--r-- | src/uk/ac/ox/cs/pagoda/reasoner/QueryReasoner.java | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/reasoner/QueryReasoner.java b/src/uk/ac/ox/cs/pagoda/reasoner/QueryReasoner.java index 0c009a2..a484444 100644 --- a/src/uk/ac/ox/cs/pagoda/reasoner/QueryReasoner.java +++ b/src/uk/ac/ox/cs/pagoda/reasoner/QueryReasoner.java | |||
| @@ -14,23 +14,41 @@ import uk.ac.ox.cs.pagoda.owl.OWLHelper; | |||
| 14 | import uk.ac.ox.cs.pagoda.query.AnswerTuples; | 14 | import uk.ac.ox.cs.pagoda.query.AnswerTuples; |
| 15 | import uk.ac.ox.cs.pagoda.query.QueryManager; | 15 | import uk.ac.ox.cs.pagoda.query.QueryManager; |
| 16 | import uk.ac.ox.cs.pagoda.query.QueryRecord; | 16 | import uk.ac.ox.cs.pagoda.query.QueryRecord; |
| 17 | import uk.ac.ox.cs.pagoda.util.Properties; | ||
| 17 | import uk.ac.ox.cs.pagoda.util.Timer; | 18 | import uk.ac.ox.cs.pagoda.util.Timer; |
| 18 | import uk.ac.ox.cs.pagoda.util.Utility; | 19 | import uk.ac.ox.cs.pagoda.util.Utility; |
| 19 | 20 | ||
| 20 | public abstract class QueryReasoner { | 21 | public abstract class QueryReasoner { |
| 21 | 22 | ||
| 22 | protected boolean forSemFacet = false; | 23 | // protected boolean forSemFacet = false; |
| 23 | 24 | Properties properties; | |
| 25 | |||
| 24 | public static enum Type { Full, RLU, ELHOU }; | 26 | public static enum Type { Full, RLU, ELHOU }; |
| 25 | 27 | ||
| 26 | public static QueryReasoner getInstanceForSemFacet(OWLOntology o) { | 28 | public static QueryReasoner getInstance(Properties p) { |
| 27 | QueryReasoner reasoner = getInstance(Type.Full, o, true, true); | 29 | OWLOntology ontology = OWLHelper.loadOntology(p.getOntologyPath()); |
| 28 | reasoner.forSemFacet = true; | 30 | QueryReasoner pagoda = getInstance(ontology, p); |
| 29 | return reasoner; | 31 | pagoda.properties = p; |
| 32 | pagoda.loadOntology(ontology); | ||
| 33 | pagoda.importData(p.getDataPath()); | ||
| 34 | if (pagoda.preprocess()) { | ||
| 35 | System.out.println("The ontology is consistent!"); | ||
| 36 | return pagoda; | ||
| 37 | } | ||
| 38 | else { | ||
| 39 | System.out.println("The ontology is inconsistent!"); | ||
| 40 | pagoda.dispose(); | ||
| 41 | return null; | ||
| 42 | } | ||
| 30 | } | 43 | } |
| 31 | 44 | ||
| 32 | |||
| 33 | public static QueryReasoner getInstance(OWLOntology o) { | 45 | public static QueryReasoner getInstance(OWLOntology o) { |
| 46 | QueryReasoner pagoda = getInstance(Type.Full, o, true, true); | ||
| 47 | pagoda.properties = new Properties(); | ||
| 48 | return pagoda; | ||
| 49 | } | ||
| 50 | |||
| 51 | private static QueryReasoner getInstance(OWLOntology o, Properties p) { | ||
| 34 | return getInstance(Type.Full, o, true, true); | 52 | return getInstance(Type.Full, o, true, true); |
| 35 | } | 53 | } |
| 36 | 54 | ||
