Package com.hp.hpl.jena.ontology

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


                            model
                                    .createResource(new AnonId(UUID
                                            .randomUUID().toString()));
                    parameterResource.addProperty(RDF.type, Parameter);
                    parameterResource
                            .addProperty(hasValue, model
                                    .createTypedLiteral(tparray[i]
                                            .getParameterValue()));

                    if (tparray[i].getNamespace() != null) {
                        parameterResource.addProperty(hasNamespace, model
View Full Code Here


            // edge hasRelationship Relationship
            kamEdgeResource.addProperty(hasRelationship, relationshipResource);

            // edge hasId "1"^^xsd:int
            kamEdgeResource.addLiteral(hasId,
                    model.createTypedLiteral(kamEdge.getId()));

            Resource sourceResource =
                    kamNodeResources.get(kamEdge.getSourceNode());
            Resource targetResource =
                    kamNodeResources.get(kamEdge.getTargetNode());
View Full Code Here

                        model.createResource(new AnonId(UUID.randomUUID()
                                .toString()));

                statementResource.addProperty(RDF.type, Statement);
                statementResource.addProperty(hasId,
                        model.createTypedLiteral(statement.getId()));

                // associate statement with document
                Resource docres =
                        documents.get(statement.getBelDocumentInfo().getId());
                docres.addProperty(defines, statementResource);
View Full Code Here

                                        .randomUUID().toString()));
                        annotations.put(statementAnnotation.getId(), ares);
                    }

                    // associate annotation value to annotation
                    ares.addProperty(hasValue, model
                            .createTypedLiteral(statementAnnotation.getValue()));

                    Integer adefId =
                            statementAnnotation.getAnnotationType().getId();
                    Resource adefResource = annotationDefinitions.get(adefId);
View Full Code Here

      Resource datatype = (Resource) datatypes[i++];
      OntProperty p = model.createDatatypeProperty( ns + "prop_" + datatype.getLocalName() );
      p.addRange( datatype );

      while( i < datatypes.length && datatypes[i] instanceof String ) {
        Literal value = model.createTypedLiteral( (String) datatypes[i], datatype.getURI() );
        ind.addProperty( p, value );
        i++;
      }
    }
View Full Code Here

              + datatype.getLocalName() );
          if( addRangeRestriction ) {
                      p.addRange( datatype );
                    }

          Literal value = model.createTypedLiteral( (String) datatypes[i], datatype
              .getURI() );
          ind.addProperty( p, value );

          assertFalse( value.getLexicalForm() + " should not belong to "
              + datatype.getLocalName(), model.validate().isValid() );
View Full Code Here

      p.addRange( datatype );

      int start = i;
      while( i < datatypes.length && datatypes[i] instanceof String ) {
        Individual ind = model.createIndividual( ns + "testInd" + i, OWL.Thing );
        Literal value = model.createTypedLiteral( (String) datatypes[i], datatype.getURI() );
        ind.addProperty( p, value );

        OntClass c = model.createClass( ns + "testCls" + i );
        c.addEquivalentClass( model.createHasValueRestriction( null, p, value ) );
View Full Code Here

    c8.addEquivalentClass( model.createSomeValuesFromRestriction( null, s, model.createIntersectionClass( null, model.createList( l8 ) ) ) );
    assertFalse( model.contains(c8, RDFS.subClassOf, OWL2.Nothing ) );
   
    OntClass c9 = model.createClass( ns + "c9" );
    Resource fr9 = model.createResource();
    model.add( fr9, OWL2.maxExclusive, model.createTypedLiteral( 0 ) );
    Resource b9 = model.createResource();
    model.add( b9, RDF.type, RDFS.Datatype);
    model.add( b9, OWL2.onDatatype, i);
    model.add( b9, OWL2.withRestrictions, model.createList( new RDFNode[] { fr9 } ));
    RDFNode[] l9 = new RDFNode[2];
View Full Code Here

    OntClass C = model.createClass( ns + "C" );
    Individual a = model.createIndividual( ns + "a", C );
    Individual b = model.createIndividual( ns + "b", C );

    Literal one = model.createTypedLiteral( "1", TypeMapper.getInstance().getTypeByName(
        XSD.positiveInteger.getURI() ) );
    a.addProperty( dp, one );

    model.prepare();
View Full Code Here

    assertIteratorValues( a.listPropertyValues( op ), new Resource[] { b } );
    // check that the update occurred and that the incremental consistency
    // was used
    assertTrue( !PelletOptions.USE_INCREMENTAL_CONSISTENCY || graph.getKB().timers.getTimer( "isIncConsistent" ).getCount() == 1 );

    Literal two = model.createTypedLiteral( "2", TypeMapper.getInstance().getTypeByName(
        XSD.positiveInteger.getURI() ) );
    b.addProperty( dp, two );

    graph.getKB().isConsistent();
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.