Package com.hp.hpl.jena.ontology

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


    }

    public void testAnnotationPropJenaToOwl() {
        JenaToOwlConvert j2o = new JenaToOwlConvert();
        OntModel model = ModelFactory.createOntologyModel();
        AnnotationProperty jp = model.createAnnotationProperty(label.toString());
        OWLAnnotationProperty wp = null;
        try {
            wp = j2o.AnnotationPropJenaToOwl(jp, RDFXML);
            if (wp == null) {
                fail("Some errors occur");
            } else {
                assertEquals(wp.getIRI().toURI().toString(), jp.getURI().toString());
            }
        } catch (Exception e) {
            e.printStackTrace();
            fail("Exception caugth");
        } finally {
View Full Code Here


    public void testAnnotationPropOwlToJena() {
        JenaToOwlConvert j2o = new JenaToOwlConvert();
        OWLOntologyManager mgr = OWLManager.createOWLOntologyManager();
        OWLDataFactory factory = mgr.getOWLDataFactory();
        OWLAnnotationProperty wp = factory.getOWLAnnotationProperty(IRI.create(label));
        AnnotationProperty jp = null;
        try {
            jp = j2o.AnnotationPropOwlToJena(wp, RDFXML);
            if (jp == null) {
                fail("Some errors occur");
            } else {
                assertEquals(wp.getIRI().toURI().toString(), jp.getURI().toString());
            }
        } catch (Exception e) {
            e.printStackTrace();
            fail("Exception caugth");
        } finally {
View Full Code Here

        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());

        model.add(jenasub, jenaobprop, jenaobj);
        model.add(jenasub, jenadataprop, value);
        model.add(jenasub, jenaanno, "Lucy", "en");
View Full Code Here

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, null );

    ObjectProperty p = model.createObjectProperty( "p" );
    ObjectProperty t = model.createObjectProperty( "t" );
    DatatypeProperty q = model.createDatatypeProperty( "q" );
    AnnotationProperty r = model.createAnnotationProperty( "r" );

    Individual a = model.createIndividual( "a", OWL.Thing );
    Individual b = model.createIndividual( "b", OWL.Thing );

    model.add( t, RDF.type, OWL.TransitiveProperty );
View Full Code Here

    OntModel model = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, null );

    ObjectProperty p = model.createObjectProperty( "p" );
    ObjectProperty t = model.createObjectProperty( "t" );
    DatatypeProperty q = model.createDatatypeProperty( "q" );
    AnnotationProperty r = model.createAnnotationProperty( "r" );

    Individual a = model.createIndividual( "a", OWL.Thing );
    Individual b = model.createIndividual( "b", OWL.Thing );

    model.add( t, RDF.type, OWL.TransitiveProperty );
View Full Code Here

  }

  public void testAnnotationPropJenaToOwl() {
            JenaToOwlConvert j2o = new JenaToOwlConvert();
            OntModel model = ModelFactory.createOntologyModel();
            AnnotationProperty jp = model.createAnnotationProperty(label.toString());
            OWLAnnotationProperty wp = null;
            try{
                wp = j2o.AnnotationPropJenaToOwl(jp, RDFXML);
                if(wp==null){
                    fail("Some errors occur");
                }else{
                    assertEquals(wp.getIRI().toURI().toString(), jp.getURI().toString());
                }
            }catch (Exception e){
                e.printStackTrace();
    fail("Exception caugth");
            } finally {
View Full Code Here

  public void testAnnotationPropOwlToJena() {
            JenaToOwlConvert j2o = new JenaToOwlConvert();
            OWLOntologyManager mgr = OWLManager.createOWLOntologyManager();
            OWLDataFactory factory = mgr.getOWLDataFactory();
            OWLAnnotationProperty wp = factory.getOWLAnnotationProperty(IRI.create(label));
            AnnotationProperty jp = null;
            try{
                jp = j2o.AnnotationPropOwlToJena(wp, RDFXML);
                if(jp==null){
                    fail("Some errors occur");
                }else{
                    assertEquals(wp.getIRI().toURI().toString(), jp.getURI().toString());
                }
            }catch (Exception e){
                e.printStackTrace();
    fail("Exception caugth");
            } finally {
View Full Code Here

            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());

            model.add(jenasub, jenaobprop, jenaobj);
            model.add(jenasub,jenadataprop,value);
            model.add(jenasub,jenaanno,"Lucy","en");
View Full Code Here

TOP

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

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.