Package com.hp.hpl.jena.ontology

Examples of com.hp.hpl.jena.ontology.OntModel.createResource()


                                "Expecting non-null URL for external annotation");
                    }

                    // associate annotation to the URL where the domain is defined
                    annotationDefResource =
                            model.createResource(annotationType.getUrl());
                    annotationDefResource.addProperty(hasName,
                            model.createTypedLiteral(annotationType.getName()));
                    annotationDefResource.addProperty(hasURL,
                            model.createTypedLiteral(annotationType.getUrl()));
                    break;
View Full Code Here


            // Retrieve seen KAMNode Resource or create a new Blank Node for it.
            Resource kamNodeResource;
            if (kamNodeResources.containsKey(kamNode)) {
                kamNodeResource = kamNodeResources.get(kamNode);
            } else {
                kamNodeResource = model.createResource(new AnonId(UUID
                        .randomUUID().toString()));

                // associate kam node with kam resource
                kamResource.addProperty(composedOf, kamNodeResource);
            }
View Full Code Here

            // handle terms for this KAMNode
            // TODO Support nested terms instead of just Parameters!
            List<BelTerm> terms = kAMStore.getSupportingTerms(kamNode);
            for (BelTerm term : terms) {
                Resource termResource = model.createResource(new AnonId(UUID
                        .randomUUID().toString()));

                termResource.addProperty(RDF.type, Term);
                termResource.addProperty(hasId,
                        model.createTypedLiteral(term.getId()));
View Full Code Here

                        .toArray(new TermParameter[termParameters.size()]);
                Resource[] tpresarray = new Resource[tparray.length];

                // iterate term parameters to pre-build RDF resources and associate Parameter
                for (int i = 0; i < tparray.length; i++) {
                    tpresarray[i] = model.createResource(new AnonId(UUID
                            .randomUUID().toString()));
                    tpresarray[i].addProperty(RDF.type, RDF.List);

                    Resource parameterResource =
                            model
View Full Code Here

                    tpresarray[i] = model.createResource(new AnonId(UUID
                            .randomUUID().toString()));
                    tpresarray[i].addProperty(RDF.type, RDF.List);

                    Resource parameterResource =
                            model
                                    .createResource(new AnonId(UUID
                                            .randomUUID().toString()));
                    parameterResource.addProperty(RDF.type, Parameter);
                    parameterResource
                            .addProperty(hasValue, model
View Full Code Here

            Resource relationshipResource =
                    KAMVocabulary.resourceForRelationship(kamEdge
                            .getRelationshipType());

            Resource kamEdgeResource =
                    model.createResource(new AnonId(UUID.randomUUID()
                            .toString()));

            // associate kam edge with kam resource
            kamResource.addProperty(composedOf, kamEdgeResource);
View Full Code Here

                        .getClass())) {
                    continue;
                }

                Resource statementResource =
                        model.createResource(new AnonId(UUID.randomUUID()
                                .toString()));

                statementResource.addProperty(RDF.type, Statement);
                statementResource.addProperty(hasId,
                        model.createTypedLiteral(statement.getId()));
View Full Code Here

                for (Annotation statementAnnotation : statementAnnotations) {
                    Resource ares =
                            annotations.get(statementAnnotation.getId());
                    if (ares == null) {
                        ares =
                                model.createResource(new AnonId(UUID
                                        .randomUUID().toString()));
                        annotations.put(statementAnnotation.getId(), ares);
                    }

                    // associate annotation value to annotation
View Full Code Here

    }
   
    private void doTestDatatypeRangeValidation(RDFDatatype over12Type, OntModelSpec spec) {
        String NS = "http://jena.hpl.hp.com/example#";
        OntModel ont = ModelFactory.createOntologyModel(spec);
        Resource over12 = ont.createResource( over12Type.getURI() );
        DatatypeProperty hasValue = ont.createDatatypeProperty(NS + "hasValue");
        hasValue.addRange( over12 );
       
        ont.createResource(NS + "a").addProperty(hasValue, "15", over12Type);
        ont.createResource(NS + "b").addProperty(hasValue, "16", XSDDatatype.XSDinteger);
View Full Code Here

        OntModel ont = ModelFactory.createOntologyModel(spec);
        Resource over12 = ont.createResource( over12Type.getURI() );
        DatatypeProperty hasValue = ont.createDatatypeProperty(NS + "hasValue");
        hasValue.addRange( over12 );
       
        ont.createResource(NS + "a").addProperty(hasValue, "15", over12Type);
        ont.createResource(NS + "b").addProperty(hasValue, "16", XSDDatatype.XSDinteger);
        ont.createResource(NS + "c").addProperty(hasValue, "10", XSDDatatype.XSDinteger);
       
        ValidityReport validity = ont.validate();
        assertTrue (! validity.isValid());
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.