本文整理汇总了Java中org.semanticweb.owlapi.reasoner.ReasonerInterruptedException类的典型用法代码示例。如果您正苦于以下问题:Java ReasonerInterruptedException类的具体用法?Java ReasonerInterruptedException怎么用?Java ReasonerInterruptedException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ReasonerInterruptedException类属于org.semanticweb.owlapi.reasoner包,在下文中一共展示了ReasonerInterruptedException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTypes
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
public NodeSet<OWLClass> getTypes(OWLNamedIndividual ind, boolean direct) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
ensurePrepared();
DefaultNodeSet<OWLClass> result = new OWLClassNodeSet();
for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
for (OWLClassAssertionAxiom axiom : ontology.getClassAssertionAxioms(ind)) {
OWLClassExpression ce = axiom.getClassExpression();
if (!ce.isAnonymous()) {
result.addNode(classHierarchyInfo.getEquivalents(ce.asOWLClass()));
if (!direct) {
result.addAllNodes(getSuperClasses(ce, false).getNodes());
}
}
}
}
return result;
}
示例2: getInstances
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
public NodeSet<OWLNamedIndividual> getInstances(OWLClassExpression ce,
boolean direct) throws InconsistentOntologyException,
ClassExpressionNotInProfileException, FreshEntitiesException,
ReasonerInterruptedException, TimeOutException {
DefaultNodeSet<OWLNamedIndividual> result = new OWLNamedIndividualNodeSet();
Set<OWLObject> subs = gw.queryDescendants(ce, true, true);
for (OWLObject s : subs) {
if (s instanceof OWLNamedIndividual) {
result.addEntity((OWLNamedIndividual) s);
}
else {
}
}
return result;
}
示例3: getDisjointDataProperties
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
@Override
public NodeSet<OWLDataProperty> getDisjointDataProperties(
OWLDataPropertyExpression arg0)
throws InconsistentOntologyException, FreshEntitiesException,
ReasonerInterruptedException, TimeOutException {
LOGGER_.trace("getDisjointDataProperties(OWLDataPropertyExpression)");
checkInterrupted();
// TODO Provide implementation
throw unsupportedOwlApiMethod(
"getDisjointDataProperties(OWLDataPropertyExpression)");
}
示例4: OwlApiClassExpressionSubClassesQueryTest
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
public OwlApiClassExpressionSubClassesQueryTest(
final QueryTestManifest<OWLClassExpression, RelatedEntitiesTestOutput<OWLClass>> manifest) {
super(manifest,
new OwlApiReasoningTestDelegate<RelatedEntitiesTestOutput<OWLClass>>(
manifest) {
@Override
public RelatedEntitiesTestOutput<OWLClass> getActualOutput()
throws Exception {
final NodeSet<OWLClass> subNodes = getReasoner()
.getSubClasses(manifest.getInput().getQuery(),
true);
return new OwlApiRelatedEntitiesTestOutput<OWLClass>(
subNodes);
}
@Override
public Class<? extends Exception> getInterruptionExceptionClass() {
return ReasonerInterruptedException.class;
}
});
}
示例5: OwlApiClassExpressionSuperClassesQueryTest
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
public OwlApiClassExpressionSuperClassesQueryTest(
final QueryTestManifest<OWLClassExpression, RelatedEntitiesTestOutput<OWLClass>> manifest) {
super(manifest,
new OwlApiReasoningTestDelegate<RelatedEntitiesTestOutput<OWLClass>>(
manifest) {
@Override
public RelatedEntitiesTestOutput<OWLClass> getActualOutput()
throws Exception {
final NodeSet<OWLClass> superNodes = getReasoner()
.getSuperClasses(manifest.getInput().getQuery(),
true);
return new OwlApiRelatedEntitiesTestOutput<OWLClass>(
superNodes);
}
@Override
public Class<? extends Exception> getInterruptionExceptionClass() {
return ReasonerInterruptedException.class;
}
});
}
示例6: OwlApiClassExpressionInstancesQueryTest
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
public OwlApiClassExpressionInstancesQueryTest(
final QueryTestManifest<OWLClassExpression, RelatedEntitiesTestOutput<OWLNamedIndividual>> manifest) {
super(manifest,
new OwlApiReasoningTestDelegate<RelatedEntitiesTestOutput<OWLNamedIndividual>>(
manifest) {
@Override
public RelatedEntitiesTestOutput<OWLNamedIndividual> getActualOutput()
throws Exception {
final NodeSet<OWLNamedIndividual> subNodes = getReasoner()
.getInstances(manifest.getInput().getQuery(),
true);
return new OwlApiRelatedEntitiesTestOutput<OWLNamedIndividual>(
subNodes);
}
@Override
public Class<? extends Exception> getInterruptionExceptionClass() {
return ReasonerInterruptedException.class;
}
});
}
示例7: OwlApiIncrementalEntailmentQueryTest
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
public OwlApiIncrementalEntailmentQueryTest(
final TestManifest<QueryTestInput<OWLAxiom>> manifest) {
super(manifest,
new OwlApiIncrementalReasoningTestDelegate<Boolean>(manifest) {
@Override
public Boolean getExpectedOutput() throws Exception {
return getStandardReasoner()
.isEntailed(manifest.getInput().getQuery());
}
@Override
public Boolean getActualOutput() throws Exception {
return getIncrementalReasoner()
.isEntailed(manifest.getInput().getQuery());
}
@Override
public Class<? extends Exception> getInterruptionExceptionClass() {
return ReasonerInterruptedException.class;
}
});
}
示例8: OwlApiEntailmentQueryTest
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
public OwlApiEntailmentQueryTest(
final QueryTestManifest<OWLAxiom, Boolean> manifest) {
super(manifest, new OwlApiReasoningTestDelegate<Boolean>(manifest) {
@Override
public Boolean getActualOutput() throws Exception {
return getReasoner().isEntailed(manifest.getInput().getQuery());
}
@Override
public Class<? extends Exception> getInterruptionExceptionClass() {
return ReasonerInterruptedException.class;
}
});
}
示例9: findAncestors
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
protected Set<OWLClass> findAncestors(String expr,
OWLObjectProperty p, boolean direct, Integer numExpected) throws TimeOutException, FreshEntitiesException, InconsistentOntologyException, ClassExpressionNotInProfileException, ReasonerInterruptedException, OWLParserException {
System.out.println("Query: "+expr+" "+p+" Direct="+direct);
OWLClassExpression qc = parseOMN(expr);
System.out.println("QueryC: "+qc);
//Set<OWLClassExpression> ces = reasoner.getSuperClassExpressions(qc, false);
//System.out.println("NumX:"+ces.size());
Set<OWLClass> clzs = reasoner.getSuperClassesOver(qc, p, direct);
System.out.println("NumD:"+clzs.size());
for (OWLClass c : clzs) {
System.out.println(" D:"+c);
}
if (numExpected != null) {
assertEquals(numExpected.intValue(), clzs.size());
}
return clzs;
}
示例10: findDescendants
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
protected Set<OWLClass> findDescendants(OWLReasoner r, String expr, Integer numExpected) throws TimeOutException, FreshEntitiesException, InconsistentOntologyException, ClassExpressionNotInProfileException, ReasonerInterruptedException, OWLParserException {
System.out.println("Query: "+expr);
OWLClassExpression qc = parseOMN(expr);
Set<OWLClass> clzs = r.getSubClasses(qc, false).getFlattened();
clzs.remove(r.getRootOntology().getOWLOntologyManager().getOWLDataFactory().getOWLNothing());
if (!qc.isAnonymous())
clzs.add((OWLClass) qc);
System.out.println("NumD:"+clzs.size());
for (OWLClass c : clzs) {
System.out.println(" D:"+c);
}
if (numExpected != null) {
assertEquals(numExpected.intValue(), clzs.size());
}
return clzs;
}
示例11: getSuperClassExpressions
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
/**
* note that this is not a standard reasoner method
*
* @param ce
* @param direct
* @return all superclasses, where superclasses can include anon class expressions
* @throws InconsistentOntologyException
* @throws ClassExpressionNotInProfileException
* @throws FreshEntitiesException
* @throws ReasonerInterruptedException
* @throws TimeOutException
*/
public Set<OWLClassExpression> getSuperClassExpressions(OWLClassExpression ce,
boolean direct) throws InconsistentOntologyException,
ClassExpressionNotInProfileException, FreshEntitiesException,
ReasonerInterruptedException, TimeOutException {
Set<OWLClassExpression> result = new HashSet<OWLClassExpression>();
Set<OWLObject> supers = gw.getSubsumersFromClosure(ce);
for (OWLObject sup : supers) {
if (sup instanceof OWLClassExpression) {
result.add((OWLClassExpression) sup);
}
else {
}
}
return result;
}
示例12: getSuperClasses
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
public NodeSet<OWLClass> getSuperClasses(OWLClassExpression ce,
boolean direct) throws InconsistentOntologyException,
ClassExpressionNotInProfileException, FreshEntitiesException,
ReasonerInterruptedException, TimeOutException {
DefaultNodeSet<OWLClass> result = new OWLClassNodeSet();
Set<OWLObject> supers = gw.getSubsumersFromClosure(ce);
for (OWLObject sup : supers) {
if (sup instanceof OWLClassExpression) {
if (sup instanceof OWLClass) {
result.addEntity((OWLClass) sup);
}
else {
}
}
else {
}
}
return result;
}
示例13: prepareReasoner
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
/**
* @throws ReasonerInterruptedException on interruption
* @throws TimeOutException on timeout
*/
public void prepareReasoner() throws ReasonerInterruptedException, TimeOutException {
classHierarchyInfo.computeHierarchy();
objectPropertyHierarchyInfo.computeHierarchy();
dataPropertyHierarchyInfo.computeHierarchy();
prepared = true;
}
示例14: getObjectPropertyValues
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
@Override
public NodeSet<OWLNamedIndividual> getObjectPropertyValues(OWLNamedIndividual individual,
OWLObjectPropertyExpression objectPropertyExpression) throws InconsistentOntologyException,
FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
Objects.requireNonNull(individual);
Objects.requireNonNull(objectPropertyExpression);
logger.finer("getObjectPropertyValues(" + individual + ", " + objectPropertyExpression + ")");
throw new UnsupportedReasonerOperationInBornException(
"Unsupported operation : getObjectPropertyValues(OWLNamedIndividual)");
}
示例15: getDisjointClasses
import org.semanticweb.owlapi.reasoner.ReasonerInterruptedException; //导入依赖的package包/类
@Override
public NodeSet<OWLClass> getDisjointClasses(OWLClassExpression classExpression) throws ReasonerInterruptedException,
TimeOutException, FreshEntitiesException, InconsistentOntologyException {
Objects.requireNonNull(classExpression);
logger.finer("getDisjointClasses(" + classExpression + ")");
throw new UnsupportedReasonerOperationInBornException(
"Unsupported operation : getDisjointClasses(OWLClassExpression)");
}