Package com.hp.hpl.jena.ontology

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


    String ns = "http://www.example.org/test#";

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC );
    model.setStrictMode( false );

    DatatypeProperty dp = model.createDatatypeProperty( ns + "dp" );

    ObjectProperty op = model.createObjectProperty( ns + "op" );

    OntClass C = model.createClass( ns + "C" );
    Individual anon1 = model.createIndividual( C );
View Full Code Here


  }

  public void testDataPropJenaToOwl() {
            JenaToOwlConvert j2o = new JenaToOwlConvert();
            OntModel model = ModelFactory.createOntologyModel();
            DatatypeProperty jp = model.createDatatypeProperty(DP.toString());
            OWLDataProperty wp = null;
            try{
                wp = j2o.DataPropJenaToOwl(jp, RDFXML);
                if(wp==null){
                    fail("Some problem accours");
                }else{
                      assertEquals(wp.getIRI().toURI().toString(), jp.getURI().toString());
                }
            }catch (Exception e) {
    e.printStackTrace();
    fail("Exception caugth");
            } finally {
View Full Code Here

  public void testDataPropOwlToJena() {
    JenaToOwlConvert j2o = new JenaToOwlConvert();
    OWLOntologyManager mgr = OWLManager.createOWLOntologyManager();
    OWLDataFactory factory = mgr.getOWLDataFactory();
    OWLDataProperty dp = factory.getOWLDataProperty(IRI.create(DP));
    DatatypeProperty jdp = null;
    try {
                    jdp = j2o.DataPropOwlToJena(dp, RDFXML);
                    if(jdp == null){
                        fail("Some errors accour");
                    }else{
                        assertEquals(jdp.getURI(), dp.getIRI().toString());
                    }
    } catch (Exception e) {
      e.printStackTrace();
      fail("Exception caught");
    } finally {
View Full Code Here

            JenaToOwlConvert j2o = new JenaToOwlConvert();
            OntModel model = ModelFactory.createOntologyModel();

            OntClass jenaclass = model.createClass(CLAZZ.toString());
            ObjectProperty jenaobprop = model.createObjectProperty(OP.toString());
            DatatypeProperty jenadataprop = model.createDatatypeProperty(DP.toString());
            Individual jenasub = model.createIndividual(SUBJECT.toString(), jenaclass);
            Individual jenaobj = model.createIndividual(OBJECT.toString(), jenaclass);
            AnnotationProperty jenaanno = model.createAnnotationProperty(label.toString());
            Literal value = model.createTypedLiteral(VALUE,DATATYPE.toString());
View Full Code Here

TOP

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

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.