blob: ee23def46bd31fb5155ef992d29bc37a52faa09a (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
package uk.ac.ox.cs.pagoda.approx;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;
import org.semanticweb.HermiT.model.DLClause;
import org.semanticweb.owlapi.model.OWLDataFactory;
import org.semanticweb.owlapi.model.OWLDataProperty;
import org.semanticweb.owlapi.model.OWLOntology;
public class Clausifier {
OWLDataFactory factory;
Set<String> dataProperties = new HashSet<String>();
private Clausifier(OWLOntology ontology) {
factory = ontology.getOWLOntologyManager().getOWLDataFactory();
for (OWLDataProperty dataProperty: ontology.getDataPropertiesInSignature(true))
dataProperties.add(dataProperty.toStringID());
}
public Clause clasuify(DLClause clause) {
return new Clause(this, clause);
}
private static HashMap<OWLOntology, Clausifier> AllInstances = new HashMap<OWLOntology, Clausifier>();
public static Clausifier getInstance(OWLOntology onto) {
Clausifier c = AllInstances.get(onto);
if (c != null) return c;
c = new Clausifier(onto);
AllInstances.put(onto, c);
return c;
}
}
|