diff options
| author | yzhou <yzhou@krr-linux.cs.ox.ac.uk> | 2015-05-01 12:10:58 +0100 |
|---|---|---|
| committer | yzhou <yzhou@krr-linux.cs.ox.ac.uk> | 2015-05-01 18:13:14 +0100 |
| commit | 2d007839a1e0f9775097f5f7cff14521d2afd021 (patch) | |
| tree | 876cc374bc0d660ee91fe6e5011fffd72d911de4 /src/uk | |
| parent | 0d8f240c9c0a64f2285324e5a517161e45c698fc (diff) | |
| download | ACQuA-2d007839a1e0f9775097f5f7cff14521d2afd021.tar.gz ACQuA-2d007839a1e0f9775097f5f7cff14521d2afd021.zip | |
add time tag to the temporary output
fixed a bug about equality in the tracking datalog encoding
Diffstat (limited to 'src/uk')
3 files changed, 16 insertions, 5 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/multistage/treatement/Pick4NegativeConcept.java b/src/uk/ac/ox/cs/pagoda/multistage/treatement/Pick4NegativeConcept.java index 5abb2fe..f40ae31 100644 --- a/src/uk/ac/ox/cs/pagoda/multistage/treatement/Pick4NegativeConcept.java +++ b/src/uk/ac/ox/cs/pagoda/multistage/treatement/Pick4NegativeConcept.java | |||
| @@ -76,7 +76,9 @@ public abstract class Pick4NegativeConcept implements Treatment { | |||
| 76 | String negativeQuery; | 76 | String negativeQuery; |
| 77 | String[] subVars; | 77 | String[] subVars; |
| 78 | for (Atom headAtom: orderedAtoms) { | 78 | for (Atom headAtom: orderedAtoms) { |
| 79 | negativeQuery = SparqlHelper.getSPARQLQuery(new Atom[] { MultiStageUpperProgram.getNegativeAtom(headAtom) }, | 79 | Atom negativeAtom = MultiStageUpperProgram.getNegativeAtom(headAtom); |
| 80 | if (negativeAtom == null) continue; | ||
| 81 | negativeQuery = SparqlHelper.getSPARQLQuery(new Atom[] { negativeAtom }, | ||
| 80 | subVars = MultiStageUpperProgram.getVarSubset(violation.getVariables(), headAtom)); | 82 | subVars = MultiStageUpperProgram.getVarSubset(violation.getVariables(), headAtom)); |
| 81 | negTuples.clear(); | 83 | negTuples.clear(); |
| 82 | Atom gapHeadAtom = addGap ? getGapAtom(headAtom) : null; | 84 | Atom gapHeadAtom = addGap ? getGapAtom(headAtom) : null; |
diff --git a/src/uk/ac/ox/cs/pagoda/tracking/TrackingRuleEncoderWithGap.java b/src/uk/ac/ox/cs/pagoda/tracking/TrackingRuleEncoderWithGap.java index e7bd188..67d07a8 100644 --- a/src/uk/ac/ox/cs/pagoda/tracking/TrackingRuleEncoderWithGap.java +++ b/src/uk/ac/ox/cs/pagoda/tracking/TrackingRuleEncoderWithGap.java | |||
| @@ -3,10 +3,12 @@ package uk.ac.ox.cs.pagoda.tracking; | |||
| 3 | import java.util.Collection; | 3 | import java.util.Collection; |
| 4 | import java.util.LinkedList; | 4 | import java.util.LinkedList; |
| 5 | 5 | ||
| 6 | import org.semanticweb.HermiT.model.AnnotatedEquality; | ||
| 6 | import org.semanticweb.HermiT.model.Atom; | 7 | import org.semanticweb.HermiT.model.Atom; |
| 7 | import org.semanticweb.HermiT.model.AtomicConcept; | 8 | import org.semanticweb.HermiT.model.AtomicConcept; |
| 8 | import org.semanticweb.HermiT.model.AtomicRole; | 9 | import org.semanticweb.HermiT.model.AtomicRole; |
| 9 | import org.semanticweb.HermiT.model.DLClause; | 10 | import org.semanticweb.HermiT.model.DLClause; |
| 11 | import org.semanticweb.HermiT.model.Equality; | ||
| 10 | import org.semanticweb.HermiT.model.Variable; | 12 | import org.semanticweb.HermiT.model.Variable; |
| 11 | import org.semanticweb.owlapi.model.OWLClass; | 13 | import org.semanticweb.owlapi.model.OWLClass; |
| 12 | import org.semanticweb.owlapi.model.OWLObjectProperty; | 14 | import org.semanticweb.owlapi.model.OWLObjectProperty; |
| @@ -83,11 +85,12 @@ public class TrackingRuleEncoderWithGap extends TrackingRuleEncoder { | |||
| 83 | } | 85 | } |
| 84 | 86 | ||
| 85 | DLClause newClause; | 87 | DLClause newClause; |
| 88 | headAtom = clause.getHeadAtom(0); | ||
| 86 | 89 | ||
| 87 | int offset = (clause.getBodyLength() == 1 && clause.getBodyAtom(0).getDLPredicate().toString().contains("owl:Nothing")) ? 1 : 2; | 90 | boolean equalityHead = headAtom.getDLPredicate() instanceof Equality || headAtom.getDLPredicate() instanceof AnnotatedEquality; |
| 91 | int offset = (equalityHead || (clause.getBodyLength() == 1 && clause.getBodyAtom(0).getDLPredicate().toString().contains("owl:Nothing"))) ? 1 : 2; | ||
| 88 | 92 | ||
| 89 | Atom[] newBodyAtoms = new Atom[clause.getBodyLength() + offset]; | 93 | Atom[] newBodyAtoms = new Atom[clause.getBodyLength() + offset]; |
| 90 | headAtom = clause.getHeadAtom(0); | ||
| 91 | newBodyAtoms[0] = Atom.create( | 94 | newBodyAtoms[0] = Atom.create( |
| 92 | getTrackingDLPredicate(headAtom.getDLPredicate()), | 95 | getTrackingDLPredicate(headAtom.getDLPredicate()), |
| 93 | DLClauseHelper.getArguments(headAtom)); | 96 | DLClauseHelper.getArguments(headAtom)); |
diff --git a/src/uk/ac/ox/cs/pagoda/util/Utility.java b/src/uk/ac/ox/cs/pagoda/util/Utility.java index 120d463..6982bb1 100644 --- a/src/uk/ac/ox/cs/pagoda/util/Utility.java +++ b/src/uk/ac/ox/cs/pagoda/util/Utility.java | |||
| @@ -11,6 +11,8 @@ import java.io.InputStreamReader; | |||
| 11 | import java.io.OutputStreamWriter; | 11 | import java.io.OutputStreamWriter; |
| 12 | import java.io.PrintStream; | 12 | import java.io.PrintStream; |
| 13 | import java.text.SimpleDateFormat; | 13 | import java.text.SimpleDateFormat; |
| 14 | import java.time.LocalDateTime; | ||
| 15 | import java.time.format.DateTimeFormatter; | ||
| 14 | import java.util.Collection; | 16 | import java.util.Collection; |
| 15 | import java.util.Date; | 17 | import java.util.Date; |
| 16 | import java.util.HashSet; | 18 | import java.util.HashSet; |
| @@ -30,7 +32,7 @@ public class Utility { | |||
| 30 | public static final String FILE_SEPARATOR = System.getProperty("file.separator"); | 32 | public static final String FILE_SEPARATOR = System.getProperty("file.separator"); |
| 31 | public static final String LINE_SEPARATOR = System.getProperty("line.separator"); | 33 | public static final String LINE_SEPARATOR = System.getProperty("line.separator"); |
| 32 | 34 | ||
| 33 | public static final String TempDirectory = (new File("tmp")).getAbsolutePath() + FILE_SEPARATOR; | 35 | public static final String TempDirectory = (new File("tmp" + DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(LocalDateTime.now()))).getAbsolutePath() + FILE_SEPARATOR; |
| 34 | 36 | ||
| 35 | public static final int TEST = -1; | 37 | public static final int TEST = -1; |
| 36 | public static final int FLY = 0; | 38 | public static final int FLY = 0; |
| @@ -235,7 +237,11 @@ public class Utility { | |||
| 235 | 237 | ||
| 236 | public static void cleanup() { | 238 | public static void cleanup() { |
| 237 | File tmp = new File(TempDirectory); | 239 | File tmp = new File(TempDirectory); |
| 238 | if (tmp.exists()) tmp.delete(); | 240 | if (tmp.exists()) { |
| 241 | for (File file: tmp.listFiles()) | ||
| 242 | file.delete(); | ||
| 243 | tmp.delete(); | ||
| 244 | } | ||
| 239 | } | 245 | } |
| 240 | 246 | ||
| 241 | public static String toFileIRI(String path) { | 247 | public static String toFileIRI(String path) { |
