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

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


        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


        while ( wordIt.hasNext() )
          {
          Resource currWord = wordIt.nextResource();
          if ( currWord.isURIResource() )
            {
            fullwords += currWord.asNode().getURI() + '\n';
           
            loosewords += currWord.getLocalName() + '\n';
            looseMappingArr[i] = currWord.getLocalName();
            fullMappingArr[i] = currWord.asNode().getURI();
            i++;
View Full Code Here

            {
            fullwords += currWord.asNode().getURI() + '\n';
           
            loosewords += currWord.getLocalName() + '\n';
            looseMappingArr[i] = currWord.getLocalName();
            fullMappingArr[i] = currWord.asNode().getURI();
            i++;
            }
          }
       
        GenericWordChecker full = new WordChecker( fullwords );
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

  public void testURINodeAsResource()
  {
    final Node n = GraphTestBase.node("a");
    final Resource r = model.wrapAsResource(n);
    Assert.assertSame(n, r.asNode());
  }
}
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() {
        // Test constructor with predefined parameters - variant of constructor
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() {
        // Test constructor with predefined parameters
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

          n = predicateStatement.getObject();
          if (! n.isURIResource()) {
            throw new TextIndexException("Text map entry predicate property has non resource value : " + n);
          }
          Resource predicate = (Resource) n;
          mapDefs.put(field, predicate.asNode()) ;
         
          Statement analyzerStatement = listEntry.getProperty(TextVocab.pAnalyzer);
          if (analyzerStatement != null) {
            n = analyzerStatement.getObject();
            if (! n.isResource()) {
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.