Package com.hp.hpl.jena.ontology

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


         
      if ( obj.isAnon() ) {
        String id = ((Resource) obj).getId().getLabelString();
        objName = id;
        Map<String, Restriction> restrictions = _info.getRestrictions();
        Restriction restr = restrictions.get(id);
        if ( restr != null ) {
          objName = _getRestrictionDescription(restr);
        }
      }
      else if ( objName == null ) {
View Full Code Here


   

   
    ExtendedIterator<?> restrs = ontModel.listRestrictions();
    while ( restrs.hasNext() ) {
      Restriction restr = (Restriction) restrs.next();
      String id = restr.isAnon() ? restr.getId().getLabelString() : restr.getURI();
      _restrictions.put(id , restr);
//      System.err.println("XXXXXX Restriction " +id+ " -> " +restr);
    }
  }
View Full Code Here

                       List<ConceptRestriction> relacionamentosSup = recuperarRelacionamentosSup(aux, ontClass.getLocalName());
                       for(ConceptRestriction conRest : relacionamentosSup){
                         tmpConcept.addConceptRestriction(conRest);
                       }
                   }else{ //eh um restriction
                       Restriction restriction = aux.asRestriction();
                       ConceptRestriction conRest = recuperarDadosRestriction(restriction, tmpConcept.getNome());
                       tmpConcept.addConceptRestriction(conRest);
                      
//                       //Verificar se existe mais de uma classe no range do OP e criar disjoints
//                     ObjectProperty op = parser.recuperarObjectProperty(conRest.getNomeProperty());
View Full Code Here

                Iterator<OntClass> it = ontClass.listSuperClasses(true);
                OntClass aux = null;
                while(it.hasNext()){
                    aux = it.next();
                    if(aux.getLocalName() == null){
                      Restriction restriction = aux.asRestriction();
                        relacionamentos.add(recuperarDadosRestriction(restriction, nomeConceitoBase));
                    }else{
                      relacionamentos.addAll(recuperarRelacionamentosSup(aux, nomeConceitoBase));
                    }
                }
View Full Code Here

      if (r==null)
        return null;
      OntModel local = (OntModel)localOntology.getImplementation();
      if (contains(r))
        return r;
      Restriction restrict = null;
      OntProperty ont = null;
      if (r.isAllDifferent()) {
        debugDisplay("  asAllDifferent              ");// + r.asAllDifferent() );       
        return local.createAllDifferent(r.asAllDifferent().getDistinctMembers());
        }
View Full Code Here

    OntModel pellet = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, ont );
    assertTrue( pellet.contains( x, p1, y ) );
    assertTrue( pellet.contains( x, p1, z ) );

    Restriction min = ont.createMinCardinalityRestriction( null, p1, 2 );
    Restriction max = ont.createMaxCardinalityRestriction( null, p1, 3 );
    Restriction card = ont.createCardinalityRestriction( null, p1, 2 );
    Statement[] statements = new Statement[] {
        ont.createStatement( p1, RDF.type, OWL.FunctionalProperty ),
        ont.createStatement( p1, RDF.type, OWL.InverseFunctionalProperty ),
        ont.createStatement( p1, RDF.type, OWL2.IrreflexiveProperty ),
        ont.createStatement( p1, RDF.type, OWL2.AsymmetricProperty ),
View Full Code Here

    OntModel pellet = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, ont );
    assertTrue( pellet.contains( x, p1, y ) );
    assertTrue( pellet.contains( x, p1, z ) );

    Restriction min = ont.createMinCardinalityRestriction( null, p1, 2 );
    Restriction max = ont.createMaxCardinalityRestriction( null, p1, 3 );
    Restriction card = ont.createCardinalityRestriction( null, p1, 2 );
    Statement[] statements = new Statement[] {
        ont.createStatement( p1, RDF.type, OWL.FunctionalProperty ),
        ont.createStatement( p1, RDF.type, OWL.InverseFunctionalProperty ),
        ont.createStatement( p1, RDF.type, OWL2.IrreflexiveProperty ),
        ont.createStatement( p1, RDF.type, OWL2.AsymmetricProperty ),
View Full Code Here

        ExtendedIterator<Restriction> it = ontModel.listRestrictions();       
        try
        {
            while (it.hasNext())
            {
                Restriction restriction = it.next();     
                if (restriction.canAs(AllValuesFromRestriction.class))
                {
                    AllValuesFromRestriction avfr = restriction.asAllValuesFromRestriction();
                    if (avfr.getOnProperty().equals(property) && avfr.hasAllValuesFrom(ontClass))
                    {
                        ExtendedIterator<OntClass> classIt = avfr.listSubClasses(true);
                        try
                        {
View Full Code Here

TOP

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

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.