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

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


        tdata.add(new Triple(p, RDFS.subPropertyOf.asNode(), q));
        tdata.add(new Triple(q, RDFS.subPropertyOf.asNode(), r));
        tdata.add(new Triple(r, RDFS.domain.asNode(), D));
        Graph data = Factory.createGraphMem();
        data.add(new Triple(a, p, b));
        InfGraph igraph = ReasonerRegistry.getRDFSReasoner().bind(new Union(tdata, data));
        TestUtil.assertIteratorValues(this, igraph.find(a, ty, null),
        new Object[] {
            new Triple(a, ty, D),
            new Triple(a, ty, RDFS.Resource.asNode()),
        });
View Full Code Here


    public void init() {
        if (schema == null) {
            infgraph = reasoner.bind(testdata);
        } else {
//            infgraph = reasoner.bindSchema(schema).bind(testdata);
            infgraph = reasoner.bind(new Union(schema, testdata));
        }
//        if (infgraph instanceof FBRuleInfGraph) {
//            ((FBRuleInfGraph)infgraph).resetLPProfile(true);
//        }
        if (infgraph instanceof FBRuleInfGraph) {
View Full Code Here

     
  @Override
  public Graph getGraph()
  {
    Graph gBase = graphWith( "" ), g1 = graphWith( "" );
        return new Union( gBase, g1 );
  }
View Full Code Here

 
  public void testUnion()
    {
        Graph g1 = graphWith( "x R y; p R q" );
        Graph g2 = graphWith( "r A s; x R y" );
        Union u = new Union( g1, g2 );
        assertContains( "Union", "x R y", u );
        assertContains( "Union", "p R q", u );
        assertContains( "Union", "r A s", u );
        if (u.size() != 3)
            fail( "oops: size of union is not 3" );
        u.add( triple( "cats eat cheese" ) );
        assertContains( "Union", "cats eat cheese", u );
        if
          (
          contains( g1, "cats eat cheese" ) == false
          && contains( g2, "cats eat cheese" ) == false
View Full Code Here

    Model model1 = ModelFactory.createDefaultModel();
    model1.read( new StringReader( source1 ), "", "N3" );
    Model model2 = ModelFactory.createDefaultModel();
    model2.read( new StringReader( source2 ), "", "N3" );

    Model ordered = ModelFactory.createModelForGraph( new Union( model1.getGraph(), model2.getGraph() ) );
    OntModel pellet = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, ordered );
   
    Property p = pellet.getProperty( ns + "p" );
   
    assertTrue( pellet.contains( p, RDFS.range, RDFS.Literal ) );
View Full Code Here

    Model model1 = ModelFactory.createDefaultModel();
    model1.read( new StringReader( source1 ), "", "N3" );
    Model model2 = ModelFactory.createDefaultModel();
    model2.read( new StringReader( source2 ), "", "N3" );

    Model ordered = ModelFactory.createModelForGraph( new Union( model1.getGraph(), model2.getGraph() ) );
    OntModel pellet = ModelFactory.createOntologyModel( PelletReasonerFactory.THE_SPEC, ordered );
   
    Property p = pellet.getProperty( ns + "p" );
   
    assertTrue( pellet.contains( p, RDFS.range, RDFS.Literal ) );
View Full Code Here

TOP

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

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.