Package com.hp.hpl.jena.graph.compose

Examples of com.hp.hpl.jena.graph.compose.MultiUnion


     * together with an additional set of data premises. The default
     * implementation loses ALL partial deductions so far. Some subclasses
     * may be able to a more efficient job.
     */
    public InfGraph cloneWithPremises(Graph premises) {
        MultiUnion union = new MultiUnion();
        Graph raw = getRawGraph();
        union.addGraph( raw );
        union.setBaseGraph( raw );
        union.addGraph( premises );
        Graph schema = getSchemaGraph();
        if (schema != null) {
            if (schema instanceof BaseInfGraph) {
                BaseInfGraph ischema = (BaseInfGraph)schema;
                Graph sschema = ischema.getSchemaGraph();
                if (sschema != null) union.addGraph( sschema );
                Graph rschema = ischema.getRawGraph();
                if (rschema != null) union.addGraph( rschema );
            }
           
        }
        return getReasoner().bind(union);
    }
View Full Code Here


        {
        StmtIterator oit = model.listStatements( null, OWL.imports, (RDFNode) null );
        StmtIterator jit = model.listStatements( null, JA.imports, (RDFNode) null );
        if (oit.hasNext() || jit.hasNext())
            {
            MultiUnion g = new MultiUnion( new Graph[] { model.getGraph() } );
            addImportedGraphs( fm, loading, oit, g );
            addImportedGraphs( fm, loading, jit, g );
            return ModelFactory.createModelForGraph( g );
            }
        else
View Full Code Here

     * @param spec The model spec to interpret
     * @param base The base model, or null
     */
    private static Graph generateGraph( OntModelSpec spec, Graph base ) {
        // create a empty union graph
        MultiUnion u = new MultiUnion();
        u.addGraph( base );
        u.setBaseGraph( base );

        Reasoner r = spec.getReasoner();
        // if we have a reasoner in the spec, bind to the union graph and return
        return r == null ? (Graph) u : r.bind( u );
    }
View Full Code Here

    public TestMultiUnionReifier( String name )
        { super( name ); }

    public void testX()
        {
        MultiUnion mu = multi( "a P b; !b Q c; ~c R d", "" );
        for (ExtendedIterator<Triple> it = GraphUtil.findAll( mu ); it.hasNext();)
            {
            System.err.println( "]]  " + it.next() );
            }
        }
View Full Code Here

        }

    private MultiUnion multi( String a, String b )
        {
        Graph A = graph( a ), B = graph( b );
        return new MultiUnion( new Graph[] {A, B} );
        }
View Full Code Here

        AnInteger a = new AnInteger( av ), b = new AnInteger( bv ), c = new AnInteger( cv );
        Graph g1 = graphWithGivenStatistic( a );
        Graph g2 = graphWithGivenStatistic( b );
        Graph g3 = graphWithGivenStatistic( c );
        Graph [] graphs = new Graph[]{g1, g2, g3};
        MultiUnion mu = new MultiUnion( graphs );
        GraphStatisticsHandler gs = new MultiUnion.MultiUnionStatisticsHandler( mu );
        assertEquals( expected, gs.getStatistic( Node.ANY, Node.ANY, Node.ANY ) );
        }
View Full Code Here

     * @param spec The model spec to interpret
     * @param base The base model, or null
     */
    private static Graph generateGraph( OntModelSpec spec, Graph base ) {
        // create a empty union graph
        MultiUnion u = new MultiUnion();
        u.addGraph( base );
        u.setBaseGraph( base );

        Reasoner r = spec.getReasoner();
        // if we have a reasoner in the spec, bind to the union graph and return
        return r == null ? (Graph) u : r.bind( u );
    }
View Full Code Here

     * together with an additional set of data premises. The default
     * implementation loses ALL partial deductions so far. Some subclasses
     * may be able to a more efficient job.
     */
    public InfGraph cloneWithPremises(Graph premises) {
        MultiUnion union = new MultiUnion();
        Graph raw = getRawGraph();
        union.addGraph( raw );
        union.setBaseGraph( raw );
        union.addGraph( premises );
        Graph schema = getSchemaGraph();
        if (schema != null) {
            if (schema instanceof BaseInfGraph) {
                BaseInfGraph ischema = (BaseInfGraph)schema;
                Graph sschema = ischema.getSchemaGraph();
                if (sschema != null) union.addGraph( sschema );
                Graph rschema = ischema.getRawGraph();
                if (rschema != null) union.addGraph( rschema );
            }
           
        }
        return getReasoner().bind(union);
    }
View Full Code Here

    public TestMultiUnionReifier( String name )
        { super( name ); }

    public void testX()
        {
        MultiUnion mu = multi( "a P b; !b Q c; ~c R d", "" );
        for (ExtendedIterator<Triple> it = GraphUtil.findAll( mu ); it.hasNext();)
            {
            System.err.println( "]]  " + it.next() );
            }
        }
View Full Code Here

        }

    private MultiUnion multi( String a, String b )
        {
        Graph A = graph( a ), B = graph( b );
        return new MultiUnion( new Graph[] {A, B} );
        }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.graph.compose.MultiUnion

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.