Java 类org.semanticweb.owlapi.model.ClassExpressionType 实例源码

项目:Pellet4Android    文件:OntologyManager.java   
private Collection<Collection<String>> getClassExpressionOfType(
        Collection<OWLClassExpression> classExpressions,
        ClassExpressionType type) {
    Collection<Collection<String>> collection = new HashSet<Collection<String>>();
    for (OWLClassExpression expression : classExpressions) {
        final ClassExpressionType classExpressionType = expression
                .getClassExpressionType();
        if (type.equals(classExpressionType)) {
            final Set<OWLClass> equivalentClassesList = expression
                    .getClassesInSignature();
            List<String> classAsStringList = new ArrayList<String>();
            for (OWLClass clz : equivalentClassesList) {
                classAsStringList.add(clz.getIRI().toString());
            }
            collection.add(classAsStringList);
        }
    }
    return collection;
}
项目:OWL2SPARQL    文件:OWLAxiomToSPARQLConverter.java   
@Override
public void visit(OWLSubClassOfAxiom axiom) {
    // process subclass
    OWLClassExpression subClass = axiom.getSubClass();
    if(!subClass.isOWLThing()){// we do not need to convert owl:Thing
        String subClassPattern = expressionConverter.asGroupGraphPattern(subClass, subjectVar);
        sparql += subClassPattern;
    }

    // process superclass
    OWLClassExpression superClass = axiom.getSuperClass();
    boolean needsOuterTriplePattern = subClass.isOWLThing() &&
            (superClass.getClassExpressionType() == ClassExpressionType.OBJECT_COMPLEMENT_OF ||
            superClass.getClassExpressionType() == ClassExpressionType.DATA_ALL_VALUES_FROM ||
            superClass.getClassExpressionType() == ClassExpressionType.OBJECT_ALL_VALUES_FROM);
    String superClassPattern = expressionConverter.asGroupGraphPattern(superClass, subjectVar,
                                                                       needsOuterTriplePattern);
    sparql += superClassPattern;
}
项目:Pellet4Android    文件:OntologyManager.java   
private Collection<Collection<String>> getEquivalentClassByClassExpresionType(
        final String c, ClassExpressionType type) {

    final OWLDataFactory factory = ontology.getOWLOntologyManager()
            .getOWLDataFactory();
    final OWLClass owlClass = factory.getOWLClass(IRI.create(c));
    final Set<OWLOntology> ontologySet = new HashSet<OWLOntology>();
    ontologySet.add(ontology);
    ontologySet.addAll(ontology.getImportsClosure());

    final Set<OWLClassExpression> equivalentClasses = owlClass
            .getEquivalentClasses(ontologySet);
    return getClassExpressionOfType(equivalentClasses, type);
}
项目:Pellet4Android    文件:OntologyManager.java   
public Collection<Collection<String>> getClassDisjointWith(String c) {

        final OWLDataFactory factory = ontology.getOWLOntologyManager()
                .getOWLDataFactory();
        final OWLClass owlClass = factory.getOWLClass(IRI.create(c));
        final Set<OWLOntology> ontologySet = new HashSet<OWLOntology>();
        ontologySet.add(ontology);
        ontologySet.addAll(ontology.getImportsClosure());

        final Set<OWLClassExpression> disjointClasses = owlClass
                .getDisjointClasses(ontologySet);

        return getClassExpressionOfType(disjointClasses,
                ClassExpressionType.OWL_CLASS);
    }
项目:pronto    文件:PTBoxImpl.java   
private ATermAppl convertToATerm(OWLClassExpression expr, KnowledgeBase kb) {

        return expr.getClassExpressionType() == ClassExpressionType.OBJECT_COMPLEMENT_OF
            ? CCUtils.classExprToATerm( expr.getComplementNNF(), kb )
            : CCUtils.classExprToATerm( expr, kb );
    }
项目:Pellet4Android    文件:OntologyManager.java   
public Collection<Collection<String>> getClassIntersectionOf(String c) {
    return getEquivalentClassByClassExpresionType(c,
            ClassExpressionType.OBJECT_INTERSECTION_OF);
}
项目:Pellet4Android    文件:OntologyManager.java   
public Collection<Collection<String>> getClassUnionOf(String c) {
    return getEquivalentClassByClassExpresionType(c,
            ClassExpressionType.OBJECT_UNION_OF);
}
项目:Pellet4Android    文件:OntologyManager.java   
public Collection<Collection<String>> getClassComplementOf(String c) {
    return getEquivalentClassByClassExpresionType(c,
            ClassExpressionType.OBJECT_COMPLEMENT_OF);
}
项目:Pellet4Android    文件:OntologyManager.java   
public Collection<Collection<String>> getClassEquivalentClass(String c) {
    return getEquivalentClassByClassExpresionType(c,
            ClassExpressionType.OWL_CLASS);
}
项目:owlapi-gwt    文件:OWLObjectMaxCardinalityImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.OBJECT_MAX_CARDINALITY;
}
项目:owlapi-gwt    文件:OWLObjectMinCardinalityImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.OBJECT_MIN_CARDINALITY;
}
项目:owlapi-gwt    文件:OWLDataHasValueImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.DATA_HAS_VALUE;
}
项目:owlapi-gwt    文件:OWLDataSomeValuesFromImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.DATA_SOME_VALUES_FROM;
}
项目:owlapi-gwt    文件:OWLDataAllValuesFromImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.DATA_ALL_VALUES_FROM;
}
项目:owlapi-gwt    文件:OWLObjectIntersectionOfImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.OBJECT_INTERSECTION_OF;
}
项目:owlapi-gwt    文件:OWLDataMinCardinalityImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.DATA_MIN_CARDINALITY;
}
项目:owlapi-gwt    文件:OWLObjectHasSelfImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.OBJECT_HAS_SELF;
}
项目:owlapi-gwt    文件:OWLObjectComplementOfImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.OBJECT_COMPLEMENT_OF;
}
项目:owlapi-gwt    文件:OWLDataMaxCardinalityImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.DATA_MAX_CARDINALITY;
}
项目:owlapi-gwt    文件:OWLObjectUnionOfImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.OBJECT_UNION_OF;
}
项目:owlapi-gwt    文件:OWLObjectExactCardinalityImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.OBJECT_EXACT_CARDINALITY;
}
项目:owlapi-gwt    文件:OWLObjectOneOfImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.OBJECT_ONE_OF;
}
项目:owlapi-gwt    文件:OWLDataExactCardinalityImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.DATA_EXACT_CARDINALITY;
}
项目:owlapi-gwt    文件:OWLObjectHasValueImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.OBJECT_HAS_VALUE;
}
项目:owlapi-gwt    文件:OWLObjectAllValuesFromImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.OBJECT_ALL_VALUES_FROM;
}
项目:owlapi-gwt    文件:OWLClassImpl.java   
@Override
public ClassExpressionType getClassExpressionType() {
    return ClassExpressionType.OWL_CLASS;
}