Tabnine Logo
OWLClassExpression.getClassExpressionType
Code IndexAdd Tabnine to your IDE (free)

How to use
getClassExpressionType
method
in
org.semanticweb.owlapi.model.OWLClassExpression

Best Java code snippets using org.semanticweb.owlapi.model.OWLClassExpression.getClassExpressionType (Showing top 20 results out of 315)

origin: stackoverflow.com

PrefixManager pm= new DefaultPrefixManager("http://www.co-ode.org/ontologies/pizza/pizza.owl#");
 OWLClass american=factory.getOWLClass("American", pm);
 Set<OWLClassAxiom> tempAx=localOntology.getAxioms(american);
 for(OWLClassAxiom ax: tempAx){
   for(OWLClassExpression nce:ax.getNestedClassExpressions())
     if(nce.getClassExpressionType()!=ClassExpressionType.OWL_CLASS)
       System.out.println(ax);
 }
origin: protegeproject/protege

  public boolean shouldBracket(OWLObject parentObject, OWLObject childObject) {
    return childObject instanceof OWLClassExpression && ((OWLClassExpression) childObject).getClassExpressionType().equals(classExpressionType);
  }
}
origin: edu.stanford.protege/org.protege.editor.owl

  public boolean shouldBracket(OWLObject parentObject, OWLObject childObject) {
    return childObject instanceof OWLClassExpression && ((OWLClassExpression) childObject).getClassExpressionType().equals(classExpressionType);
  }
}
origin: edu.stanford.protege/protege-editor-owl

  public boolean shouldBracket(OWLObject parentObject, OWLObject childObject) {
    return childObject instanceof OWLClassExpression && ((OWLClassExpression) childObject).getClassExpressionType().equals(classExpressionType);
  }
}
origin: Quetzal-RDF/quetzal

protected void retainOnlyExistentialRestrictions(Set<OWLClassExpression>  cs) {
  //Set<OWLClassExpression> add = new HashSet<OWLClassExpression>();
  for (Iterator<OWLClassExpression> it = cs.iterator(); it.hasNext();) {
    OWLClassExpression c = it.next();
    if (!c.getClassExpressionType().equals(ClassExpressionType.OBJECT_SOME_VALUES_FROM)
    && !c.getClassExpressionType().equals(ClassExpressionType.DATA_SOME_VALUES_FROM)) {
      it.remove();
      /*c = aterm2complexAtermEq.get(c);
      if (c!=null && ATermUtils.isSomeValues(c)) {
        add.add(c);
      }*/
    }
    
  }
  //cs.addAll(add);
}
protected Set<OWLClassExpression> getCommunSubsumees(
origin: net.sourceforge.owlapi/owlapi

  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append(classExpression.getClassExpressionType().getName());
    sb.append(" class expressions are not allowed in profile: ");
    sb.append(classExpression);
    sb.append("  [");
    sb.append(getAxiom());
    sb.append(" in  ");
    sb.append(getOntologyID());
    sb.append("]");
    return sb.toString();
  }
}
origin: edu.stanford.protege/org.protege.ontograf

private void convertOWLClassExpressionsToArcs(OWLClass owlClass, Set<OWLClassExpression> expressions, Set<GraphArc> arcs, Icon icon, boolean mustBeVisible) {
  for(OWLClassExpression expression : expressions) {
    if(expression.getClassExpressionType().equals(ClassExpressionType.OBJECT_SOME_VALUES_FROM) 
        || expression.getClassExpressionType().equals(ClassExpressionType.OBJECT_ALL_VALUES_FROM)) {
      convertOWLClassExpressionToArcs(owlClass, expression, arcs, icon, mustBeVisible);
    }
    else if(expression.getClassExpressionType().equals(ClassExpressionType.OBJECT_INTERSECTION_OF)) {
      for(OWLClassExpression e : expression.asConjunctSet()) {
        convertOWLClassExpressionToArcs(owlClass, e, arcs, icon, mustBeVisible);
      }
    }
  }
}
 
origin: owlcs/owlapi

  @Override
  public String toString() {
    return toString("Class expressions not allowed in profile: %s",
      getExpression().getClassExpressionType()
        .getName());
  }
}
origin: net.sourceforge.owlapi/owlapi-distribution

  @Override
  public String toString() {
    return toString("Class expressions not allowed in profile: %s",
      getExpression().getClassExpressionType()
        .getName());
  }
}
origin: net.sourceforge.owlapi/owlapi-osgidistribution

  @Override
  public String toString() {
    return toString("Class expressions not allowed in profile: %s",
      getExpression().getClassExpressionType()
        .getName());
  }
}
origin: SmartDataAnalytics/DL-Learner

  private boolean containsObjectAllRestriction(OWLClassExpression d){
    for(OWLClassExpression child : d.getNestedClassExpressions()){
      if(child.getClassExpressionType() == ClassExpressionType.OBJECT_ALL_VALUES_FROM){
        return true;
      }
    }
    return false;
  }
}
origin: SmartDataAnalytics/DL-Learner

@Override
protected void writeDisjointUnionAxiom(Set<OWLClassExpression> set)
{
  if (set.size() > 1)
  {
    String s = "(disjoint-union ";
    for (OWLClassExpression c : set)
    {
      ClassExpressionType type = c.getClassExpressionType();
      if (type != ClassExpressionType.OWL_CLASS)
        exit("Concept type " + type + " not supported in disjoint union axiom");
      else
        s += getShortName(c.asOWLClass()) + " ";
    }
    s += ")";
    print(s);
  }
}
origin: Quetzal-RDF/quetzal

public static boolean isNegatedOWLQLRHSConcept(OWLClassExpression cl) {
  ClassExpressionType type = cl.getNNF().getClassExpressionType();
  return  type.equals(ClassExpressionType.OBJECT_COMPLEMENT_OF)
    || type.equals(ClassExpressionType.OBJECT_ALL_VALUES_FROM)
    || type.equals(ClassExpressionType.DATA_ALL_VALUES_FROM);
    
}
origin: Quetzal-RDF/quetzal

public Set<OWLClass> getUnsatisfiableNamedClasses() {
  if (unsatisfiableClasses == null) {
    unsatisfiableClasses = new HashSet<OWLClass>();
    // unsatisfiabe named classes C are in the negative closure in the form
    // subclass( C, not(C)) 
    for (OWLSubClassOfAxiom ax: getNegativeInclInNegClosure()) {
      OWLClassExpression sub = ax.getSubClass();
      OWLClassExpression sup = ax.getSuperClass();
      if (!sub.isAnonymous()
      && sup.getClassExpressionType().equals(ClassExpressionType.OBJECT_COMPLEMENT_OF)
      && ((OWLObjectComplementOf) sup).getOperand().equals(sub)) {
        unsatisfiableClasses.add(sub.asOWLClass());
      }
    }
  }
  return Collections.unmodifiableSet(unsatisfiableClasses);
  //return new HashSet<OWLClass>();
}
public Set<OWLProperty> getUnsatisfiableProperties() {
origin: Quetzal-RDF/quetzal

protected boolean isValidOWLQLLeftConcept(OWLClassExpression owlclass) {
  // check that subclass is either atomic or someValuesFrom(R, Top)
  if (!owlclass.isAnonymous()) {
    return true;
  }
  if (!owlclass.getClassExpressionType().equals(ClassExpressionType.DATA_SOME_VALUES_FROM)
  && !owlclass.getClassExpressionType().equals(ClassExpressionType.OBJECT_SOME_VALUES_FROM)) {
    return false;
  }
  OWLQuantifiedRestriction quant = (OWLQuantifiedRestriction) owlclass;
  OWLPropertyRange cl= quant.getFiller();
  if (cl instanceof OWLClassExpression) {
    OWLClassExpression clexp = (OWLClassExpression) cl;
    return clexp.isOWLThing();
  } else if (cl instanceof OWLDataRange) {
    OWLDataRange dr = (OWLDataRange) cl;
    //TODO handle qualified data existential restriction
    return dr.isTopDatatype();
  } else {
    assert false: "Unknown OWLPropertyRange: " +cl;
    return false;
  }
}

origin: Quetzal-RDF/quetzal

/**
 * returns the key associated with a class expression
 * @param lhsConcept
 * @return
 */
public static String getKey(OWLClassExpression lhsConcept) {
  if (!lhsConcept.isAnonymous()) {
    return lhsConcept.asOWLClass().getIRI().toString();
  } else if (lhsConcept.getClassExpressionType().equals(ClassExpressionType.OBJECT_SOME_VALUES_FROM)
      || lhsConcept.getClassExpressionType().equals(ClassExpressionType.DATA_SOME_VALUES_FROM)) {
    OWLQuantifiedRestriction rest =  (OWLQuantifiedRestriction) lhsConcept;
    OWLPropertyExpression pe = rest.getProperty();
    return getKey(pe);
  } else {
    assert false : "Invalid left hand side concept: "+lhsConcept;
    return null;
  }
}
origin: Quetzal-RDF/quetzal

/**
 * return named properties p such that c \subseteq \some inv(p) T
 * @param c
 * @return
 */
protected Set<URI> getNamedInverseSuperPropertiesOrSelf(OWLClassExpression c) {
  Set<OWLClassExpression> subs = taxo.getAllSubsumers(c);
  Set<URI> ret = new HashSet<URI>();
  for (OWLClassExpression ex: subs) {
    if (ex.getClassExpressionType().equals(ClassExpressionType.OBJECT_SOME_VALUES_FROM)) {
      OWLObjectSomeValuesFrom rest = (OWLObjectSomeValuesFrom) ex;
      OWLObjectPropertyExpression prop = rest.getProperty().getSimplified();
      if (prop.isAnonymous()) {
        OWLObjectProperty namedProp = prop.getNamedProperty();
        ret.add(namedProp.getIRI().toURI());
      }
      
    }
  }
  return ret;
  
}
/**
origin: SmartDataAnalytics/DL-Learner

@Override
protected void writeEquivalentClassesAxiom(Set<OWLClassExpression> set)
{
  String name = null;
  OWLClassExpression leftClass = null;
  for (OWLClassExpression c : set)
    if (c.getClassExpressionType() == ClassExpressionType.OWL_CLASS)
    {
      name = getShortName(c.asOWLClass());
      leftClass = c;
      break;
    }
  if (name == null)
    exit("Equivalent classes axiom " + set + " require at least one atomic class");
  for (OWLClassExpression c : set)
    if (c != leftClass)
      print("(define-concept " + name + " " + getClassName(c) + " )");
}
origin: SmartDataAnalytics/DL-Learner

  @Override
  protected void writeSubclassOfAxiom(OWLClassExpression subclass, OWLClassExpression superclass, double d)
  {
//        if (superclass.isOWLThing() != false)
    {
      ClassExpressionType type = subclass.getClassExpressionType();
      if ((type == ClassExpressionType.OWL_CLASS) && (d == 1))
        print("(define-primitive-concept " + getShortName(subclass.asOWLClass()) + " " + getClassName(superclass) + ")");
      else
        print("(implies " + getClassName(subclass) + " " + getClassName(superclass) + " " + d + ")");
    }
  }

origin: SmartDataAnalytics/DL-Learner

public static RDFResourceTree materializePropertyDomains(RDFResourceTree tree, AbstractReasonerComponent reasoner) {
  RDFResourceTree newTree = new RDFResourceTree(tree.getData());
  Consumer<OWLClass> addTypeChild = (cls) -> newTree.addChild(new RDFResourceTree(OwlApiJenaUtils.asNode(cls)), RDF.type.asNode());
  tree.getEdges().forEach(edge -> {
    List<RDFResourceTree> children = tree.getChildren(edge);
    // add existing children
    children.forEach(child -> {
      RDFResourceTree newChild = materializePropertyDomains(child, reasoner);
      newTree.addChild(newChild, edge);
    });
    // add the rdf:type statements for the property domain(s)
    OWLClassExpression dom = reasoner.getDomain(OwlApiJenaUtils.asOWLEntity(edge, EntityType.OBJECT_PROPERTY));
    if(!dom.isAnonymous() && !dom.isOWLThing()) {
      addTypeChild.accept(dom.asOWLClass());
    } else {
      if(dom.getClassExpressionType() == ClassExpressionType.OBJECT_INTERSECTION_OF) {
        dom.getNestedClassExpressions().stream()
            .filter(ce -> !ce.isAnonymous())
            .map(OWLClassExpression::asOWLClass)
            .forEach(addTypeChild);
      }
    }
  });
  return newTree;
}
org.semanticweb.owlapi.modelOWLClassExpressiongetClassExpressionType

Javadoc

Gets the class expression type for this class expression.

Popular methods of OWLClassExpression

  • asOWLClass
    If this class expression is in fact a named class then this method may be used to obtain the express
  • isAnonymous
    Determines whether or not this expression represents an anonymous class expression.
  • accept
  • isOWLThing
    Determines if this expression is the built in class owl:Thing. This method does not determine if the
  • isOWLNothing
    Determines if this expression is the built in class owl:Nothing. This method does not determine if t
  • asConjunctSet
    Interprets this expression as a conjunction and returns the conjuncts. This method does not normalis
  • asDisjunctSet
    Interprets this expression as a disjunction and returns the disjuncts. This method does not normalis
  • containsConjunct
    Determines if this class expression contains a particular conjunct. This method does not do any norm
  • getObjectComplementOf
    Gets the object complement of this class expression.
  • getSignature
  • signature
  • compareTo
  • signature,
  • compareTo,
  • getObjectPropertiesInSignature,
  • isTopEntity,
  • getComplementNNF,
  • isBottomEntity,
  • getClassesInSignature,
  • getNNF,
  • getNestedClassExpressions

Popular in Java

  • Running tasks concurrently on multiple threads
  • setScale (BigDecimal)
  • startActivity (Activity)
  • getApplicationContext (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Menu (java.awt)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • Notification (javax.management)
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now