当前位置: 首页>>代码示例>>Java>>正文


Java OWLReasonerException类代码示例

本文整理汇总了Java中org.semanticweb.owl.inference.OWLReasonerException的典型用法代码示例。如果您正苦于以下问题:Java OWLReasonerException类的具体用法?Java OWLReasonerException怎么用?Java OWLReasonerException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OWLReasonerException类属于org.semanticweb.owl.inference包,在下文中一共展示了OWLReasonerException类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadBroaderProps

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
protected Set<OWLObjectProperty> loadBroaderProps() {
    Set<Set<OWLObjectProperty>> broaderProperty = new HashSet<Set<OWLObjectProperty>>();
    try {
        broaderProperty = reasoner.getDescendantProperties(getManager().getOWLDataFactory().getOWLObjectProperty(SKOSVocabulary.BROADER.getURI()));
    } catch (OWLReasonerException e) {
        e.printStackTrace();
    }
    broaderProperties.add(getManager().getOWLDataFactory().getOWLObjectProperty(SKOSVocabulary.BROADER.getURI()));

    for (Set<OWLObjectProperty> pb1 : broaderProperty) {
        for (OWLObjectProperty pb1a : pb1) {
            broaderProperties.add(pb1a);
        }
    }
    return broaderProperties;
}
 
开发者ID:simonjupp,项目名称:skoseditor,代码行数:17,代码来源:SKOSConceptInferredHierarchyProvider.java

示例2: loadNarrowerProps

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
protected Set<OWLObjectProperty> loadNarrowerProps() {
    Set<Set<OWLObjectProperty>> narrowerProperty = new HashSet<Set<OWLObjectProperty>>();;
    try {
        narrowerProperty = reasoner.getDescendantProperties(getManager().getOWLDataFactory().getOWLObjectProperty(SKOSVocabulary.NARROWER.getURI()));
    } catch (OWLReasonerException e) {
        e.printStackTrace();
    }
    narrowerProperties.add(getManager().getOWLDataFactory().getOWLObjectProperty(SKOSVocabulary.NARROWER.getURI()));

    for (Set<OWLObjectProperty> pb1 : narrowerProperty) {
        for (OWLObjectProperty pb1a : pb1) {
            narrowerProperties.add(pb1a);
        }
    }
    return narrowerProperties;
}
 
开发者ID:simonjupp,项目名称:skoseditor,代码行数:17,代码来源:SKOSConceptInferredHierarchyProvider.java

示例3: loadBroaderProps

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
protected Set<OWLObjectProperty> loadBroaderProps() {
    Set<Set<OWLObjectProperty>> broaderProperty = new HashSet<Set<OWLObjectProperty>>();;
    try {
        broaderProperty = reasoner.getDescendantProperties(getManager().getOWLDataFactory().getOWLObjectProperty(SKOSVocabulary.BROADER.getURI()));
    } catch (OWLReasonerException e) {
        e.printStackTrace();
    }
    broaderProperties.add(getManager().getOWLDataFactory().getOWLObjectProperty(SKOSVocabulary.BROADER.getURI()));

    for (Set<OWLObjectProperty> pb1 : broaderProperty) {
        for (OWLObjectProperty pb1a : pb1) {
            broaderProperties.add(pb1a);
        }
    }
    return broaderProperties;
}
 
开发者ID:simonjupp,项目名称:skoseditor,代码行数:17,代码来源:SKOSInSchemeInferredHierarchyProvider.java

示例4: loadNarrowerProps

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
protected Set<OWLObjectProperty> loadNarrowerProps() {
    Set<Set<OWLObjectProperty>> narrowerProperty = new HashSet<Set<OWLObjectProperty>>();;
    try {
        narrowerProperty = reasoner.getDescendantProperties(getManager().getOWLDataFactory().getOWLObjectProperty(SKOSVocabulary.NARROWER.getURI()));
    } catch (OWLReasonerException e) {
        e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
    }
    narrowerProperties.add(getManager().getOWLDataFactory().getOWLObjectProperty(SKOSVocabulary.NARROWER.getURI()));

    for (Set<OWLObjectProperty> pb1 : narrowerProperty) {
        for (OWLObjectProperty pb1a : pb1) {
            narrowerProperties.add(pb1a);
        }
    }
    return narrowerProperties;
}
 
开发者ID:simonjupp,项目名称:skoseditor,代码行数:17,代码来源:SKOSInSchemeInferredHierarchyProvider.java

示例5: buildConceptTree

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
private static TreeNode buildConceptTree(TreeNode parent,OWLClass cl,OWLReasoner r) throws OWLReasonerException {
	ConceptTreeNode ctn = new ConceptTreeNode(cl);
		
	
	TreeNode td = new TreeNode(ctn);
	td.setParent(parent);
	ArrayList<TreeNode> childs = new ArrayList<TreeNode>();
	
	//recursivly build up tree
	Set<Set<OWLClass>> subs = r.getSubClasses(cl);
	for (Set<OWLClass> eqSubs:subs) {
		for (OWLClass sub:eqSubs) {
			if (sub != ontologyStore.getOntologyManager().getOWLDataFactory().getOWLNothing())
				childs.add(buildConceptTree(td, sub,r));
		}
	}
	
	if( !childs.isEmpty())
		td.setChildren(childs.toArray(new TreeNode[0]));
	else td.setChildren(null);
	return td;
}
 
开发者ID:ag-csw,项目名称:SVoNt,代码行数:23,代码来源:ConceptTree.java

示例6: inSchemea

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
private boolean inSchemea(OWLIndividual ind, OWLIndividual conceptSchema) {

        try {
            return reasoner.getRelatedIndividuals(ind, inScheme).contains(conceptSchema);
        } catch (OWLReasonerException e) {
            e.printStackTrace();
        }

        return false;
    }
 
开发者ID:simonjupp,项目名称:skoseditor,代码行数:11,代码来源:SKOSInSchemeInferredHierarchyProvider.java

示例7: refillInferred

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
protected void refillInferred() throws OWLReasonerException {
    Map<OWLDataProperty, Set<OWLConstant>> rels = getReasoner().getDataPropertyRelationships(getRootObject());

    Set<OWLDataProperty> relatedProps = new HashSet<OWLDataProperty>(10);
    relatedProps.add(relatedProperty);
    Set<Set<OWLDataProperty>> inferredSet = new HashSet<Set<OWLDataProperty>>();
    inferredSet.addAll(getReasoner().getDescendantProperties(relatedProperty));
    inferredSet.addAll(new HashSet(getReasoner().getEquivalentProperties(relatedProperty)));
    for (Set<OWLDataProperty> set : inferredSet) {
        relatedProps.addAll(set);
    }

    for (OWLDataProperty prop : rels.keySet()) {
        if (relatedProps.contains(prop)) {
            for (OWLConstant constant : rels.get(prop)) {
                OWLDataPropertyAssertionAxiom ax = getOWLDataFactory().getOWLDataPropertyAssertionAxiom(
                        getRootObject(),
                        prop,
                        constant);
                if (!added.contains(ax)) {
                    addRow(new OWLDataPropertyAssertionAxiomFrameSectionRow(getOWLEditorKit(),
                            this,
                            null,
                            getRootObject(),
                            ax));
                }
            }
        }
    }
}
 
开发者ID:simonjupp,项目名称:skoseditor,代码行数:31,代码来源:SKOSDataPropertyAssertionAxiomFrameSection.java

示例8: refillInferred

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
protected void refillInferred() throws OWLReasonerException {
    Map<OWLObjectProperty, Set<OWLIndividual>> rels = getReasoner().getObjectPropertyRelationships(getRootObject());

    Set<OWLObjectProperty> relatedProps = new HashSet<OWLObjectProperty>(10);
    relatedProps.add(relatedProp);
    Set<Set<OWLObjectProperty>> inferredSet = new HashSet<Set<OWLObjectProperty>>();
    inferredSet.addAll(getReasoner().getDescendantProperties(relatedProp));
    inferredSet.addAll(new HashSet(getReasoner().getEquivalentProperties(relatedProp)));
    for (Set<OWLObjectProperty> set : inferredSet) {
        relatedProps.addAll(set);
    }
    
    for (OWLObjectProperty prop : rels.keySet()) {
        if (relatedProps.contains(prop)) {
            for (OWLIndividual ind : rels.get(prop)) {

                OWLObjectPropertyAssertionAxiom ax = getOWLDataFactory().getOWLObjectPropertyAssertionAxiom(
                        getRootObject(),
                        prop,
                        ind);
                if (!added.contains(ax)) {
                    addRow(new OWLObjectPropertyAssertionAxiomFrameSectionRow(getOWLEditorKit(),
                                                                              this,
                                                                              null,
                                                                              getRootObject(),
                                                                              ax));
                }
            }
        }
    }
}
 
开发者ID:simonjupp,项目名称:skoseditor,代码行数:32,代码来源:SKOSRelatedPropertyAssertionAxiomFrameSection.java

示例9: refillInferred

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
protected void refillInferred() throws OWLReasonerException {
    Map<OWLObjectProperty, Set<OWLIndividual>> rels = getReasoner().getObjectPropertyRelationships(getRootObject());
    for (OWLObjectProperty prop : rels.keySet()) {

        for (Set<OWLObjectProperty> propSet : getReasoner().getAncestorProperties(prop)) {

            for (OWLObjectProperty ancProp : propSet) {
                if (propertyFiltersSet.contains(ancProp)) {
                    propertyFiltersSet.add(prop);
                }
            }
        }

        if (!propertyFiltersSet.contains(prop)) {
            for (OWLIndividual ind : rels.get(prop)) {
                OWLObjectPropertyAssertionAxiom ax = getOWLDataFactory().getOWLObjectPropertyAssertionAxiom(
                        getRootObject(),
                        prop,
                        ind);
                if (!added.contains(ax)) {
                    addRow(new OWLObjectPropertyAssertionAxiomFrameSectionRow(getOWLEditorKit(),
                            this,
                            null,
                            getRootObject(),
                            ax));
                }
            }
        }
    }
}
 
开发者ID:simonjupp,项目名称:skoseditor,代码行数:31,代码来源:SKOSOtherObjectPropertyAssertionAxiomFrameSection.java

示例10: refillInferred

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
protected void refillInferred() throws OWLReasonerException {
    Map<OWLDataProperty, Set<OWLConstant>> rels = getReasoner().getDataPropertyRelationships(getRootObject());
    for (OWLDataProperty prop : rels.keySet()) {

         for (Set<OWLDataProperty> propSet : getReasoner().getAncestorProperties(prop)) {

            for (OWLDataProperty ancProp : propSet) {
                if (propertyFiltersSet.contains(ancProp)) {
                    propertyFiltersSet.add(prop);
                }
            }
        }

        if (!propertyFiltersSet.contains(prop)) {
            for (OWLConstant constant : rels.get(prop)) {
                OWLDataPropertyAssertionAxiom ax = getOWLDataFactory().getOWLDataPropertyAssertionAxiom(
                        getRootObject(),
                        prop,
                        constant);
                if (!added.contains(ax)) {
                    addRow(new OWLDataPropertyAssertionAxiomFrameSectionRow(getOWLEditorKit(),
                                                                            this,
                                                                            null,
                                                                            getRootObject(),
                                                                            ax));
                }
            }
        }
    }
}
 
开发者ID:simonjupp,项目名称:skoseditor,代码行数:31,代码来源:SKOSOtherDataPropertyAssertionAxiomFrameSection.java

示例11: updateAnswers

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
public void updateAnswers() {

		final int questionCount = questions.size();

		if (questionCount == 0) {
			showMessage(JOptionPane.INFORMATION_MESSAGE, NO_QUESTIONS_MESSAGE);
			return;
		}


		try {
			if (! mngr.getReasoner().isClassified()) {
				showMessage(JOptionPane.WARNING_MESSAGE, NSYNC_MESSAGE);
			}
		} catch (OWLReasonerException e) {
			showMessage(JOptionPane.ERROR_MESSAGE, e.getMessage());
			return;
		}

		progressMonitor = new ProgressMonitor(parent, "Updating answers to " + questionCount + " questions...", "", 0, questionCount);
		progressMonitor.setProgress(0);

		task = new Task();
		task.addPropertyChangeListener(new PropertyChangeListener() {
			public void propertyChange(PropertyChangeEvent evt) {
				if ("progress" == evt.getPropertyName()) {
					int progress = (Integer) evt.getNewValue();
					progressMonitor.setProgress(progress);
					String message = String.format("Completed %d of %d.\n", progress, questionCount);
					progressMonitor.setNote(message);
					if (progressMonitor.isCanceled()) {
						task.cancel(true);
						logger.info("Task cancelled");
					}
				}
			}
		});
		task.execute();
	}
 
开发者ID:Kaljurand,项目名称:aceview,代码行数:40,代码来源:UpdateAnswersUI.java

示例12: setAnswerLists

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
private void setAnswerLists(OWLModelManager mngr, OWLReasoner reasoner, OWLDescription desc) throws OWLReasonerException {
	Set<OWLIndividual> answerIndividuals = reasoner.getIndividuals(desc, false);

	setIndividualAnswerList(individuals, answerIndividuals);
	setClassAnswerList(subClasses, OWLReasonerAdapter.flattenSetOfSets(reasoner.getDescendantClasses(desc)));
	setClassAnswerList(supClasses, OWLReasonerAdapter.flattenSetOfSets(reasoner.getAncestorClasses(desc)));

	// We remove inconsistent classes as they might be confusing when presented as answers.
	subClasses.removeAll(reasoner.getInconsistentClasses());

	isIndividualAnswersComplete = isCompleteIndividuals(mngr.getOWLDataFactory(), reasoner, desc, individuals);
	isSubClassesAnswersComplete = isCompleteSubClasses(mngr.getOWLDataFactory(), reasoner, desc, subClasses);
}
 
开发者ID:Kaljurand,项目名称:aceview,代码行数:14,代码来源:ACEAnswer.java

示例13: isSatisfiable

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
private boolean isSatisfiable(OWLReasoner reasoner, OWLDescription desc) {
	try {
		return reasoner.isSatisfiable(desc);
	} catch (OWLReasonerException e) {
		e.printStackTrace();
		return false;
	}	
}
 
开发者ID:Kaljurand,项目名称:aceview,代码行数:9,代码来源:ACEAnswer.java

示例14: run

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
@Override
public void run(IAction action) {
	ITreeSelection sel= (ITreeSelection) part.getSite().getSelectionProvider().getSelection();

	IProject p = (IProject) sel.iterator().next();
	OntologyStore os = OntoEclipseManager.getOntologyStore(p.getName());
	
	if (os != null) {
		
		//then this store exist
		try {
			ConceptTree.refreshConceptTree(os, os.getMainOntologyURI());
			OntologyInformation.refreshOntologyInformation(os,os.getMainOntologyURI());
			
			try {
				PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("de.fuberlin.agcsw.heraclitus.backend.ui.OntologyInformationView");
				PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("de.fuberlin.agcsw.heraclitus.backend.ui.ConceptExplorerView");
			} catch (PartInitException e1) {
				e1.printStackTrace();
			}
			
		} catch (OWLReasonerException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
	}
	
}
 
开发者ID:ag-csw,项目名称:SVoNt,代码行数:30,代码来源:OpenConceptTreeAction.java

示例15: setOntologies

import org.semanticweb.owl.inference.OWLReasonerException; //导入依赖的package包/类
public void setOntologies(Set<OWLOntology> ontologies) {
        reasoner = modelManager.getReasoner();
        if (reasoner != null) {
            isClassified = true;
        }

        if (!isClassified) {
            return;
        }
        setFireEvents(false);
        this.reasoner = modelManager.getReasoner();
        conceptsToView.clear();
        setUp();

        try {
            for (OWLIndividual ind : reasoner.getIndividuals( skosConcept, false)) {

                Map<OWLObjectProperty, Set<OWLIndividual>> map = reasoner.getObjectPropertyRelationships(ind);
                for (OWLObjectProperty prop : map.keySet()) {

                    for (OWLIndividual relInd : map.get(prop)) {
                        OWLObjectPropertyAssertionAxiom ax = getManager().getOWLDataFactory().getOWLObjectPropertyAssertionAxiom(ind, prop, relInd);
                        ax.accept(getFilter());
                    }
                }
                conceptsToView.add(ind);
            }

            for (OWLOntology ont : ontologies) {
//                for (OWLClassAssertionAxiom axiom : ont.getAxioms(AxiomType.CLASS_ASSERTION)) {
//                    if (axiom.getDescription().equals(skosConcept)) {
//                        conceptsToView.add(axiom.getIndividual());
//                    }
//                }
                updateRoots(ont, conceptsToView);
            }

            fireHierarchyChanged();
            setFireEvents(true);
        } catch (OWLReasonerException e) {
            e.printStackTrace();
        }

    }
 
开发者ID:simonjupp,项目名称:skoseditor,代码行数:45,代码来源:SKOSConceptInferredHierarchyProvider.java


注:本文中的org.semanticweb.owl.inference.OWLReasonerException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。