Package com.hp.hpl.jena.graph

Examples of com.hp.hpl.jena.graph.Graph


        } catch (IOException ex) { errorOccurred(ex) ; return null ; }
    }

    private static DatasetGraph parse(HttpActionREST action, Lang lang, String base, InputStream input)
    {
        Graph graphTmp = GraphFactory.createGraphMem() ;
        Sink<Triple> sink = new SinkTriplesToGraph(graphTmp) ;
        LangRIOT parser = RiotReader.createParserTriples(input, lang, base, sink) ;
        parser.getProfile().setHandler(errorHandler) ;
        try {
            parser.parse() ;
View Full Code Here


        Trivial [incomplete] test that a Wrapped graph pokes through to the underlying
        graph. Really want something using mock classes. Will think about it.
    */
    public void testWrappedSame()
        {
        Graph m = Factory.createGraphMem();
        Graph w = new WrappedGraph( m );
        graphAdd( m, "a trumps b; c eats d" );
        assertIsomorphic( m, w );
        graphAdd( w, "i write this; you read that" );
        assertIsomorphic( w, m );
        }       
View Full Code Here

        }   
   
    public void testListSubjectsDoesntUseFind()
        {
        final boolean [] called = {false};
        Graph g = Factory.createGraphMem();
        ExtendedIterator<Node> subjects = g.queryHandler().subjectsFor( null, null );
        Set<Node> s = CollectionFactory.createHashedSet();
        while (subjects.hasNext()) s.add( subjects.next() );
        assertFalse( "find should not have been called", called[0] );
        }  
View Full Code Here

        }  
   
    public void testListPredicatesDoesntUseFind()
        {
        final boolean [] called = {false};
        Graph g = Factory.createGraphMem();
        ExtendedIterator<Node> predicates = g.queryHandler().predicatesFor( null, null );
        Set<Node> s = CollectionFactory.createHashedSet();
        while (predicates.hasNext()) s.add( predicates.next() );
        assertFalse( "find should not have been called", called[0] );
        }
View Full Code Here

        }
   
    public void testListObjectsDoesntUseFind()
        {
        final boolean [] called = {false};
        Graph g = Factory.createGraphMem();
        ExtendedIterator<Node> subjects = g.queryHandler().objectsFor( null, null );
        Set<Node> s = CollectionFactory.createHashedSet();
        while (subjects.hasNext()) s.add( subjects.next() );
        assertFalse( "find should not have been called", called[0] );
        }  
View Full Code Here

  }

    @Override
  public Graph getGraph() {
      Graph g = Factory.createGraphMem();
     
      g.getEventManager().register(new CheckChanges("simple tracking",g));
      return g;
  }
View Full Code Here

     * @param base      Base URI
     * @param lang      Language syntax
     */
    public static void read(Model model, StringReader in, String base, Lang lang)
    {
        Graph g = model.getGraph() ;
        StreamRDF dest = StreamRDFLib.graph(g) ;
        process(dest, in, base, lang, null) ;
    }
View Full Code Here

    /** Create a memory Graph and read in some data
     * @see #read(Graph,String)
     */
    public static Graph loadGraph(String uri)
  {
        Graph g = createGraph() ;
        read(g, uri) ;
        return g ;
    }
View Full Code Here

  /** Create a memory Graph and read in some data
     * @see #read(Graph,String,Lang)
     */
    public static Graph loadGraph(String uri, Lang lang)
  {
        Graph g = createGraph() ;
        read(g, uri, lang) ;
        return g ;
    }
View Full Code Here

    @Override
    public void write(Model model, Writer out, String base)
    {
        if base != null && base.equals("") )
            base = null ;
        Graph graph = model.getGraph() ;
        writer().write(out, graph, RiotLib.prefixMap(graph), base, context) ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.graph.Graph

Copyright © 2018 www.massapicom. 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.