Examples of AnnotationProperty


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

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

    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

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

        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

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

    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

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

    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

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

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

  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

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

            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

Examples of de.espend.idea.php.annotation.dict.AnnotationProperty

            String propertyName = field.getName();

            // private $isNillable = false;
            PhpType type = field.getType();
            if(type.toString().equals("bool")) {
                completionResultSet.addElement(new PhpAnnotationPropertyLookupElement(new AnnotationProperty(propertyName, AnnotationPropertyEnum.BOOLEAN)));
                return;
            }

            // private $isNillable = array();
            if(type.toString().equals("array")) {
                completionResultSet.addElement(new PhpAnnotationPropertyLookupElement(new AnnotationProperty(propertyName, AnnotationPropertyEnum.ARRAY)));
                return;
            }

            PhpDocComment docComment = field.getDocComment();
            if(docComment != null) {
                for(PhpDocTag varDocTag: docComment.getTagElementsByName("@var")) {
                    PhpPsiElement phpPsiElement = varDocTag.getFirstPsiChild();
                    if(phpPsiElement != null) {
                        String typeText = phpPsiElement.getText().toLowerCase();
                        if(!StringUtils.isBlank(typeText)) {

                            // @var array<string>
                            if(typeText.startsWith("array")) {
                                completionResultSet.addElement(new PhpAnnotationPropertyLookupElement(new AnnotationProperty(propertyName, AnnotationPropertyEnum.ARRAY)));
                                return;
                            }

                            if(typeText.equals("integer") || typeText.equals("int")) {
                                completionResultSet.addElement(new PhpAnnotationPropertyLookupElement(new AnnotationProperty(propertyName, AnnotationPropertyEnum.INTEGER)));
                                return;
                            }

                            if(typeText.equals("boolean") || typeText.equals("bool")) {
                                completionResultSet.addElement(new PhpAnnotationPropertyLookupElement(new AnnotationProperty(propertyName, AnnotationPropertyEnum.BOOLEAN)));
                                return;
                            }

                        }
                    }
                }
            }

            // public $var = array();
            if(field.getDefaultValue() instanceof ArrayCreationExpression) {
                completionResultSet.addElement(new PhpAnnotationPropertyLookupElement(new AnnotationProperty(propertyName, AnnotationPropertyEnum.ARRAY)));
                return;
            }

            // fallback
            completionResultSet.addElement(new PhpAnnotationPropertyLookupElement(new AnnotationProperty(propertyName, AnnotationPropertyEnum.STRING)));
        }
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.