本文整理汇总了Java中org.semanticweb.owlapi.model.OWLIndividual.isAnonymous方法的典型用法代码示例。如果您正苦于以下问题:Java OWLIndividual.isAnonymous方法的具体用法?Java OWLIndividual.isAnonymous怎么用?Java OWLIndividual.isAnonymous使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.semanticweb.owlapi.model.OWLIndividual
的用法示例。
在下文中一共展示了OWLIndividual.isAnonymous方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public void visit(SWRLDifferentIndividualsAtom atom) {
Set<OWLNamedIndividual> inds=new HashSet<OWLNamedIndividual>();
for (SWRLArgument arg : atom.getAllArguments()) {
if (!(arg instanceof SWRLIndividualArgument))
throwVarError(atom);
OWLIndividual ind=((SWRLIndividualArgument)arg).getIndividual();
if (ind.isAnonymous())
throwAnonIndError(atom);
inds.add(ind.asOWLNamedIndividual());
}
addFact(m_factory.getOWLDifferentIndividualsAxiom(inds));
}
示例2: getSameIndividuals
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public Node<OWLNamedIndividual> getSameIndividuals(OWLNamedIndividual ind) throws InconsistentOntologyException, FreshEntitiesException, ReasonerInterruptedException, TimeOutException {
ensurePrepared();
Set<OWLNamedIndividual> inds = new HashSet<OWLNamedIndividual>();
Set<OWLSameIndividualAxiom> processed = new HashSet<OWLSameIndividualAxiom>();
List<OWLNamedIndividual> stack = new ArrayList<OWLNamedIndividual>();
stack.add(ind);
while (!stack.isEmpty()) {
OWLNamedIndividual currentInd = stack.remove(0);
for (OWLOntology ontology : getRootOntology().getImportsClosure()) {
for (OWLSameIndividualAxiom axiom : ontology.getSameIndividualAxioms(currentInd)) {
if (!processed.contains(axiom)) {
processed.add(axiom);
for (OWLIndividual i : axiom.getIndividuals()) {
if (!i.isAnonymous()) {
OWLNamedIndividual namedInd = i.asOWLNamedIndividual();
if (!inds.contains(namedInd)) {
inds.add(namedInd);
stack.add(namedInd);
}
}
}
}
}
}
}
return new OWLNamedIndividualNode(inds);
}
示例3: isDefined
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public boolean isDefined(OWLIndividual owlIndividual) {
Individual individual;
if (owlIndividual.isAnonymous())
individual = Individual.createAnonymous(owlIndividual
.asOWLAnonymousIndividual().getID().toString());
else
individual = Individual.create(owlIndividual.asOWLNamedIndividual()
.getIRI().toString());
return m_dlOntology.containsIndividual(individual);
}
示例4: visit
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public Boolean visit(OWLObjectPropertyAssertionAxiom axiom) {
OWLIndividual sub=axiom.getSubject();
OWLIndividual obj=axiom.getObject();
if (sub.isAnonymous()||obj.isAnonymous()) {
anonymousIndividualAxioms.add(axiom);
return true; // will be checked afterwards by rolling-up
}
return reasoner.hasObjectPropertyRelationship(sub.asOWLNamedIndividual(),axiom.getProperty(),obj.asOWLNamedIndividual());
}
示例5: visit
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public void visit(SWRLDataPropertyAtom atom) {
if (!(atom.getSecondArgument() instanceof SWRLLiteralArgument))
throwVarError(atom);
if (!(atom.getFirstArgument() instanceof SWRLIndividualArgument))
throwVarError(atom);
OWLIndividual ind=((SWRLIndividualArgument)atom.getFirstArgument()).getIndividual();
if (ind.isAnonymous())
throwAnonIndError(atom);
OWLLiteral lit=((SWRLLiteralArgument)atom.getSecondArgument()).getLiteral();
addFact(m_factory.getOWLDataPropertyAssertionAxiom(atom.getPredicate().asOWLDataProperty(),ind.asOWLNamedIndividual(),lit));
}
示例6: getIndividual
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
protected Individual getIndividual(OWLIndividual individual) {
Individual ind;
if (individual.isAnonymous())
ind=Individual.createAnonymous(individual.asOWLAnonymousIndividual().getID().toString());
else
ind=Individual.create(individual.asOWLNamedIndividual().getIRI().toString());
m_allIndividuals.add(ind);
return ind;
}
示例7: visit
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
public Boolean visit(OWLDataPropertyAssertionAxiom axiom) {
OWLIndividual sub=axiom.getSubject();
if (sub.isAnonymous()) {
anonymousIndividualAxioms.add(axiom);
return true; // will be checked afterwards by rolling-up
}
return reasoner.hasDataPropertyRelationship(sub.asOWLNamedIndividual(),axiom.getProperty().asOWLDataProperty(),axiom.getObject());
}
示例8: getIndividual
import org.semanticweb.owlapi.model.OWLIndividual; //导入方法依赖的package包/类
protected static Individual getIndividual(OWLIndividual individual) {
if (individual.isAnonymous())
return Individual.createAnonymous(individual.asOWLAnonymousIndividual().getID().toString());
else
return Individual.create(individual.asOWLNamedIndividual().getIRI().toString());
}