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

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


    if (subject.isAnon())
      return new BlankNode(subject.asNode().getBlankNodeId().toString());
    else if (subject.isURIResource())
      return new URINode(statement.getModel().shortForm(
          subject.asNode().getURI()));
    else
      return null;
  }

  public ResourceNode getContext() {
View Full Code Here


        Node resAsNode = old.asNode() ;
        Model model = old.getModel() ;
        Graph graph = model.getGraph() ;
        Graph rawGraph = graph instanceof InfGraph ? ((InfGraph) graph).getRawGraph() : graph ;
        Resource newRes = model.createResource(uri) ;
        Node newResAsNode = newRes.asNode() ;
        
       
        boolean changeOccured = false ;
        List<Triple> triples = new ArrayList<Triple>(WINDOW_SIZE) ;
       
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

    QuerySolutionMap map = new QuerySolutionMap();
    Resource r = ResourceFactory.createResource("http://example.org");
    map.add("s", r);
    ParameterizedSparqlString query = new ParameterizedSparqlString("", map);
   
    Assert.assertEquals(r.asNode(), query.getParam("s"));
  }
 
  @Test
  public void test_param_string_constructor_5()
  {
View Full Code Here

    QuerySolutionMap map = new QuerySolutionMap();
    Resource r = ResourceFactory.createResource("http://example.org");
    map.add("s", r);
    ParameterizedSparqlString query = new ParameterizedSparqlString(map);
   
    Assert.assertEquals(r.asNode(), query.getParam("s"));
  }
 
  @Test
  public void test_param_string_constructor_6()
  {
View Full Code Here

    map.add("s", r);
    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

    map.add("s", r);
    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

  @Override
  public SecuredResource createResource( final String uri, final Resource type )
  {
    final Resource r = ResourceFactory.createResource(uri);
    final SecurityEvaluator.SecTriple t = new SecurityEvaluator.SecTriple(
        SecuredItemImpl.convert(r.asNode()),
        SecuredItemImpl.convert(RDF.type.asNode()),
        SecuredItemImpl.convert(type.asNode()));
    if (holder.getBaseItem().contains(r, RDF.type, type))
    {
      checkRead();
View Full Code Here

  public void testURINodeAsResource()
  {
    final Node n = GraphTestBase.node("a");
    final Resource r = model.wrapAsResource(n);
    Assert.assertSame(n, r.asNode());
  }
}
View Full Code Here

    map.add("s", r);
    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.