Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.Model.createTypedLiteral()


  {
    final Model m = ModelHelper.modelWithStatements(this, "");
    Assert.assertEquals(true, m.createResource("eh:/foo").isURIResource());
    Assert.assertEquals(false, m.createResource().isURIResource());
    Assert.assertEquals(false, m.createTypedLiteral(17).isURIResource());
    Assert.assertEquals(false, m.createTypedLiteral("hello")
        .isURIResource());
  }

  public void testLiteralAsResourceThrows()
  {
View Full Code Here


  public void testIsAnon()
  {
    final Model m = ModelHelper.modelWithStatements(this, "");
    Assert.assertEquals(false, m.createResource("eh:/foo").isAnon());
    Assert.assertEquals(true, m.createResource().isAnon());
    Assert.assertEquals(false, m.createTypedLiteral(17).isAnon());
    Assert.assertEquals(false, m.createTypedLiteral("hello").isAnon());
  }

  public void testIsLiteral()
  {
View Full Code Here

  {
    final Model m = ModelHelper.modelWithStatements(this, "");
    Assert.assertEquals(false, m.createResource("eh:/foo").isAnon());
    Assert.assertEquals(true, m.createResource().isAnon());
    Assert.assertEquals(false, m.createTypedLiteral(17).isAnon());
    Assert.assertEquals(false, m.createTypedLiteral("hello").isAnon());
  }

  public void testIsLiteral()
  {
    final Model m = ModelHelper.modelWithStatements(this, "");
View Full Code Here

       
        Resource release = model.createResource(DOAP.Version) ;
        system.addProperty(DOAP.release, release) ;
       
        Node today_node = NodeFactory.todayAsDate() ;
        Literal today = model.createTypedLiteral(today_node.getLiteralLexicalForm(), today_node.getLiteralDatatype()) ;
        release.addProperty(DOAP.created, today) ;
        release.addProperty(DOAP.name, releaseName) ;      // Again
       
        TestSuite suite = ScriptTestSuiteFactory.make(testManifest) ;
        SimpleTestRunner.runSilent(suite) ;
View Full Code Here

       
        Resource release = model.createResource(DOAP.Version) ;
        system.addProperty(DOAP.release, release) ;
       
        Node today_node = NodeFactory.todayAsDate() ;
        Literal today = model.createTypedLiteral(today_node.getLiteralLexicalForm(), today_node.getLiteralDatatype()) ;
        release.addProperty(DOAP.created, today) ;
        release.addProperty(DOAP.name, releaseName) ;      // Again
       
        TestSuite suite = FactoryTestRiot.make(testManifest, null, null) ;
        SimpleTestRunner.runSilent(suite) ;
View Full Code Here

        Model m = ModelFactory.createDefaultModel();
        Property startTime = m.createProperty("http://jena.hpl.hp.com/test#startTime");

        Calendar cal = Calendar.getInstance();
        cal.set(Calendar.MILLISECOND, 0);
        Literal xsdlit0 = m.createTypedLiteral(cal);

        Resource event = m.createResource();
        event.addProperty(startTime, xsdlit0);

        StringWriter sw = new StringWriter();
View Full Code Here

    process.addProperty(RDF.type, opmv_Process);
    process.addProperty(RDF.type, grefine_ExportUsingRDFExtension);
    process.addProperty(grefine_operationDescription, jsonFileResource);
    process.addProperty(opmv_used, jsonFileResource);
    process.addProperty(opmv_common_usedScript, jsonFileResource);
    process.addLiteral(opmv_wasPerformedAt, model.createTypedLiteral(calendar));
    process.addProperty(opmv_common_usedData, csvFileResource);
    process.addProperty(opmv_used, csvFileResource);
   
    rdfFileResource.addProperty(RDF.type, opmv_Artifact);
    rdfFileResource.addProperty(dct_source, csvFileResource);
View Full Code Here

    add(expected.createResource("http://subject1"), expected.createProperty("http://predicate1"), expected.createResource("http://object1")).
    add(expected.createResource("http://subject1"), expected.createProperty("http://predicate2"), expected.createResource("http://object2")).
    add(expected.createResource("http://subject1"), expected.createProperty("http://predicate2"), expected.createResource("http://object3")).
    add(expected.createResource("http://subject2"), expected.createProperty("http://predicate3"), expected.createLiteral("literal1")).
    add(expected.createResource("http://subject3"), expected.createProperty("http://predicate4"), expected.createLiteral("literal2", "da")).
    add(expected.createResource("http://subject4"), expected.createProperty("http://predicate5"), expected.createTypedLiteral("literal3", new BaseDatatype("http://type"))).
    add(expected.createResource("http://subject4"), expected.createProperty("http://dct.org/#hasPart"), expected.createResource(AnonId.create("b1"))).
    add(expected.createResource(AnonId.create("b1")), expected.createProperty("http://rdf.org/#first"), expected.createResource("http://something/")).
    add(expected.createResource(AnonId.create("b1")), expected.createProperty("http://rdf.org/#rest"), expected.createResource("http://rdf.org/#nil"));
  System.out.println("Expected Model");
  System.out.println(expected.listStatements().toList().toString());
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.