本文整理汇总了Java中org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom类的典型用法代码示例。如果您正苦于以下问题:Java OWLObjectSomeValuesFrom类的具体用法?Java OWLObjectSomeValuesFrom怎么用?Java OWLObjectSomeValuesFrom使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OWLObjectSomeValuesFrom类属于org.semanticweb.owlapi.model包,在下文中一共展示了OWLObjectSomeValuesFrom类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getExpressions
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
private Set<OWLObjectSomeValuesFrom> getExpressions(OWLNamedIndividual i, OWLOntology model) {
Set<OWLObjectSomeValuesFrom> result = new HashSet<OWLObjectSomeValuesFrom>();
Set<OWLObjectPropertyAssertionAxiom> axioms = model.getObjectPropertyAssertionAxioms(i);
for (OWLObjectPropertyAssertionAxiom ax : axioms) {
if (enabledBy.equals(ax.getProperty())) {
continue;
}
OWLIndividual object = ax.getObject();
if (object.isNamed()) {
Set<OWLClass> types = getTypes(object.asOWLNamedIndividual(), model);
for (OWLClass cls : types) {
result.add(createSvf(ax.getProperty(), cls));
}
}
}
return result;
}
示例2: testParseClazzNegatedExpression
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
@Test
public void testParseClazzNegatedExpression() throws Exception {
JsonOwlObject svf = new JsonOwlObject();
svf.type = JsonOwlObjectType.SomeValueFrom;
svf.property = new JsonOwlObject();
svf.property.type = JsonOwlObjectType.ObjectProperty;
svf.property.id = OCCURS_IN; // occurs_in
svf.filler = new JsonOwlObject();
svf.filler.id = NUCLEUS;
svf.filler.type = JsonOwlObjectType.Class;
JsonOwlObject expression = new JsonOwlObject();
expression.type = JsonOwlObjectType.ComplementOf;
expression.filler = svf;
OWLDataFactory df = graph.getDataFactory();
OWLClassExpression ce = new M3ExpressionParser(curieHandler).parse(graph, expression, null);
OWLClass nucleus = graph.getOWLClassByIdentifier(NUCLEUS);
OWLObjectSomeValuesFrom svfx = df.getOWLObjectSomeValuesFrom(graph.getOWLObjectPropertyByIdentifier(OCCURS_IN), nucleus);
OWLObjectComplementOf ceExpected = df.getOWLObjectComplementOf(svfx);
assertEquals(ceExpected, ce);
}
示例3: visit
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
public void visit(OWLObjectSomeValuesFrom object) {
OWLClassExpression filler=object.getFiller();
if (filler instanceof OWLObjectOneOf) {
for (OWLIndividual individual : ((OWLObjectOneOf)filler).getIndividuals()) {
Variable z=nextZ();
m_bodyAtoms.add(Atom.create(getConceptForNominal(individual),z));
m_headAtoms.add(getRoleAtom(object.getProperty(),X,z));
}
}
else {
LiteralConcept toConcept=getLiteralConcept(filler);
Role onRole=getRole(object.getProperty());
AtLeastConcept atLeastConcept=AtLeastConcept.create(1,onRole,toConcept);
if (!atLeastConcept.isAlwaysFalse())
m_headAtoms.add(Atom.create(atLeastConcept,X));
}
}
示例4: expressionToClass
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
private OWLClass expressionToClass(OWLClassExpression x) {
if (x instanceof OWLClass)
return (OWLClass)x;
if (this.expressionToClassMap.containsKey(x))
return this.expressionToClassMap.get(x);
OWLClass c = owlDataFactory.getOWLClass(IRI.create("http://owlsim.org#"+idNum));
idNum++;
OWLEquivalentClassesAxiom eca =
owlDataFactory.getOWLEquivalentClassesAxiom(c, x);
owlOntologyManager.addAxiom(sourceOntology, eca);
expressionToClassMap.put(x, c);
// fully fold tbox (AND and SOME only)
if (x instanceof OWLObjectIntersectionOf) {
for (OWLClassExpression y : ((OWLObjectIntersectionOf)x).getOperands()) {
expressionToClass(y);
}
}
else if (x instanceof OWLObjectSomeValuesFrom) {
expressionToClass(((OWLObjectSomeValuesFrom)x).getFiller());
}
return c;
}
示例5: gatherProperties
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
private void gatherProperties(OWLClassExpression x) {
if (x instanceof OWLClass) {
return;
}
else if (x instanceof OWLObjectIntersectionOf) {
for (OWLClassExpression y : ((OWLObjectIntersectionOf)x).getOperands()) {
gatherProperties(y);
}
}
else if (x instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom svf = (OWLObjectSomeValuesFrom)x;
gatherProperties(svf.getProperty());
gatherProperties(svf.getFiller());
}
else {
//
}
}
示例6: makeHasPhenotypeInstancesDirect
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
protected void makeHasPhenotypeInstancesDirect() {
// x Type has_phenotype some C ==> x Type C
LOG.info("x Type has_phenotype some C ==> x Type C");
OWLObjectProperty hasPhenotype = getOWLObjectPropertyViaOBOSuffix(HAS_PHENOTYPE);
Set<OWLAxiom> rmAxioms = new HashSet<OWLAxiom>();
Set<OWLAxiom> newAxioms = new HashSet<OWLAxiom>();
for (OWLClassAssertionAxiom caa : outputOntology.getAxioms(AxiomType.CLASS_ASSERTION)) {
OWLClassExpression ex = caa.getClassExpression();
OWLIndividual i = caa.getIndividual();
if (ex instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom svf = (OWLObjectSomeValuesFrom)ex;
if (svf.getProperty().equals(hasPhenotype)) {
rmAxioms.add(caa);
newAxioms.add(getOWLDataFactory().getOWLClassAssertionAxiom(svf.getFiller(), i));
}
}
}
LOG.info("making instances direct: +"+newAxioms.size()+ " -"+rmAxioms.size());
addAxiomsToOutput(newAxioms, false);
removeAxiomsFromOutput(rmAxioms, false);
}
示例7: trEdge
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
/**
* @param i - source
* @param supc - target expression (e.g. R some B)
* @return OWLObjectPropertyAssertionAxiom or null
*/
private OWLObjectPropertyAssertionAxiom trEdge(OWLIndividual i, OWLClassExpression supc) {
if (supc instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom svf = (OWLObjectSomeValuesFrom)supc;
OWLObjectPropertyExpression p = trTypeLevel(svf.getProperty());
OWLIndividual j;
if (svf.getFiller().isAnonymous()) {
j = anonClassToIndividual(svf.getFiller());
add(trEdge(j, svf.getFiller()));
}
else {
j = classToIndividual((OWLClass)svf.getFiller());
}
OWLObjectPropertyAssertionAxiom e = getOWLDataFactory().getOWLObjectPropertyAssertionAxiom(p, i, j);
return e;
}
return null;
}
示例8: makeExpression
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
public Expression makeExpression(OWLClassExpression x) {
if (x.isAnonymous()) {
if (x instanceof OWLObjectIntersectionOf) {
return makeIntersectionOf((OWLObjectIntersectionOf)x);
}
else if (x instanceof OWLObjectSomeValuesFrom) {
return makeSomeValuesFrom((OWLObjectSomeValuesFrom)x);
}
else {
return null;
}
}
else {
return makeClassStub(x);
}
}
示例9: getSvfClasses
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
Set<OWLClass> getSvfClasses(OWLClass c, OWLObjectProperty p) {
Set<OWLSubClassOfAxiom> axioms = new HashSet<OWLSubClassOfAxiom>();
for(OWLOntology ont : getAllOntologies()) {
axioms.addAll(ont.getSubClassAxiomsForSubClass(c));
}
Set<OWLClass> superClasses = new HashSet<OWLClass>();
for (OWLSubClassOfAxiom axiom : axioms) {
OWLClassExpression expr = axiom.getSuperClass();
if (expr instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom svf = (OWLObjectSomeValuesFrom) expr;
if (p.equals(svf.getProperty())) {
OWLClassExpression filler = svf.getFiller();
if (filler instanceof OWLClass) {
superClasses.add((OWLClass) filler);
}
}
}
}
return superClasses;
}
示例10: visit
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
@Override
public HandlerResult visit(OWLObjectMinCardinality ce) {
final OWLClassExpression filler = ce.getFiller();
final HandlerResult recursive = filler.accept(this);
OWLObjectSomeValuesFrom newCE;
if (recursive == null) {
newCE = factory.getOWLObjectSomeValuesFrom(ce.getProperty(), filler);
}
else if (recursive.remove) {
return HandlerResult.remove();
}
else {
newCE = factory.getOWLObjectSomeValuesFrom(ce.getProperty(), recursive.modified);
}
return HandlerResult.modified(newCE);
}
示例11: renderAdditionalNodeExpression
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
private void renderAdditionalNodeExpression(StringBuilder line, OWLClassExpression expression, OWLPrettyPrinter owlpp, OWLGraphWrapper graph) {
if (expression instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom object = (OWLObjectSomeValuesFrom) expression;
OWLObjectPropertyExpression property = object.getProperty();
OWLClassExpression filler = object.getFiller();
line.append("<TR><TD>");
line.append(getLabel(property, owlpp, graph));
line.append("</TD><TD>");
line.append(getLabel(filler, owlpp, graph));
line.append("</TD></TR>");
}
else {
line.append("<TR><TD COLSPAN=\"2\">");
line.append(getLabel(expression, owlpp, graph));
line.append("</TD></TR>");
}
}
示例12: renderAdditionalNodeExpression
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
private void renderAdditionalNodeExpression(StringBuilder line, OWLClassExpression expression, OWLPrettyPrinter owlpp) {
if (expression instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom object = (OWLObjectSomeValuesFrom) expression;
OWLObjectPropertyExpression property = object.getProperty();
OWLClassExpression filler = object.getFiller();
line.append("<TR><TD>");
line.append(getLabel(property, owlpp));
line.append("</TD><TD>");
line.append(getLabel(filler, owlpp));
line.append("</TD></TR>");
}
else {
line.append("<TR><TD COLSPAN=\"2\">");
line.append(getLabel(expression, owlpp));
line.append("</TD></TR>");
}
}
示例13: handleIntersection
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
private void handleIntersection(List<CheckWarning> warnings, Set<OWLOntology> allOntologies,
OWLEquivalentClassesAxiom axiom, OWLObjectIntersectionOf intersection, OWLPrettyPrinter pp)
{
for(OWLClassExpression operand : intersection.getOperandsAsList()) {
OWLClass operandCls = null;
if (!operand.isAnonymous()) {
operandCls = operand.asOWLClass();
}
else if (operand instanceof OWLObjectSomeValuesFrom) {
OWLObjectSomeValuesFrom ristriction = (OWLObjectSomeValuesFrom) operand;
OWLClassExpression filler = ristriction.getFiller();
if (!filler.isAnonymous()) {
operandCls = filler.asOWLClass();
}
}
else {
// not translatable to OBO
handleGeneric(warnings, allOntologies, axiom, operand, pp);
}
if (operandCls != null && isDangling(operandCls, allOntologies)) {
final IRI iri = operandCls.getIRI();
String message = "Dangling reference "+iri+" in INTERSECTION_OF axiom: "+pp.render(axiom);
warnings.add(new CheckWarning(getID(), message , isFatal(), iri, OboFormatTag.TAG_INTERSECTION_OF.getTag()));
}
}
}
示例14: filterSVFs
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
private static Set<OWLObjectSomeValuesFrom> filterSVFs(final OWLClassFilter clsFilter, Set<OWLObjectSomeValuesFrom> svfs) {
Predicate<OWLObjectSomeValuesFrom> predicate = new Predicate<OWLObjectSomeValuesFrom>() {
@Override
public boolean apply(OWLObjectSomeValuesFrom input) {
OWLClassExpression filler = input.getFiller();
Boolean result = filler.accept(new OWLClassExpressionVisitorExAdapter<Boolean>(Boolean.FALSE){
@Override
public Boolean visit(OWLClass cls) {
return clsFilter.use(cls);
}
});
if (result != null) {
return result.booleanValue();
}
return false;
}
};
svfs = Sets.filter(svfs, predicate);
return svfs;
}
示例15: addToOntology
import org.semanticweb.owlapi.model.OWLObjectSomeValuesFrom; //导入依赖的package包/类
@Override
public void addToOntology() {
OWLObjectProperty property = featurePool.getExclusiveProperty(":objectSomeValuesFromProperty_RL");
OWLClass range = featurePool.getExclusiveClass(":ObjectSomeValuesFromRange_RL");
OWLClass someValuesFrom = featurePool.getExclusiveClass(":ObjectSomeValuesFrom_RL");
OWLObjectSomeValuesFrom restriction = factory.getOWLObjectSomeValuesFrom(property, range);
addAxiomToOntology(factory.getOWLSubClassOfAxiom(restriction, someValuesFrom));
}