aboutsummaryrefslogtreecommitdiff
path: root/src/uk/ac/ox/cs/pagoda/rules/GeneralProgram.java
diff options
context:
space:
mode:
authoryzhou <yujiao.zhou@gmail.com>2015-04-21 10:34:27 +0100
committeryzhou <yujiao.zhou@gmail.com>2015-04-21 10:34:27 +0100
commit9ce65c5a963b03ee97fe9cb6c5aa65a3c04a80a8 (patch)
tree47511c0fb89dccff0db4b5990522e04f294d795b /src/uk/ac/ox/cs/pagoda/rules/GeneralProgram.java
parentb1ac207612ee8b045244253fb94b866104bc34f2 (diff)
downloadACQuA-9ce65c5a963b03ee97fe9cb6c5aa65a3c04a80a8.tar.gz
ACQuA-9ce65c5a963b03ee97fe9cb6c5aa65a3c04a80a8.zip
initial version
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/rules/GeneralProgram.java')
-rw-r--r--src/uk/ac/ox/cs/pagoda/rules/GeneralProgram.java49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/rules/GeneralProgram.java b/src/uk/ac/ox/cs/pagoda/rules/GeneralProgram.java
new file mode 100644
index 0000000..38fa494
--- /dev/null
+++ b/src/uk/ac/ox/cs/pagoda/rules/GeneralProgram.java
@@ -0,0 +1,49 @@
1package uk.ac.ox.cs.pagoda.rules;
2
3import java.util.Collection;
4import java.util.Collections;
5import java.util.Set;
6
7import org.semanticweb.HermiT.model.DLClause;
8import org.semanticweb.owlapi.model.OWLOntology;
9import uk.ac.ox.cs.pagoda.constraints.UnaryBottom;
10
11public class GeneralProgram extends Program {
12
13 public GeneralProgram(Set<DLClause> relevantClauses, OWLOntology relevantOntology) {
14 ontology = relevantOntology;
15
16 ontologyDirectory = null;
17 dlOntology = null;
18 botStrategy = new UnaryBottom();
19
20 clauses = botStrategy.process(relevantClauses);
21 }
22
23 public GeneralProgram() {}
24
25 public Collection<DLClause> convert2Clauses(DLClause clause) {
26 return botStrategy.process(Collections.singleton(clause));
27 }
28
29 @Override
30 public String getOutputPath() {
31 return getDirectory() + "rules.dlog";
32 }
33
34// @Override
35// public String getDirectory() {
36// File dir = new File(ontologyDirectory + Utility.FILE_SEPARATOR + "general");
37// if (!dir.exists())
38// dir.mkdirs();
39// return dir.getPath();
40// }
41
42 public boolean isHorn() {
43 for (DLClause clause: clauses)
44 if (clause.getHeadLength() > 1)
45 return false;
46 return true;
47 }
48
49}