Package org.semanticweb.owl.model

Examples of org.semanticweb.owl.model.OWLClass


      // get a random permutation of the set of concepts
      ArrayList<OWLClass> startingPoint = new ArrayList<OWLClass>();
      while (!concepts.isEmpty())
      {
        Object[] tmp = concepts.toArray();
        OWLClass c = (OWLClass) tmp[random.nextInt(concepts.size())];
        startingPoint.add(c);
        concepts.remove(c);
      }
      return startingPoint;
    }
View Full Code Here


    }


    public void handleTriple(URI subject, URI predicate, URI object) throws OWLException {
        OWLIndividual ind = getDataFactory().getOWLIndividual(subject);
        OWLClass skosConcept = getDataFactory().getOWLClass(SKOSVocabulary.CONCPET.getURI());
        addAxiom(getDataFactory().getOWLClassAssertionAxiom(ind, skosConcept));
    }
View Full Code Here

    int s = step.getNextStepSize();
    if (s <= 0)
      return null;
    for (int i = 0; i < s && !remainingConcepts.isEmpty(); i++)
    {
      OWLClass c = (OWLClass) remainingConcepts.get(0);
      selection.add(c);
      remainingConcepts.remove(c);
    }
    return selection;
  }
View Full Code Here

      for (int i = 0; i < s;)
      {
        if (k < list.length)
        {
          Map.Entry<OWLClass, Integer> entry = (Map.Entry<OWLClass, Integer>)list[k++];
          OWLClass c = entry.getKey();
          //System.out.println(c.toString());
          Object[] sclasses = c.getSuperClasses(tbox).toArray();
          for (int j = 0; j < sclasses.length && i < s; j++)
          {
            OWLDescription sclassDescription = (OWLDescription) sclasses[j];
            if (sclassDescription.isAnonymous())
              continue;
            OWLClass sclass = sclassDescription.asOWLClass();
            if (sclass != null && !selection.contains(sclass))
            {
              //System.out.println("--->" + sclass.toString());
              selection.add(sclass);
              remainingConcepts.remove(sclass);
View Full Code Here

        return false;
    }


    public void handleTriple(URI subject, URI predicate, URI object) throws OWLException {
        OWLClass cls = (OWLClass) translateDescription(subject);
        Set<OWLDescription> descriptions = getConsumer().translateToDescriptionSet(object);
        addAxiom(getDataFactory().getOWLDisjointUnionAxiom(cls, descriptions));
        consumeTriple(subject, predicate, object);
    }
View Full Code Here

    public void handle(String id, String value) {
        URI propURI = getURIFromValue(value.substring(0, value.indexOf(' ')).trim());
        URI fillerURI = getURIFromValue(value.substring(value.indexOf(' '), value.length()).trim());
        OWLObjectProperty prop = getDataFactory().getOWLObjectProperty(propURI);
        OWLClass filler = getDataFactory().getOWLClass(fillerURI);
        OWLDescription restriction = getDataFactory().getOWLObjectSomeRestriction(prop, filler);
        OWLClass subCls = getDataFactory().getOWLClass(getURIFromValue(id));
        applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLSubClassAxiom(subCls, restriction)));
    }
View Full Code Here

    for (OWLLogicalAxiom la : logicalAxioms){
      Set<OWLEntity> tmp = la.getReferencedEntities();
      for (OWLEntity e : tmp){
        URI entityURI = e.getURI();
        if (e.isOWLClass()){
          OWLClass owlClass = e.asOWLClass();
          if ( (!owlClass.isAnonymous()) && (!owlClass.isOWLNothing()) && (!owlClass.isOWLThing()) && (!owlClass.isBuiltIn()) ){
            if (!entityURI.toString().startsWith("http://www.w3.org/")){
              //boolean wasIn = this.concepts.add((OWLClass)e);
              this.concepts.add((OWLClass)e);
              /*
              if (wasIn){
View Full Code Here

        // BUGFIX (TS): added the two cases where a disj union axiom *is* local:
        // - if LHS and all class descr on RHS are bot-equiv
        // - if RHS is top-equiv, one descr on LHS is top-equiv and the others are bot-equiv
        public void visit(OWLDisjointUnionAxiom axiom) {
            OWLClass lhs = axiom.getOWLClass();
            Collection<OWLDescription> rhs = axiom.getDescriptions();
            switch (localityCls) {
                case BOTTOM_BOTTOM:
                    if (!signature.contains(lhs)) {
                        for (OWLDescription desc : rhs) {
View Full Code Here

    }


    public void handle(String id, String value) {
        OWLObjectProperty prop = getOWLObjectProperty(getConsumer().getCurrentId());
        OWLClass cls = getOWLClass(value);
        applyChange(new AddAxiom(getOntology(), getDataFactory().getOWLObjectPropertyDomainAxiom(prop, cls)));
    }
View Full Code Here

        String token = clazz.getURI().toString();
        if (!StringUtils.contains(token,("#")))
            return false;
        token= token.substring(token.lastIndexOf("#"));
        Iterator iter = classes.iterator();
        OWLClass current_clazz;
        while(iter.hasNext()) {
            current_clazz = (OWLClass) iter.next();
            //System.out.println(token + "is in " + current_clazz.getURI().toString() + " " + (current_clazz.getURI().toString().indexOf(token)>=0) );
            if (current_clazz.getURI().toString().indexOf(token)>=0) {               
                return true;
            }
        }
      } catch(Exception e) {
        throw new MatchingException(e.getMessage());
View Full Code Here

TOP

Related Classes of org.semanticweb.owl.model.OWLClass

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.