diff options
Diffstat (limited to 'src/uk/ac/ox/cs/pagoda/query/rollup')
3 files changed, 0 insertions, 1031 deletions
diff --git a/src/uk/ac/ox/cs/pagoda/query/rollup/QueryGraph.java b/src/uk/ac/ox/cs/pagoda/query/rollup/QueryGraph.java deleted file mode 100644 index 9b4ce01..0000000 --- a/src/uk/ac/ox/cs/pagoda/query/rollup/QueryGraph.java +++ /dev/null | |||
| @@ -1,400 +0,0 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.query.rollup; | ||
| 2 | |||
| 3 | import org.semanticweb.HermiT.model.*; | ||
| 4 | import org.semanticweb.owlapi.model.*; | ||
| 5 | import uk.ac.ox.cs.pagoda.util.Namespace; | ||
| 6 | |||
| 7 | import java.util.*; | ||
| 8 | |||
| 9 | public class QueryGraph { | ||
| 10 | |||
| 11 | Set<Variable> freeVars = new HashSet<Variable>(); | ||
| 12 | Set<Variable> existVars = new HashSet<Variable>(); | ||
| 13 | Set<Individual> constants = new HashSet<Individual>(); | ||
| 14 | |||
| 15 | MultiMap<Term, OWLClassExpression> concepts = new MultiMap<Term, OWLClassExpression>(); | ||
| 16 | MultiMap<Term, ObjectEdge> rollable_edges = new MultiMap<Term, ObjectEdge>(); | ||
| 17 | MultiMap<Term, ObjectEdge> edges = new MultiMap<Term, ObjectEdge>(); | ||
| 18 | OWLOntology ontology; | ||
| 19 | OWLDataFactory factory; | ||
| 20 | |||
| 21 | public QueryGraph(Atom[] bodyAtoms, String[] distinguishedVars, OWLOntology onto) { | ||
| 22 | for (String vName: distinguishedVars) | ||
| 23 | freeVars.add(Variable.create(vName)); | ||
| 24 | |||
| 25 | ontology = onto; | ||
| 26 | factory = onto.getOWLOntologyManager().getOWLDataFactory(); | ||
| 27 | |||
| 28 | for (Atom atom: bodyAtoms) { | ||
| 29 | if (atom.getArity() == 1) { | ||
| 30 | updateExistentiallyVariables(atom.getArgumentVariable(0)); | ||
| 31 | String id = ((AtomicConcept) atom.getDLPredicate()).getIRI(); | ||
| 32 | if (!id.equals(Namespace.PAGODA_ORIGINAL)) | ||
| 33 | concepts.add(atom.getArgument(0), factory.getOWLClass(IRI.create(id))); | ||
| 34 | } | ||
| 35 | else if (atom.getArity() == 2) { | ||
| 36 | updateExistentiallyVariables(atom.getArgumentVariable(0)); | ||
| 37 | updateExistentiallyVariables(atom.getArgumentVariable(1)); | ||
| 38 | if (atom.getArgument(0).equals(atom.getArgument(1)) && atom.getArgument(0) instanceof Variable) { | ||
| 39 | concepts.add(atom.getArgument(0), factory.getOWLObjectHasSelf(factory.getOWLObjectProperty(IRI.create(((AtomicRole) atom.getDLPredicate()).getIRI())))); | ||
| 40 | } | ||
| 41 | else createEdges(atom.getArgument(0), (AtomicRole) atom.getDLPredicate(), atom.getArgument(1)); | ||
| 42 | } | ||
| 43 | } | ||
| 44 | |||
| 45 | rollup(); | ||
| 46 | } | ||
| 47 | |||
| 48 | public void createEdges(Term u, AtomicRole r, Term v) { | ||
| 49 | if(ontology.containsDataPropertyInSignature(IRI.create(r.getIRI()))) { | ||
| 50 | // edges.add(u, new DataEdge(r, v)); | ||
| 51 | Constant c = (Constant) v; | ||
| 52 | OWLLiteral l = factory.getOWLLiteral(c.getLexicalForm(), c.getDatatypeURI()); | ||
| 53 | concepts.add(u, factory.getOWLDataHasValue(factory.getOWLDataProperty(IRI.create(r.getIRI())), l)); | ||
| 54 | } | ||
| 55 | else { | ||
| 56 | boolean rollable = existVars.contains(u) || existVars.contains(v); | ||
| 57 | |||
| 58 | ObjectEdge edge = new ObjectEdge(r, v, false); | ||
| 59 | if(rollable) { | ||
| 60 | rollable_edges.add(u, edge); | ||
| 61 | edge = new ObjectEdge(r, u, true); | ||
| 62 | rollable_edges.add(v, edge); | ||
| 63 | } | ||
| 64 | else edges.add(u, edge); | ||
| 65 | |||
| 66 | } | ||
| 67 | } | ||
| 68 | |||
| 69 | public Set<OWLAxiom> getPropertyAssertions(Map<Variable, Term> assignment) { | ||
| 70 | OWLIndividual sub, obj; | ||
| 71 | Set<OWLAxiom> axioms = new HashSet<OWLAxiom>(); | ||
| 72 | for(Map.Entry<Term, Set<ObjectEdge>> entry : edges.map.entrySet()) { | ||
| 73 | sub = factory.getOWLNamedIndividual(IRI.create(getIndividual(entry.getKey(), assignment).getIRI())); | ||
| 74 | for(ObjectEdge edge : entry.getValue()) { | ||
| 75 | Individual individual = getIndividual(edge.v, assignment); | ||
| 76 | String iri = individual.getIRI(); | ||
| 77 | obj = factory.getOWLNamedIndividual(IRI.create(iri)); | ||
| 78 | axioms.add(factory.getOWLObjectPropertyAssertionAxiom(edge.p, sub, obj)); | ||
| 79 | } | ||
| 80 | } | ||
| 81 | return axioms; | ||
| 82 | } | ||
| 83 | |||
| 84 | // public Set<OWLClassExpression> getExistentialConditions(Map<Variable, Term> assignment) { | ||
| 85 | // if(!rollable_edges.isEmpty()) return null; | ||
| 86 | // | ||
| 87 | // OWLIndividual sub; | ||
| 88 | // Visitor visitor = new Visitor(factory, assignment); | ||
| 89 | // Set<OWLClassExpression> axioms = new HashSet<>(); | ||
| 90 | // for(Map.Entry<Term, Set<OWLClassExpression>> entry : concepts.map.entrySet()) { | ||
| 91 | // // TODO check correctness!!! | ||
| 92 | // if(existVars.contains(entry.getKey())) { | ||
| 93 | // OWLClassExpression conjunction = | ||
| 94 | // factory.getOWLObjectIntersectionOf(factory.getOWLThing()); | ||
| 95 | // for(OWLClassExpression owlClassExpression : entry.getValue()) { | ||
| 96 | // conjunction = factory.getOWLObjectIntersectionOf(conjunction, owlClassExpression.accept(visitor)); | ||
| 97 | // } | ||
| 98 | // axioms.add(conjunction); | ||
| 99 | //// continue; // previously the "then" contained only this | ||
| 100 | // } | ||
| 101 | // } | ||
| 102 | // return axioms; | ||
| 103 | // } | ||
| 104 | |||
| 105 | public Set<OWLAxiom> getExistentialAxioms(Map<Variable, Term> assignment) { | ||
| 106 | if(!rollable_edges.isEmpty()) return null; | ||
| 107 | |||
| 108 | Visitor visitor = new Visitor(factory, assignment); | ||
| 109 | Set<OWLAxiom> axioms = new HashSet<>(); | ||
| 110 | for(Map.Entry<Term, Set<OWLClassExpression>> entry : concepts.map.entrySet()) { | ||
| 111 | if(existVars.contains(entry.getKey())) { | ||
| 112 | OWLClassExpression conjunction = factory.getOWLThing(); | ||
| 113 | for(OWLClassExpression owlClassExpression : entry.getValue()) { | ||
| 114 | conjunction = factory.getOWLObjectIntersectionOf(conjunction, owlClassExpression.accept(visitor)); | ||
| 115 | } | ||
| 116 | axioms.add(factory.getOWLSubClassOfAxiom(conjunction, factory.getOWLNothing())); | ||
| 117 | } | ||
| 118 | } | ||
| 119 | return axioms; | ||
| 120 | } | ||
| 121 | |||
| 122 | public Set<OWLAxiom> getAssertions(Map<Variable, Term> assignment) { | ||
| 123 | if(!rollable_edges.isEmpty()) return null; | ||
| 124 | |||
| 125 | OWLIndividual sub; | ||
| 126 | Visitor visitor = new Visitor(factory, assignment); | ||
| 127 | Set<OWLAxiom> axioms = getPropertyAssertions(assignment); | ||
| 128 | for(Map.Entry<Term, Set<OWLClassExpression>> entry : concepts.map.entrySet()) { | ||
| 129 | // TODO check correctness!!! | ||
| 130 | if(existVars.contains(entry.getKey())) { | ||
| 131 | // OWLClassExpression conjunction = | ||
| 132 | // factory.getOWLObjectIntersectionOf(factory.getOWLThing()); | ||
| 133 | // for(OWLClassExpression owlClassExpression : entry.getValue()) { | ||
| 134 | // conjunction = factory.getOWLObjectIntersectionOf(conjunction, owlClassExpression.accept(visitor)); | ||
| 135 | // } | ||
| 136 | // axioms.add(factory.getOWLSubClassOfAxiom(conjunction, factory.getOWLNothing())); | ||
| 137 | continue; // previously the "then" contained only this | ||
| 138 | } | ||
| 139 | else { | ||
| 140 | sub = factory.getOWLNamedIndividual(IRI.create(getIndividual(entry.getKey(), assignment).getIRI())); | ||
| 141 | for(OWLClassExpression clsExp : entry.getValue()) { | ||
| 142 | axioms.add(factory.getOWLClassAssertionAxiom(clsExp.accept(visitor), sub)); | ||
| 143 | } | ||
| 144 | } | ||
| 145 | } | ||
| 146 | return axioms; | ||
| 147 | } | ||
| 148 | |||
| 149 | private void updateExistentiallyVariables(Variable argumentVariable) { | ||
| 150 | if(freeVars.contains(argumentVariable)) return; | ||
| 151 | existVars.add(argumentVariable); | ||
| 152 | } | ||
| 153 | |||
| 154 | private void rollup() { | ||
| 155 | for (boolean updated = true; updated; ) { | ||
| 156 | updated = false; | ||
| 157 | |||
| 158 | Set<ObjectEdge> set; | ||
| 159 | for (Variable var: existVars) { | ||
| 160 | if ((set = rollable_edges.map.get(var)) != null && set.size() == 1) { | ||
| 161 | updated = true; | ||
| 162 | ObjectEdge edge = set.iterator().next(); | ||
| 163 | rollupEdge(edge.v, edge.p.getInverseProperty().getSimplified(), var, true); | ||
| 164 | set.clear(); | ||
| 165 | } | ||
| 166 | } | ||
| 167 | if(updated) continue; | ||
| 168 | |||
| 169 | for (Variable var: existVars) { | ||
| 170 | set = rollable_edges.map.get(var); | ||
| 171 | if(set == null) continue; | ||
| 172 | for (Iterator<ObjectEdge> iter = set.iterator(); iter.hasNext(); ) { | ||
| 173 | ObjectEdge edge = iter.next(); | ||
| 174 | if (constants.contains(edge.v) || freeVars.contains(edge.v)) { | ||
| 175 | updated = true; | ||
| 176 | rollupEdge(var, edge.p, edge.v, false); | ||
| 177 | iter.remove(); | ||
| 178 | } | ||
| 179 | } | ||
| 180 | } | ||
| 181 | } | ||
| 182 | |||
| 183 | } | ||
| 184 | |||
| 185 | private void rollupEdge(Term u, OWLObjectPropertyExpression op, Term v, boolean inverse) { | ||
| 186 | if (existVars.contains(v)) { | ||
| 187 | Set<OWLClassExpression> exps = concepts.get(v); | ||
| 188 | if (exps == null) exps = new HashSet<OWLClassExpression>(); | ||
| 189 | concepts.add(u, factory.getOWLObjectSomeValuesFrom(op, factory.getOWLObjectIntersectionOf(exps))); | ||
| 190 | } | ||
| 191 | else { | ||
| 192 | OWLIndividual obj = getOWLIndividual(v); | ||
| 193 | concepts.add(u, factory.getOWLObjectHasValue(op, obj)); | ||
| 194 | } | ||
| 195 | |||
| 196 | if(inverse) | ||
| 197 | removeRollableEdge(u, op, v); | ||
| 198 | else | ||
| 199 | removeRollableEdge(v, op.getInverseProperty().getSimplified(), u); | ||
| 200 | } | ||
| 201 | |||
| 202 | private void removeRollableEdge(Term u, OWLObjectPropertyExpression op, Term v) { | ||
| 203 | Set<ObjectEdge> set = rollable_edges.get(u); | ||
| 204 | ObjectEdge edge; | ||
| 205 | if (set != null) | ||
| 206 | for (Iterator<ObjectEdge> iter = set.iterator(); iter.hasNext(); ) { | ||
| 207 | edge = iter.next(); | ||
| 208 | if(edge.p.equals(op) && edge.v.equals(v)) iter.remove(); | ||
| 209 | } | ||
| 210 | } | ||
| 211 | |||
| 212 | OWLNamedIndividual getOWLIndividual(Term t) { | ||
| 213 | if (freeVars.contains(t)) | ||
| 214 | return new VariableIndividual((Variable) t); | ||
| 215 | else if (t instanceof Variable) | ||
| 216 | return null; | ||
| 217 | else | ||
| 218 | return factory.getOWLNamedIndividual(IRI.create(((Individual) t).getIRI())); | ||
| 219 | } | ||
| 220 | |||
| 221 | private Individual getIndividual(Term key, Map<Variable, Term> assignment) { | ||
| 222 | if(key instanceof Individual) | ||
| 223 | return (Individual) key; | ||
| 224 | else | ||
| 225 | return (Individual) assignment.get(key); | ||
| 226 | } | ||
| 227 | |||
| 228 | class ObjectEdge { | ||
| 229 | OWLObjectPropertyExpression p; | ||
| 230 | Term v; | ||
| 231 | |||
| 232 | public ObjectEdge(AtomicRole r, Term t, boolean inverse) { | ||
| 233 | p = factory.getOWLObjectProperty(IRI.create(r.getIRI())); | ||
| 234 | if(inverse) p = p.getInverseProperty(); | ||
| 235 | v = t; | ||
| 236 | |||
| 237 | } | ||
| 238 | } | ||
| 239 | |||
| 240 | class MultiMap<K, V> { | ||
| 241 | |||
| 242 | HashMap<K, Set<V>> map = new HashMap<K, Set<V>>(); | ||
| 243 | |||
| 244 | public Set<V> get(K v) { | ||
| 245 | return map.get(v); | ||
| 246 | } | ||
| 247 | |||
| 248 | public boolean isEmpty() { | ||
| 249 | for(Map.Entry<K, Set<V>> entry : map.entrySet()) | ||
| 250 | if(!entry.getValue().isEmpty()) | ||
| 251 | return false; | ||
| 252 | return true; | ||
| 253 | } | ||
| 254 | |||
| 255 | void add(K key, V value) { | ||
| 256 | Set<V> list = map.get(key); | ||
| 257 | if(list == null) | ||
| 258 | map.put(key, list = new HashSet<V>()); | ||
| 259 | list.add(value); | ||
| 260 | } | ||
| 261 | |||
| 262 | } | ||
| 263 | } | ||
| 264 | |||
| 265 | class Visitor implements OWLClassExpressionVisitorEx<OWLClassExpression> { | ||
| 266 | |||
| 267 | OWLDataFactory factory; | ||
| 268 | Map<Variable, Term> assignment; | ||
| 269 | |||
| 270 | public Visitor(OWLDataFactory factory, Map<Variable, Term> assignment) { | ||
| 271 | this.factory = factory; | ||
| 272 | this.assignment = assignment; | ||
| 273 | } | ||
| 274 | |||
| 275 | @Override | ||
| 276 | public OWLClassExpression visit(OWLClass ce) { | ||
| 277 | // TODO Auto-generated method stub | ||
| 278 | return ce; | ||
| 279 | } | ||
| 280 | |||
| 281 | @Override | ||
| 282 | public OWLClassExpression visit(OWLObjectIntersectionOf ce) { | ||
| 283 | Set<OWLClassExpression> clsExps = new HashSet<OWLClassExpression>(); | ||
| 284 | OWLClassExpression newExp; | ||
| 285 | boolean updated = false; | ||
| 286 | for (OWLClassExpression clsExp: ce.asConjunctSet()) { | ||
| 287 | clsExps.add(newExp = clsExp.accept(this)); | ||
| 288 | if (newExp != clsExp) updated = true; | ||
| 289 | } | ||
| 290 | |||
| 291 | if (updated) return factory.getOWLObjectIntersectionOf(clsExps); | ||
| 292 | else return ce; | ||
| 293 | } | ||
| 294 | |||
| 295 | @Override | ||
| 296 | public OWLClassExpression visit(OWLObjectUnionOf ce) { | ||
| 297 | // TODO Auto-generated method stub | ||
| 298 | return ce; | ||
| 299 | } | ||
| 300 | |||
| 301 | @Override | ||
| 302 | public OWLClassExpression visit(OWLObjectComplementOf ce) { | ||
| 303 | // TODO Auto-generated method stub | ||
| 304 | return ce; | ||
| 305 | } | ||
| 306 | |||
| 307 | @Override | ||
| 308 | public OWLClassExpression visit(OWLObjectSomeValuesFrom ce) { | ||
| 309 | OWLClassExpression newFiller = ce.getFiller().accept(this); | ||
| 310 | if (newFiller == ce.getFiller()) return ce; | ||
| 311 | return factory.getOWLObjectSomeValuesFrom(ce.getProperty(), newFiller); | ||
| 312 | } | ||
| 313 | |||
| 314 | @Override | ||
| 315 | public OWLClassExpression visit(OWLObjectAllValuesFrom ce) { | ||
| 316 | // TODO Auto-generated method stub | ||
| 317 | return ce; | ||
| 318 | } | ||
| 319 | |||
| 320 | @Override | ||
| 321 | public OWLClassExpression visit(OWLObjectHasValue ce) { | ||
| 322 | if (ce.getValue() instanceof VariableIndividual) { | ||
| 323 | Individual c = (Individual) assignment.get(((VariableIndividual) ce.getValue()).var); | ||
| 324 | OWLIndividual l = factory.getOWLNamedIndividual(IRI.create(c.getIRI())); | ||
| 325 | return factory.getOWLObjectHasValue(ce.getProperty(), l); | ||
| 326 | } | ||
| 327 | return ce; | ||
| 328 | } | ||
| 329 | |||
| 330 | @Override | ||
| 331 | public OWLClassExpression visit(OWLObjectMinCardinality ce) { | ||
| 332 | // TODO Auto-generated method stub | ||
| 333 | return ce; | ||
| 334 | } | ||
| 335 | |||
| 336 | @Override | ||
| 337 | public OWLClassExpression visit(OWLObjectExactCardinality ce) { | ||
| 338 | // TODO Auto-generated method stub | ||
| 339 | return ce; | ||
| 340 | } | ||
| 341 | |||
| 342 | @Override | ||
| 343 | public OWLClassExpression visit(OWLObjectMaxCardinality ce) { | ||
| 344 | // TODO Auto-generated method stub | ||
| 345 | return ce; | ||
| 346 | } | ||
| 347 | |||
| 348 | @Override | ||
| 349 | public OWLClassExpression visit(OWLObjectHasSelf ce) { | ||
| 350 | // TODO Auto-generated method stub | ||
| 351 | return ce; | ||
| 352 | } | ||
| 353 | |||
| 354 | @Override | ||
| 355 | public OWLClassExpression visit(OWLObjectOneOf ce) { | ||
| 356 | // TODO Auto-generated method stub | ||
| 357 | return ce; | ||
| 358 | } | ||
| 359 | |||
| 360 | @Override | ||
| 361 | public OWLClassExpression visit(OWLDataSomeValuesFrom ce) { | ||
| 362 | // TODO Auto-generated method stub | ||
| 363 | return ce; | ||
| 364 | } | ||
| 365 | |||
| 366 | @Override | ||
| 367 | public OWLClassExpression visit(OWLDataAllValuesFrom ce) { | ||
| 368 | // TODO Auto-generated method stub | ||
| 369 | return ce; | ||
| 370 | } | ||
| 371 | |||
| 372 | @Override | ||
| 373 | public OWLClassExpression visit(OWLDataHasValue ce) { | ||
| 374 | if (ce.getValue() instanceof VariableConstant) { | ||
| 375 | Constant c = (Constant) assignment.get(((VariableConstant) ce.getValue()).var); | ||
| 376 | OWLLiteral l = factory.getOWLLiteral(c.getLexicalForm(), c.getDatatypeURI()); | ||
| 377 | return factory.getOWLDataHasValue(ce.getProperty(), l); | ||
| 378 | } | ||
| 379 | return ce; | ||
| 380 | } | ||
| 381 | |||
| 382 | @Override | ||
| 383 | public OWLClassExpression visit(OWLDataMinCardinality ce) { | ||
| 384 | // TODO Auto-generated method stub | ||
| 385 | return ce; | ||
| 386 | } | ||
| 387 | |||
| 388 | @Override | ||
| 389 | public OWLClassExpression visit(OWLDataExactCardinality ce) { | ||
| 390 | // TODO Auto-generated method stub | ||
| 391 | return ce; | ||
| 392 | } | ||
| 393 | |||
| 394 | @Override | ||
| 395 | public OWLClassExpression visit(OWLDataMaxCardinality ce) { | ||
| 396 | // TODO Auto-generated method stub | ||
| 397 | return ce; | ||
| 398 | } | ||
| 399 | |||
| 400 | } \ No newline at end of file | ||
diff --git a/src/uk/ac/ox/cs/pagoda/query/rollup/VariableConstant.java b/src/uk/ac/ox/cs/pagoda/query/rollup/VariableConstant.java deleted file mode 100644 index b8035c5..0000000 --- a/src/uk/ac/ox/cs/pagoda/query/rollup/VariableConstant.java +++ /dev/null | |||
| @@ -1,221 +0,0 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.query.rollup; | ||
| 2 | |||
| 3 | import java.util.Set; | ||
| 4 | |||
| 5 | import org.semanticweb.HermiT.model.Variable; | ||
| 6 | import org.semanticweb.owlapi.model.OWLAnnotationValueVisitor; | ||
| 7 | import org.semanticweb.owlapi.model.OWLAnnotationValueVisitorEx; | ||
| 8 | import org.semanticweb.owlapi.model.OWLAnonymousIndividual; | ||
| 9 | import org.semanticweb.owlapi.model.OWLClass; | ||
| 10 | import org.semanticweb.owlapi.model.OWLClassExpression; | ||
| 11 | import org.semanticweb.owlapi.model.OWLDataProperty; | ||
| 12 | import org.semanticweb.owlapi.model.OWLDataVisitor; | ||
| 13 | import org.semanticweb.owlapi.model.OWLDataVisitorEx; | ||
| 14 | import org.semanticweb.owlapi.model.OWLDatatype; | ||
| 15 | import org.semanticweb.owlapi.model.OWLEntity; | ||
| 16 | import org.semanticweb.owlapi.model.OWLLiteral; | ||
| 17 | import org.semanticweb.owlapi.model.OWLNamedIndividual; | ||
| 18 | import org.semanticweb.owlapi.model.OWLObject; | ||
| 19 | import org.semanticweb.owlapi.model.OWLObjectProperty; | ||
| 20 | import org.semanticweb.owlapi.model.OWLObjectVisitor; | ||
| 21 | import org.semanticweb.owlapi.model.OWLObjectVisitorEx; | ||
| 22 | |||
| 23 | class VariableConstant implements OWLLiteral { | ||
| 24 | |||
| 25 | /** | ||
| 26 | * | ||
| 27 | */ | ||
| 28 | private static final long serialVersionUID = 5089014375729171030L; | ||
| 29 | Variable var; | ||
| 30 | |||
| 31 | public VariableConstant(Variable v) { | ||
| 32 | var = v; | ||
| 33 | } | ||
| 34 | |||
| 35 | @Override | ||
| 36 | public Set<OWLEntity> getSignature() { | ||
| 37 | // TODO Auto-generated method stub | ||
| 38 | return null; | ||
| 39 | } | ||
| 40 | |||
| 41 | @Override | ||
| 42 | public Set<OWLAnonymousIndividual> getAnonymousIndividuals() { | ||
| 43 | // TODO Auto-generated method stub | ||
| 44 | return null; | ||
| 45 | } | ||
| 46 | |||
| 47 | @Override | ||
| 48 | public Set<OWLClass> getClassesInSignature() { | ||
| 49 | // TODO Auto-generated method stub | ||
| 50 | return null; | ||
| 51 | } | ||
| 52 | |||
| 53 | @Override | ||
| 54 | public Set<OWLDataProperty> getDataPropertiesInSignature() { | ||
| 55 | // TODO Auto-generated method stub | ||
| 56 | return null; | ||
| 57 | } | ||
| 58 | |||
| 59 | @Override | ||
| 60 | public Set<OWLObjectProperty> getObjectPropertiesInSignature() { | ||
| 61 | // TODO Auto-generated method stub | ||
| 62 | return null; | ||
| 63 | } | ||
| 64 | |||
| 65 | @Override | ||
| 66 | public Set<OWLNamedIndividual> getIndividualsInSignature() { | ||
| 67 | // TODO Auto-generated method stub | ||
| 68 | return null; | ||
| 69 | } | ||
| 70 | |||
| 71 | @Override | ||
| 72 | public Set<OWLDatatype> getDatatypesInSignature() { | ||
| 73 | // TODO Auto-generated method stub | ||
| 74 | return null; | ||
| 75 | } | ||
| 76 | |||
| 77 | @Override | ||
| 78 | public Set<OWLClassExpression> getNestedClassExpressions() { | ||
| 79 | // TODO Auto-generated method stub | ||
| 80 | return null; | ||
| 81 | } | ||
| 82 | |||
| 83 | @Override | ||
| 84 | public void accept(OWLObjectVisitor visitor) { | ||
| 85 | // TODO Auto-generated method stub | ||
| 86 | |||
| 87 | } | ||
| 88 | |||
| 89 | @Override | ||
| 90 | public <O> O accept(OWLObjectVisitorEx<O> visitor) { | ||
| 91 | // TODO Auto-generated method stub | ||
| 92 | return null; | ||
| 93 | } | ||
| 94 | |||
| 95 | @Override | ||
| 96 | public boolean isTopEntity() { | ||
| 97 | // TODO Auto-generated method stub | ||
| 98 | return false; | ||
| 99 | } | ||
| 100 | |||
| 101 | @Override | ||
| 102 | public boolean isBottomEntity() { | ||
| 103 | // TODO Auto-generated method stub | ||
| 104 | return false; | ||
| 105 | } | ||
| 106 | |||
| 107 | @Override | ||
| 108 | public int compareTo(OWLObject arg0) { | ||
| 109 | // TODO Auto-generated method stub | ||
| 110 | return 0; | ||
| 111 | } | ||
| 112 | |||
| 113 | @Override | ||
| 114 | public void accept(OWLAnnotationValueVisitor visitor) { | ||
| 115 | // TODO Auto-generated method stub | ||
| 116 | |||
| 117 | } | ||
| 118 | |||
| 119 | @Override | ||
| 120 | public <O> O accept(OWLAnnotationValueVisitorEx<O> visitor) { | ||
| 121 | // TODO Auto-generated method stub | ||
| 122 | return null; | ||
| 123 | } | ||
| 124 | |||
| 125 | @Override | ||
| 126 | public boolean isRDFPlainLiteral() { | ||
| 127 | // TODO Auto-generated method stub | ||
| 128 | return false; | ||
| 129 | } | ||
| 130 | |||
| 131 | @Override | ||
| 132 | public String getLiteral() { | ||
| 133 | // TODO Auto-generated method stub | ||
| 134 | return null; | ||
| 135 | } | ||
| 136 | |||
| 137 | @Override | ||
| 138 | public OWLDatatype getDatatype() { | ||
| 139 | // TODO Auto-generated method stub | ||
| 140 | return null; | ||
| 141 | } | ||
| 142 | |||
| 143 | @Override | ||
| 144 | public boolean hasLang() { | ||
| 145 | // TODO Auto-generated method stub | ||
| 146 | return false; | ||
| 147 | } | ||
| 148 | |||
| 149 | @Override | ||
| 150 | public String getLang() { | ||
| 151 | // TODO Auto-generated method stub | ||
| 152 | return null; | ||
| 153 | } | ||
| 154 | |||
| 155 | @Override | ||
| 156 | public boolean hasLang(String lang) { | ||
| 157 | // TODO Auto-generated method stub | ||
| 158 | return false; | ||
| 159 | } | ||
| 160 | |||
| 161 | @Override | ||
| 162 | public boolean isInteger() { | ||
| 163 | // TODO Auto-generated method stub | ||
| 164 | return false; | ||
| 165 | } | ||
| 166 | |||
| 167 | @Override | ||
| 168 | public int parseInteger() throws NumberFormatException { | ||
| 169 | // TODO Auto-generated method stub | ||
| 170 | return 0; | ||
| 171 | } | ||
| 172 | |||
| 173 | @Override | ||
| 174 | public boolean isBoolean() { | ||
| 175 | // TODO Auto-generated method stub | ||
| 176 | return false; | ||
| 177 | } | ||
| 178 | |||
| 179 | @Override | ||
| 180 | public boolean parseBoolean() throws NumberFormatException { | ||
| 181 | // TODO Auto-generated method stub | ||
| 182 | return false; | ||
| 183 | } | ||
| 184 | |||
| 185 | @Override | ||
| 186 | public boolean isDouble() { | ||
| 187 | // TODO Auto-generated method stub | ||
| 188 | return false; | ||
| 189 | } | ||
| 190 | |||
| 191 | @Override | ||
| 192 | public double parseDouble() throws NumberFormatException { | ||
| 193 | // TODO Auto-generated method stub | ||
| 194 | return 0; | ||
| 195 | } | ||
| 196 | |||
| 197 | @Override | ||
| 198 | public boolean isFloat() { | ||
| 199 | // TODO Auto-generated method stub | ||
| 200 | return false; | ||
| 201 | } | ||
| 202 | |||
| 203 | @Override | ||
| 204 | public float parseFloat() throws NumberFormatException { | ||
| 205 | // TODO Auto-generated method stub | ||
| 206 | return 0; | ||
| 207 | } | ||
| 208 | |||
| 209 | @Override | ||
| 210 | public void accept(OWLDataVisitor visitor) { | ||
| 211 | // TODO Auto-generated method stub | ||
| 212 | |||
| 213 | } | ||
| 214 | |||
| 215 | @Override | ||
| 216 | public <O> O accept(OWLDataVisitorEx<O> visitor) { | ||
| 217 | // TODO Auto-generated method stub | ||
| 218 | return null; | ||
| 219 | } | ||
| 220 | |||
| 221 | } | ||
diff --git a/src/uk/ac/ox/cs/pagoda/query/rollup/VariableIndividual.java b/src/uk/ac/ox/cs/pagoda/query/rollup/VariableIndividual.java deleted file mode 100644 index 1c924b2..0000000 --- a/src/uk/ac/ox/cs/pagoda/query/rollup/VariableIndividual.java +++ /dev/null | |||
| @@ -1,410 +0,0 @@ | |||
| 1 | package uk.ac.ox.cs.pagoda.query.rollup; | ||
| 2 | |||
| 3 | import java.util.Map; | ||
| 4 | import java.util.Set; | ||
| 5 | |||
| 6 | import org.semanticweb.HermiT.model.Variable; | ||
| 7 | import org.semanticweb.owlapi.model.EntityType; | ||
| 8 | import org.semanticweb.owlapi.model.IRI; | ||
| 9 | import org.semanticweb.owlapi.model.OWLAnnotation; | ||
| 10 | import org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom; | ||
| 11 | import org.semanticweb.owlapi.model.OWLAnnotationProperty; | ||
| 12 | import org.semanticweb.owlapi.model.OWLAnonymousIndividual; | ||
| 13 | import org.semanticweb.owlapi.model.OWLAxiom; | ||
| 14 | import org.semanticweb.owlapi.model.OWLClass; | ||
| 15 | import org.semanticweb.owlapi.model.OWLClassExpression; | ||
| 16 | import org.semanticweb.owlapi.model.OWLDataProperty; | ||
| 17 | import org.semanticweb.owlapi.model.OWLDataPropertyExpression; | ||
| 18 | import org.semanticweb.owlapi.model.OWLDatatype; | ||
| 19 | import org.semanticweb.owlapi.model.OWLEntity; | ||
| 20 | import org.semanticweb.owlapi.model.OWLEntityVisitor; | ||
| 21 | import org.semanticweb.owlapi.model.OWLEntityVisitorEx; | ||
| 22 | import org.semanticweb.owlapi.model.OWLIndividual; | ||
| 23 | import org.semanticweb.owlapi.model.OWLIndividualVisitor; | ||
| 24 | import org.semanticweb.owlapi.model.OWLIndividualVisitorEx; | ||
| 25 | import org.semanticweb.owlapi.model.OWLLiteral; | ||
| 26 | import org.semanticweb.owlapi.model.OWLNamedIndividual; | ||
| 27 | import org.semanticweb.owlapi.model.OWLNamedObjectVisitor; | ||
| 28 | import org.semanticweb.owlapi.model.OWLObject; | ||
| 29 | import org.semanticweb.owlapi.model.OWLObjectProperty; | ||
| 30 | import org.semanticweb.owlapi.model.OWLObjectPropertyExpression; | ||
| 31 | import org.semanticweb.owlapi.model.OWLObjectVisitor; | ||
| 32 | import org.semanticweb.owlapi.model.OWLObjectVisitorEx; | ||
| 33 | import org.semanticweb.owlapi.model.OWLOntology; | ||
| 34 | |||
| 35 | class VariableIndividual implements OWLNamedIndividual { | ||
| 36 | |||
| 37 | /** | ||
| 38 | * | ||
| 39 | */ | ||
| 40 | private static final long serialVersionUID = 3002966246639516395L; | ||
| 41 | Variable var; | ||
| 42 | |||
| 43 | public VariableIndividual(Variable v) { | ||
| 44 | var = v; | ||
| 45 | } | ||
| 46 | |||
| 47 | @Override | ||
| 48 | public boolean isNamed() { | ||
| 49 | // TODO Auto-generated method stub | ||
| 50 | return false; | ||
| 51 | } | ||
| 52 | |||
| 53 | @Override | ||
| 54 | public boolean isAnonymous() { | ||
| 55 | // TODO Auto-generated method stub | ||
| 56 | return false; | ||
| 57 | } | ||
| 58 | |||
| 59 | @Override | ||
| 60 | public OWLNamedIndividual asOWLNamedIndividual() { | ||
| 61 | // TODO Auto-generated method stub | ||
| 62 | return null; | ||
| 63 | } | ||
| 64 | |||
| 65 | @Override | ||
| 66 | public OWLAnonymousIndividual asOWLAnonymousIndividual() { | ||
| 67 | // TODO Auto-generated method stub | ||
| 68 | return null; | ||
| 69 | } | ||
| 70 | |||
| 71 | @Override | ||
| 72 | public Set<OWLClassExpression> getTypes(OWLOntology ontology) { | ||
| 73 | // TODO Auto-generated method stub | ||
| 74 | return null; | ||
| 75 | } | ||
| 76 | |||
| 77 | @Override | ||
| 78 | public Set<OWLClassExpression> getTypes(Set<OWLOntology> ontologies) { | ||
| 79 | // TODO Auto-generated method stub | ||
| 80 | return null; | ||
| 81 | } | ||
| 82 | |||
| 83 | @Override | ||
| 84 | public Map<OWLObjectPropertyExpression, Set<OWLIndividual>> getObjectPropertyValues( | ||
| 85 | OWLOntology ontology) { | ||
| 86 | // TODO Auto-generated method stub | ||
| 87 | return null; | ||
| 88 | } | ||
| 89 | |||
| 90 | @Override | ||
| 91 | public Set<OWLIndividual> getObjectPropertyValues( | ||
| 92 | OWLObjectPropertyExpression property, OWLOntology ontology) { | ||
| 93 | // TODO Auto-generated method stub | ||
| 94 | return null; | ||
| 95 | } | ||
| 96 | |||
| 97 | @Override | ||
| 98 | public boolean hasObjectPropertyValue(OWLObjectPropertyExpression property, | ||
| 99 | OWLIndividual individual, OWLOntology ontology) { | ||
| 100 | // TODO Auto-generated method stub | ||
| 101 | return false; | ||
| 102 | } | ||
| 103 | |||
| 104 | @Override | ||
| 105 | public boolean hasDataPropertyValue(OWLDataPropertyExpression property, | ||
| 106 | OWLLiteral value, OWLOntology ontology) { | ||
| 107 | // TODO Auto-generated method stub | ||
| 108 | return false; | ||
| 109 | } | ||
| 110 | |||
| 111 | @Override | ||
| 112 | public boolean hasNegativeObjectPropertyValue( | ||
| 113 | OWLObjectPropertyExpression property, OWLIndividual individual, | ||
| 114 | OWLOntology ontology) { | ||
| 115 | // TODO Auto-generated method stub | ||
| 116 | return false; | ||
| 117 | } | ||
| 118 | |||
| 119 | @Override | ||
| 120 | public Map<OWLObjectPropertyExpression, Set<OWLIndividual>> getNegativeObjectPropertyValues( | ||
| 121 | OWLOntology ontology) { | ||
| 122 | // TODO Auto-generated method stub | ||
| 123 | return null; | ||
| 124 | } | ||
| 125 | |||
| 126 | @Override | ||
| 127 | public Map<OWLDataPropertyExpression, Set<OWLLiteral>> getDataPropertyValues( | ||
| 128 | OWLOntology ontology) { | ||
| 129 | // TODO Auto-generated method stub | ||
| 130 | return null; | ||
| 131 | } | ||
| 132 | |||
| 133 | @Override | ||
| 134 | public Set<OWLLiteral> getDataPropertyValues( | ||
| 135 | OWLDataPropertyExpression property, OWLOntology ontology) { | ||
| 136 | // TODO Auto-generated method stub | ||
| 137 | return null; | ||
| 138 | } | ||
| 139 | |||
| 140 | @Override | ||
| 141 | public Map<OWLDataPropertyExpression, Set<OWLLiteral>> getNegativeDataPropertyValues( | ||
| 142 | OWLOntology ontology) { | ||
| 143 | // TODO Auto-generated method stub | ||
| 144 | return null; | ||
| 145 | } | ||
| 146 | |||
| 147 | @Override | ||
| 148 | public boolean hasNegativeDataPropertyValue( | ||
| 149 | OWLDataPropertyExpression property, OWLLiteral literal, | ||
| 150 | OWLOntology ontology) { | ||
| 151 | // TODO Auto-generated method stub | ||
| 152 | return false; | ||
| 153 | } | ||
| 154 | |||
| 155 | @Override | ||
| 156 | public Set<OWLIndividual> getSameIndividuals(OWLOntology ontology) { | ||
| 157 | // TODO Auto-generated method stub | ||
| 158 | return null; | ||
| 159 | } | ||
| 160 | |||
| 161 | @Override | ||
| 162 | public Set<OWLIndividual> getDifferentIndividuals(OWLOntology ontology) { | ||
| 163 | // TODO Auto-generated method stub | ||
| 164 | return null; | ||
| 165 | } | ||
| 166 | |||
| 167 | @Override | ||
| 168 | public String toStringID() { | ||
| 169 | // TODO Auto-generated method stub | ||
| 170 | return null; | ||
| 171 | } | ||
| 172 | |||
| 173 | @Override | ||
| 174 | public void accept(OWLIndividualVisitor visitor) { | ||
| 175 | // TODO Auto-generated method stub | ||
| 176 | |||
| 177 | } | ||
| 178 | |||
| 179 | @Override | ||
| 180 | public <O> O accept(OWLIndividualVisitorEx<O> visitor) { | ||
| 181 | // TODO Auto-generated method stub | ||
| 182 | return null; | ||
| 183 | } | ||
| 184 | |||
| 185 | @Override | ||
| 186 | public Set<OWLEntity> getSignature() { | ||
| 187 | // TODO Auto-generated method stub | ||
| 188 | return null; | ||
| 189 | } | ||
| 190 | |||
| 191 | @Override | ||
| 192 | public Set<OWLAnonymousIndividual> getAnonymousIndividuals() { | ||
| 193 | // TODO Auto-generated method stub | ||
| 194 | return null; | ||
| 195 | } | ||
| 196 | |||
| 197 | @Override | ||
| 198 | public Set<OWLClass> getClassesInSignature() { | ||
| 199 | // TODO Auto-generated method stub | ||
| 200 | return null; | ||
| 201 | } | ||
| 202 | |||
| 203 | @Override | ||
| 204 | public Set<OWLDataProperty> getDataPropertiesInSignature() { | ||
| 205 | // TODO Auto-generated method stub | ||
| 206 | return null; | ||
| 207 | } | ||
| 208 | |||
| 209 | @Override | ||
| 210 | public Set<OWLObjectProperty> getObjectPropertiesInSignature() { | ||
| 211 | // TODO Auto-generated method stub | ||
| 212 | return null; | ||
| 213 | } | ||
| 214 | |||
| 215 | @Override | ||
| 216 | public Set<OWLNamedIndividual> getIndividualsInSignature() { | ||
| 217 | // TODO Auto-generated method stub | ||
| 218 | return null; | ||
| 219 | } | ||
| 220 | |||
| 221 | @Override | ||
| 222 | public Set<OWLDatatype> getDatatypesInSignature() { | ||
| 223 | // TODO Auto-generated method stub | ||
| 224 | return null; | ||
| 225 | } | ||
| 226 | |||
| 227 | @Override | ||
| 228 | public Set<OWLClassExpression> getNestedClassExpressions() { | ||
| 229 | // TODO Auto-generated method stub | ||
| 230 | return null; | ||
| 231 | } | ||
| 232 | |||
| 233 | @Override | ||
| 234 | public void accept(OWLObjectVisitor visitor) { | ||
| 235 | // TODO Auto-generated method stub | ||
| 236 | |||
| 237 | } | ||
| 238 | |||
| 239 | @Override | ||
| 240 | public <O> O accept(OWLObjectVisitorEx<O> visitor) { | ||
| 241 | // TODO Auto-generated method stub | ||
| 242 | return null; | ||
| 243 | } | ||
| 244 | |||
| 245 | @Override | ||
| 246 | public boolean isTopEntity() { | ||
| 247 | // TODO Auto-generated method stub | ||
| 248 | return false; | ||
| 249 | } | ||
| 250 | |||
| 251 | @Override | ||
| 252 | public boolean isBottomEntity() { | ||
| 253 | // TODO Auto-generated method stub | ||
| 254 | return false; | ||
| 255 | } | ||
| 256 | |||
| 257 | @Override | ||
| 258 | public int compareTo(OWLObject arg0) { | ||
| 259 | // TODO Auto-generated method stub | ||
| 260 | return 0; | ||
| 261 | } | ||
| 262 | |||
| 263 | @Override | ||
| 264 | public EntityType<?> getEntityType() { | ||
| 265 | // TODO Auto-generated method stub | ||
| 266 | return null; | ||
| 267 | } | ||
| 268 | |||
| 269 | @Override | ||
| 270 | public <E extends OWLEntity> E getOWLEntity(EntityType<E> entityType) { | ||
| 271 | // TODO Auto-generated method stub | ||
| 272 | return null; | ||
| 273 | } | ||
| 274 | |||
| 275 | @Override | ||
| 276 | public boolean isType(EntityType<?> entityType) { | ||
| 277 | // TODO Auto-generated method stub | ||
| 278 | return false; | ||
| 279 | } | ||
| 280 | |||
| 281 | @Override | ||
| 282 | public Set<OWLAnnotation> getAnnotations(OWLOntology ontology) { | ||
| 283 | // TODO Auto-generated method stub | ||
| 284 | return null; | ||
| 285 | } | ||
| 286 | |||
| 287 | @Override | ||
| 288 | public Set<OWLAnnotation> getAnnotations(OWLOntology ontology, | ||
| 289 | OWLAnnotationProperty annotationProperty) { | ||
| 290 | // TODO Auto-generated method stub | ||
| 291 | return null; | ||
| 292 | } | ||
| 293 | |||
| 294 | @Override | ||
| 295 | public Set<OWLAnnotationAssertionAxiom> getAnnotationAssertionAxioms( | ||
| 296 | OWLOntology ontology) { | ||
| 297 | // TODO Auto-generated method stub | ||
| 298 | return null; | ||
| 299 | } | ||
| 300 | |||
| 301 | @Override | ||
| 302 | public boolean isBuiltIn() { | ||
| 303 | // TODO Auto-generated method stub | ||
| 304 | return false; | ||
| 305 | } | ||
| 306 | |||
| 307 | @Override | ||
| 308 | public boolean isOWLClass() { | ||
| 309 | // TODO Auto-generated method stub | ||
| 310 | return false; | ||
| 311 | } | ||
| 312 | |||
| 313 | @Override | ||
| 314 | public OWLClass asOWLClass() { | ||
| 315 | // TODO Auto-generated method stub | ||
| 316 | return null; | ||
| 317 | } | ||
| 318 | |||
| 319 | @Override | ||
| 320 | public boolean isOWLObjectProperty() { | ||
| 321 | // TODO Auto-generated method stub | ||
| 322 | return false; | ||
| 323 | } | ||
| 324 | |||
| 325 | @Override | ||
| 326 | public OWLObjectProperty asOWLObjectProperty() { | ||
| 327 | // TODO Auto-generated method stub | ||
| 328 | return null; | ||
| 329 | } | ||
| 330 | |||
| 331 | @Override | ||
| 332 | public boolean isOWLDataProperty() { | ||
| 333 | // TODO Auto-generated method stub | ||
| 334 | return false; | ||
| 335 | } | ||
| 336 | |||
| 337 | @Override | ||
| 338 | public OWLDataProperty asOWLDataProperty() { | ||
| 339 | // TODO Auto-generated method stub | ||
| 340 | return null; | ||
| 341 | } | ||
| 342 | |||
| 343 | @Override | ||
| 344 | public boolean isOWLNamedIndividual() { | ||
| 345 | // TODO Auto-generated method stub | ||
| 346 | return false; | ||
| 347 | } | ||
| 348 | |||
| 349 | @Override | ||
| 350 | public boolean isOWLDatatype() { | ||
| 351 | // TODO Auto-generated method stub | ||
| 352 | return false; | ||
| 353 | } | ||
| 354 | |||
| 355 | @Override | ||
| 356 | public OWLDatatype asOWLDatatype() { | ||
| 357 | // TODO Auto-generated method stub | ||
| 358 | return null; | ||
| 359 | } | ||
| 360 | |||
| 361 | @Override | ||
| 362 | public boolean isOWLAnnotationProperty() { | ||
| 363 | // TODO Auto-generated method stub | ||
| 364 | return false; | ||
| 365 | } | ||
| 366 | |||
| 367 | @Override | ||
| 368 | public OWLAnnotationProperty asOWLAnnotationProperty() { | ||
| 369 | // TODO Auto-generated method stub | ||
| 370 | return null; | ||
| 371 | } | ||
| 372 | |||
| 373 | @Override | ||
| 374 | public Set<OWLAxiom> getReferencingAxioms(OWLOntology ontology) { | ||
| 375 | // TODO Auto-generated method stub | ||
| 376 | return null; | ||
| 377 | } | ||
| 378 | |||
| 379 | @Override | ||
| 380 | public Set<OWLAxiom> getReferencingAxioms(OWLOntology ontology, | ||
| 381 | boolean includeImports) { | ||
| 382 | // TODO Auto-generated method stub | ||
| 383 | return null; | ||
| 384 | } | ||
| 385 | |||
| 386 | @Override | ||
| 387 | public void accept(OWLEntityVisitor visitor) { | ||
| 388 | // TODO Auto-generated method stub | ||
| 389 | |||
| 390 | } | ||
| 391 | |||
| 392 | @Override | ||
| 393 | public <O> O accept(OWLEntityVisitorEx<O> visitor) { | ||
| 394 | // TODO Auto-generated method stub | ||
| 395 | return null; | ||
| 396 | } | ||
| 397 | |||
| 398 | @Override | ||
| 399 | public IRI getIRI() { | ||
| 400 | // TODO Auto-generated method stub | ||
| 401 | return null; | ||
| 402 | } | ||
| 403 | |||
| 404 | @Override | ||
| 405 | public void accept(OWLNamedObjectVisitor visitor) { | ||
| 406 | // TODO Auto-generated method stub | ||
| 407 | |||
| 408 | } | ||
| 409 | |||
| 410 | } | ||
