Package com.hp.hpl.jena.ontology

Examples of com.hp.hpl.jena.ontology.UnionClass


    }
  }

  Resource toOWL(OntModel ont, String uri, boolean createAnon, Context ctx) {
    schema xs = (schema) this.get_owner();
    UnionClass u = null;
   
    // get (resolved) member types
    Vector<MemberType> v = get_memberTypes(ctx);
    Set<Resource> r = new HashSet<Resource>()
   
View Full Code Here


        if (t!=null && (p.getRange()==null || !p.getRange().equals(t)))
          restrictions.add(xs.ont.createAllValuesFromRestriction(null,p,t));         
      }
      else if (s.size()>1) {
        // create an OWL union
        UnionClass u = xs.ont.createUnionClass(null,xs.ont.createList(s.iterator()));
        restrictions.add(xs.ont.createAllValuesFromRestriction(null,p,u));
      }
    }
    return restrictions;
  }
View Full Code Here

   
    _prepareInfoAboutOntology(ontModel);
   
    ExtendedIterator<UnionClass> unionClasses = ontModel.listUnionClasses();
    while ( unionClasses.hasNext() ) {
      UnionClass uclass = (UnionClass) unionClasses.next();
      String id = uclass.isAnon() ? uclass.getId().getLabelString() : uclass.getURI();
      _unionClasses.put(id , uclass);
//      System.err.println("XXXXXX UnionClass " +id+ " -> " +uclass);
    }
   
    // add the named classes:
View Full Code Here

      _propDomains.put(prop, domains);
    }
   
    if ( domain.isAnon() ) {
      String id = domain.getId().getLabelString();
      UnionClass unionClass = _unionClasses.get(id);
      List<RDFNode> operands = unionClass.getOperands().asJavaList();
      for ( RDFNode node : operands ) {
        if ( node instanceof Resource ) {
          Resource rsr = (Resource) node;
          if ( ! rsr.isAnon() ) {
            // rsr should be a class
View Full Code Here

         for(DatatypeProperty datatype : conjuntoEntrada){
            //Verifica se o Datatype é usado por multiplas classes
            if(datatype.getDomain().asClass().isUnionClass()){
                //é usado por multiplas classes
                //recuperar um iterador sobre o conjunto
                UnionClass uniao = datatype.getDomain().asClass().asUnionClass();
                ExtendedIterator<? extends OntClass> iterador = uniao.listOperands();
                //verifica se a classe passada é uma das classes do conjunto
                while(iterador.hasNext()){
                    OntClass classe = (OntClass) iterador.next();
                    //Se a classe passada faz parte do conjunto adicionar ao conjunto de retorno
                    if(classe.getLocalName().equals(ontClass.getLocalName())){
View Full Code Here

        } else {
            // Add domains to union class
            OntResource domain = objectProperty.getDomain();
            if (domain != null) {
                if (domain.isClass() && domain.asClass().isUnionClass()) {
                    UnionClass unclass = domain.asClass().asUnionClass();
                    for (Resource newDomain : domains) {
                        unclass.addOperand(newDomain);
                    }
                } else {
                    List<Resource> resources = new ArrayList<Resource>(domains);
                    resources.add(domain);
                    objectProperty.setDomain(createUnionClass(resources));
                }
            }

            // Add ranges to union class

            OntResource range = objectProperty.getRange();
            if (range != null) {
                if (range.isClass() && range.asClass().isUnionClass()) {
                    UnionClass unclass = range.asClass().asUnionClass();
                    for (Resource newRange : ranges) {
                        unclass.addOperand(newRange);
                    }
                } else {
                    List<Resource> resources = new ArrayList<Resource>(ranges);
                    resources.add(range);
                    objectProperty.setDomain(createUnionClass(resources));
View Full Code Here

        } else {
            // Add domains to union class
            OntResource domain = datatypeProperty.getDomain();
            if (domain != null) {
                if (domain.isClass() && domain.asClass().isUnionClass()) {
                    UnionClass unclass = domain.asClass().asUnionClass();
                    for (Resource newDomain : domains) {
                        unclass.addOperand(newDomain);
                    }
                } else {
                    List<Resource> resources = new ArrayList<Resource>(domains);
                    resources.add(domain);
                    datatypeProperty.setDomain(createUnionClass(resources));
View Full Code Here

        return;
      }
     
      // unionOf
      else if (c.isUnionClass()) { // in form of unionOf or intersectionOf
        UnionClass uc = c.asUnionClass();
          for (Iterator<? extends OntClass> i = uc.listOperands(); i.hasNext(); ) {
              try {
                OntResource op = i.next();
//                OntClass op = (OntClass) i.next();
                getMembers(op, resources, recursive);
              } catch (ConversionException e) {
View Full Code Here

    // Iterate all "union classes"
    while (unionClasses.hasNext()) {

      Resource resource = (Resource) unionClasses.next();
      UnionClass unionClass = ((OntClass) resource).asUnionClass();
      Iterator ops = unionClass.listOperands();

      // Iterate the members of this "union class"
      while (ops.hasNext()) {
        OntClass op = (OntClass) ops.next();

        // Find the union class that has this concept/class as a
        // member.
        if (op.getURI() == ontClass.getURI()) {

          // Get the properties binded with this "named class".
          Iterator ittt = unionClass.listDeclaredProperties(direct);
          while (ittt.hasNext()) {
            OntProperty ontProperty = (OntProperty) ittt.next();
            if (ontProperty != null) {
              if (ontProperty.getDomain() == null
                  || ontProperty.getDomain() == OWL.Thing)
View Full Code Here

    // Iterate all "union classes"
    while (unionClasses.hasNext()) {

      Resource resource = (Resource) unionClasses.next();
      UnionClass unionClass = ((OntClass) resource).asUnionClass();
      Iterator ops = unionClass.listOperands();

      // Iterate the members of this "union class"
      while (ops.hasNext()) {
        OntClass op = (OntClass) ops.next();

        // Find the union class that has this concept/class as a
        // member.
        if (op.getURI() == ontClass.getURI()) {

          // Get the properties binded with this "named class".
          Iterator ittt = unionClass.listDeclaredProperties(direct);
          while (ittt.hasNext()) {
            OntProperty ontProperty = (OntProperty) ittt.next();
            if (ontProperty != null) {
              if (ontProperty.getDomain() == null
                  || ontProperty.getDomain() == OWL.Thing)
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.ontology.UnionClass

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.