diff options
| author | yzhou <yujiao.zhou@gmail.com> | 2015-04-21 10:34:27 +0100 |
|---|---|---|
| committer | yzhou <yujiao.zhou@gmail.com> | 2015-04-21 10:34:27 +0100 |
| commit | 9ce65c5a963b03ee97fe9cb6c5aa65a3c04a80a8 (patch) | |
| tree | 47511c0fb89dccff0db4b5990522e04f294d795b /src/uk/ac/ox/cs/pagoda/rules/GeneralProgram.java | |
| parent | b1ac207612ee8b045244253fb94b866104bc34f2 (diff) | |
| download | ACQuA-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.java | 49 |
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 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.rules; | ||
| 2 | |||
| 3 | import java.util.Collection; | ||
| 4 | import java.util.Collections; | ||
| 5 | import java.util.Set; | ||
| 6 | |||
| 7 | import org.semanticweb.HermiT.model.DLClause; | ||
| 8 | import org.semanticweb.owlapi.model.OWLOntology; | ||
| 9 | import uk.ac.ox.cs.pagoda.constraints.UnaryBottom; | ||
| 10 | |||
| 11 | public 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 | } | ||
