Examples of OWLDataPropertyAssertionAxiom


Examples of org.semanticweb.owl.model.OWLDataPropertyAssertionAxiom

    OWLIndividual conceptOwlIndiv = owlDataFactory.getOWLIndividual(conceptUri);
   
    // rdfs:label
    if ( id.trim().length() > 0 ) {
      OWLTypedConstant owlc = owlDataFactory.getOWLTypedConstant(id.trim());
      OWLDataPropertyAssertionAxiom addProp = owlDataFactory.getOWLDataPropertyAssertionAxiom(
          conceptOwlIndiv, rdfsLabel, owlc);
      owlChanges.add(new AddAxiom(owlOntology, addProp));
    }

    // rdfs:comment
    if ( description.trim().length() > 0 ) {
      OWLTypedConstant owlc = owlDataFactory.getOWLTypedConstant(description.trim());
      OWLDataPropertyAssertionAxiom addProp = owlDataFactory.getOWLDataPropertyAssertionAxiom(
          conceptOwlIndiv, rdfsComment, owlc);
      owlChanges.add(new AddAxiom(owlOntology, addProp));
    }
   
    // canonicalUnits
    if ( canonicalUnits != null && canonicalUnits.trim().length() > 0 ) {
      OWLTypedConstant owlc = owlDataFactory.getOWLTypedConstant(canonicalUnits.trim());
      OWLDataPropertyAssertionAxiom addProp = owlDataFactory.getOWLDataPropertyAssertionAxiom(
          conceptOwlIndiv, canonicalUnitsProp, owlc);
      owlChanges.add(new AddAxiom(owlOntology, addProp));
    }
   
    // grib
    if ( grib != null && grib.trim().length() > 0 ) {
      OWLTypedConstant owlc = owlDataFactory.getOWLTypedConstant(grib.trim());
      OWLDataPropertyAssertionAxiom addProp = owlDataFactory.getOWLDataPropertyAssertionAxiom(
          conceptOwlIndiv, gribProp, owlc);
      owlChanges.add(new AddAxiom(owlOntology, addProp));
    }
    // amip
    if ( amip != null && amip.trim().length() > 0 ) {
      OWLTypedConstant owlc = owlDataFactory.getOWLTypedConstant(amip.trim());
      OWLDataPropertyAssertionAxiom addProp = owlDataFactory.getOWLDataPropertyAssertionAxiom(
          conceptOwlIndiv, amipProp, owlc);
      owlChanges.add(new AddAxiom(owlOntology, addProp));
    }
  }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom

    }

    @Test
    public void shouldBuildDataPropertyAssertion() {
        // given
        OWLDataPropertyAssertionAxiom expected = df
                .getOWLDataPropertyAssertionAxiom(dp, i, lit, annotations);
        BuilderDataPropertyAssertion builder = new BuilderDataPropertyAssertion(
                expected, df);
        // when
        OWLObject built = builder.buildObject();
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom

        // Now let's specify that :John is aged 51. Get hold of a data property
        // called :hasAge
        OWLDataProperty hasAge = factory.getOWLDataProperty(":hasAge", pm);
        // To specify that :John has an age of 51 we create a data property
        // assertion and add it to the ontology
        OWLDataPropertyAssertionAxiom dataPropertyAssertion = factory
                .getOWLDataPropertyAssertionAxiom(hasAge, john, 51);
        manager.addAxiom(ontology, dataPropertyAssertion);
        // Note that the above is a shortcut for creating a typed literal and
        // specifying this typed literal as the value of the property assertion.
        // That is, Get hold of the xsd:integer datatype
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom

        // Now let's specify that :John is aged 51.
        // Get hold of a data property called :hasAge
        OWLDataProperty hasAge = df.getOWLDataProperty(":hasAge", pm);
        // To specify that :John has an age of 51 we create a data property
        // assertion and add it to the ontology
        OWLDataPropertyAssertionAxiom dataPropertyAssertion = df
                .getOWLDataPropertyAssertionAxiom(hasAge, john, 51);
        m.addAxiom(o, dataPropertyAssertion);
    }
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom

        OWLDataProperty q = df.getOWLDataProperty(IRI.create(ns, "q"));
        OWLOntology ontology = m.createOntology(ont);
        OWLIndividual ind = df.getOWLAnonymousIndividual();
        OWLObjectPropertyAssertionAxiom ax1 = df
                .getOWLObjectPropertyAssertionAxiom(p, i, ind);
        OWLDataPropertyAssertionAxiom ax2 = df
                .getOWLDataPropertyAssertionAxiom(q, ind, df.getOWLLiteral(5));
        m.addAxiom(ontology, ax1);
        m.addAxiom(ontology, ax2);
        OWLOntology reload = roundTrip(ontology);
        equal(ontology, reload);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom

        OWLOntology ont = getOWLOntology("ont");
        OWLDataProperty prop = DataProperty(iri("prop"));
        OWLNamedIndividual indA = NamedIndividual(iri("indA"));
        OWLLiteral lit = Literal(3);
        OWLOntologyManager man = ont.getOWLOntologyManager();
        OWLDataPropertyAssertionAxiom ax = DataPropertyAssertion(prop, indA,
                lit);
        man.addAxiom(ont, ax);
        performAxiomTests(ont, ax);
        assertTrue(ont.getDataPropertyAssertionAxioms(indA).contains(ax));
        assertTrue(ont.getAxioms(indA, EXCLUDED).contains(ax));
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom

        OWLClassAssertionAxiom axiomobj = factory.getOWLClassAssertionAxiom(cls, obj); // Istanza
        OWLObjectPropertyAssertionAxiom axiomop = factory.getOWLObjectPropertyAssertionAxiom(op, sub, obj); // Obj
                                                                                                            // prop
                                                                                                            // tra
                                                                                                            // individui
        OWLDataPropertyAssertionAxiom axiomvalue = factory
                .getOWLDataPropertyAssertionAxiom(dp, obj, literal1); // Dataprop all'istanza;
        OWLAnnotationAssertionAxiom axioman = factory.getOWLAnnotationAssertionAxiom(cls.getIRI(), oav); // Annotazione

        mgr.addAxiom(ont, daxiomcls);
        mgr.addAxiom(ont, daxiomop);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom

        OWLClassAssertionAxiom axiomobj = factory.getOWLClassAssertionAxiom(cls, obj); // Istanza
        OWLObjectPropertyAssertionAxiom axiomop = factory.getOWLObjectPropertyAssertionAxiom(op, sub, obj); // Obj
                                                                                                            // prop
                                                                                                            // tra
                                                                                                            // individui
        OWLDataPropertyAssertionAxiom axiomvalue = factory
                .getOWLDataPropertyAssertionAxiom(dp, sub, literal1); // Dataprop all'istanza;
        OWLAnnotationAssertionAxiom axioman = factory.getOWLAnnotationAssertionAxiom(cls.getIRI(), oav); // Annotazione

        mgr.addAxiom(ont, daxiomcls);
        mgr.addAxiom(ont, daxiomop);
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom

      
            //Add the rule istance
            OWLClassAssertionAxiom classAssertion = factory.getOWLClassAssertionAxiom(ontocls,ontoind);
            owlmanager.addAxiom(owlmodel, classAssertion);
            //Add the rule Body and Head
            OWLDataPropertyAssertionAxiom dataPropAssertion = factory.getOWLDataPropertyAssertionAxiom(bodyhead, ontoind, ruleBodyHead);
            owlmanager.addAxiom(owlmodel, dataPropAssertion);
   
            if((ruleDescription!=null))
                if(!ruleDescription.isEmpty()){
                //Add the rule description
View Full Code Here

Examples of org.semanticweb.owlapi.model.OWLDataPropertyAssertionAxiom

      
              //Add the rule istance
              OWLClassAssertionAxiom classAssertion = factory.getOWLClassAssertionAxiom(ontocls,ontoind);
              owlmanager.addAxiom(owlmodel, classAssertion);
              //Add the rule Body and Head
              OWLDataPropertyAssertionAxiom dataPropAssertion = factory.getOWLDataPropertyAssertionAxiom(bodyhead, ontoind, ruleBodyHead);
              owlmanager.addAxiom(owlmodel, dataPropAssertion);
             
              if(ruleDescription!=null)
              if(!ruleDescription.isEmpty()){
                  //Add the rule description
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.