Package org.openrdf.model

Examples of org.openrdf.model.Graph.match()


                    value = value.substring( value.lastIndexOf( ':' ) + 1, value.length() );
                    String name = field.getName();
                    input.addField( name, value );
                } else if( statement.getObject() instanceof BNode )
                {
                    Iterator<Statement> seq = graph.match( (Resource) statement.getObject(), new URIImpl( "http://www.w3.org/1999/02/22-rdf-syntax-ns#li" ), null, (Resource) null );
                    while( seq.hasNext() )
                    {
                        Statement seqStatement = seq.next();
                        String value = seqStatement.getObject().stringValue();
                        value = value.substring( value.lastIndexOf( ':' ) + 1, value.length() );
View Full Code Here


      }

      final Resource aTmpRes = EmpireUtil.asResource(aTmpSupportsRdfId);
      Set<URI> aProps = new HashSet<URI>();
     
      Iterator<Statement> sIter = aGraph.match(aTmpRes, null, null);

      while (sIter.hasNext()) {
        Statement aStmt = sIter.next();
        aProps.add(aStmt.getPredicate());
      }
View Full Code Here

        finally {
          setAccessible(aAccess, aOldAccess);
        }
      }
     
      sIter = aGraph.match(aTmpRes, null, null);
      Graph aInstanceTriples = Graphs.newGraph();

      while (sIter.hasNext()) {
        Statement aStmt = sIter.next();
       
View Full Code Here

    em.merge(aObj);

    Graph aGraph = Graphs.newGraph(aSource.getStatements(null, null, null));

    assertEquals(3, aGraph.size());
    assertEquals(1, Lists.newArrayList(aGraph.match(null, ValueFactoryImpl.getInstance().createURI("urn:label"), null)).size());

    em.remove(aObj);

    ParentEntity pe = InstanceGenerator.generateInstanceClass(ParentEntity.class).newInstance();
    pe.setEntity(aObj);
View Full Code Here

    em.persist(pe);

    aGraph = Graphs.newGraph(aSource.getStatements(null, null, null));

    assertEquals(5, aGraph.size());
    assertEquals(1, Lists.newArrayList(aGraph.match(null, ValueFactoryImpl.getInstance().createURI("urn:label"), null)).size());

    aObj.setLabel("foobarbaz");

    em.merge(pe);
View Full Code Here

    em.merge(pe);

    aGraph = Graphs.newGraph(aSource.getStatements(null, null, null));

    assertEquals(5, aGraph.size());
    assertEquals(1, Lists.newArrayList(aGraph.match(null, ValueFactoryImpl.getInstance().createURI("urn:label"), null)).size());
  }


  /**
   * Tests the same basic thing as {@link #testDuplicate()} except we do refreshes after persists which should auto-update the information in the EmpireGenerated
View Full Code Here

    em.merge(aObj);

    Graph aGraph = Graphs.newGraph(aSource.getStatements(null, null, null));

    assertEquals(3, aGraph.size());
    assertEquals(1, Lists.newArrayList(aGraph.match(null, ValueFactoryImpl.getInstance().createURI("urn:label"), null)).size());

    em.remove(aObj);

    ParentEntity pe = InstanceGenerator.generateInstanceClass(ParentEntity.class).newInstance();
    pe.setEntity(aObj);
View Full Code Here

    em.refresh(pe);

    aGraph = Graphs.newGraph(aSource.getStatements(null, null, null));

    assertEquals(5, aGraph.size());
    assertEquals(1, Lists.newArrayList(aGraph.match(null, ValueFactoryImpl.getInstance().createURI("urn:label"), null)).size());

    aObj.setLabel("foobarbaz");

    em.merge(pe);
View Full Code Here

    em.merge(pe);

    aGraph = Graphs.newGraph(aSource.getStatements(null, null, null));

    assertEquals(5, aGraph.size());
    assertEquals(1, Lists.newArrayList(aGraph.match(null, ValueFactoryImpl.getInstance().createURI("urn:label"), null)).size());
  }

  /**
   * Test for basic proxying using Javassist
   * @throws Exception test error
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.