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

Examples of com.hp.hpl.jena.rdf.model.Literal.asNode()


      Literal l = model.createTypedLiteral(((DatatypeLiteral)o).getValue(),
              ((DatatypeLiteral)o).getDatatype().toString());
     
      JenaParameters.enableSilentAcceptanceOfUnknownDatatypes = originalFlag;
     
      return l.asNode();
     
    }
   
    if(o instanceof LanguageTagLiteral) {
      // langtag
View Full Code Here


        Literal l = ResourceFactory.createPlainLiteral("example");
        map.add("o", l);
        ParameterizedSparqlString query = new ParameterizedSparqlString("", map);

        Assert.assertEquals(r.asNode(), query.getParam("s"));
        Assert.assertEquals(l.asNode(), query.getParam("o"));
    }

    @Test
    public void test_param_string_constructor_7() {
        // Test constructor with predefined parameters - variant of constructor
View Full Code Here

        Literal l = ResourceFactory.createPlainLiteral("example");
        map.add("o", l);
        ParameterizedSparqlString query = new ParameterizedSparqlString(map);

        Assert.assertEquals(r.asNode(), query.getParam("s"));
        Assert.assertEquals(l.asNode(), query.getParam("o"));
    }

    @Test
    public void test_param_string_constructor_8() {
        // Test constructors with predefined prefixes
View Full Code Here

  public String getLanguage( final int index )
  {
    checkRead();
    final Literal literal = holder.getBaseItem().getLiteral(index);
    checkRead(new Triple(holder.getBaseItem().asNode(), RDF.li(index)
        .asNode(), literal.asNode()));
    return literal.getLanguage();
  }

  @Override
  public SecuredLiteral getLiteral( final int index )
View Full Code Here

  public SecuredLiteral getLiteral( final int index )
  {
    checkRead();
    final Literal literal = holder.getBaseItem().getLiteral(index);
    checkRead(new Triple(holder.getBaseItem().asNode(), RDF.li(index)
        .asNode(), literal.asNode()));
    return SecuredLiteralImpl.getInstance(getModel(), literal);
  }

  @Override
  public long getLong( final int index )
View Full Code Here

  {
    checkUpdate();
    final Literal l = ResourceFactory.createTypedLiteral(lexicalForm,
        datatype);
    checkCreate(new Triple(holder.getBaseItem().asNode(), p.asNode(),
        l.asNode()));
    holder.getBaseItem().addProperty(p, l);
    return holder.getSecuredItem();
  }

  /**
 
View Full Code Here

       
        Graph safeGraph = deductions.getGraph();
        assertTrue(safeGraph instanceof SafeGraph);
       
        Graph rawGraph = ((SafeGraph)safeGraph).getRawGraph();
        Triple deduction = new Triple(l.asNode(), q.asNode(), r.asNode());
        TestUtil.assertIteratorValues(this,
                rawGraph.find(Node.ANY, Node.ANY, Node.ANY),
                new Triple[]{deduction});
    }
View Full Code Here

    Literal l = ResourceFactory.createPlainLiteral("example");
    map.add("o", l);
    ParameterizedSparqlString query = new ParameterizedSparqlString("", map);
   
    Assert.assertEquals(r.asNode(), query.getParam("s"));
    Assert.assertEquals(l.asNode(), query.getParam("o"));
  }
 
  @Test
  public void test_param_string_constructor_7()
  {
View Full Code Here

    Literal l = ResourceFactory.createPlainLiteral("example");
    map.add("o", l);
    ParameterizedSparqlString query = new ParameterizedSparqlString(map);
   
    Assert.assertEquals(r.asNode(), query.getParam("s"));
    Assert.assertEquals(l.asNode(), query.getParam("o"));
  }
 
  @Test
  public void test_param_string_constructor_8()
  {
View Full Code Here

    Literal l = ResourceFactory.createPlainLiteral("example");
    map.add("o", l);
    ParameterizedSparqlString query = new ParameterizedSparqlString("", map);
   
    Assert.assertEquals(r.asNode(), query.getParam("s"));
    Assert.assertEquals(l.asNode(), query.getParam("o"));
  }
 
  @Test
  public void test_param_string_constructor_7()
  {
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.