Package org.apache.clerezza.rdf.core

Examples of org.apache.clerezza.rdf.core.MGraph.clear()


        MGraph graph = getEmptyMGraph();
        Assert.assertEquals(0, graph.size());
        graph.add(new TripleImpl(uriRef1, uriRef2, uriRef3));
        graph.add(new TripleImpl(uriRef2, uriRef3, uriRef4));
        Assert.assertEquals(2, graph.size());
        graph.clear();
        Assert.assertEquals(0, graph.size());
    }

    @Test
    public void testUseTypedLiterals() {
View Full Code Here


        mGraph.add(trpl1);
        mGraph.add(trpl2);
        mGraph.add(trpl3);
        mGraph.add(trpl4);
        listener.resetCumulatedEvents();
        mGraph.clear();
        List<GraphEvent> cumulatedEvents = listener.getCumulatedEvents();
        Set<Triple> cumulatedTriples = getCumulatedTriples(cumulatedEvents);
        Assert.assertEquals(3, cumulatedEvents.size());
        Assert.assertTrue(cumulatedEvents.get(0) instanceof RemoveEvent);
        Assert.assertTrue(cumulatedTriples.contains(trpl2));
View Full Code Here

    Assert.assertEquals(1, rewrappedMGraph.size());
    rewrappedMGraph.add(new TripleImpl(new BNode(), SKOS.prefLabel,
        LiteralFactory.getInstance().createTypedLiteral("foo")));
    Assert.assertEquals(2, rewrappedMGraph.size());
    Assert.assertEquals(2, mGraph.size());
    rewrappedMGraph.clear();
    Assert.assertEquals(0, rewrappedMGraph.size());
  }
}
View Full Code Here

    MGraph graph = getEmptyMGraph();
    Assert.assertEquals(0, graph.size());
    graph.add(new TripleImpl(uriRef1, uriRef2, uriRef3));
    graph.add(new TripleImpl(uriRef2, uriRef3, uriRef4));
    Assert.assertEquals(2, graph.size());
    graph.clear();
    Assert.assertEquals(0, graph.size());
  }

  @Test
  public void testUseTypedLiterals() {
View Full Code Here

    mGraph.add(trpl1);
    mGraph.add(trpl2);
    mGraph.add(trpl3);
    mGraph.add(trpl4);
    listener.resetCumulatedEvents();
    mGraph.clear();
    List<GraphEvent> cumulatedEvents = listener.getCumulatedEvents();
    Set<Triple> cumulatedTriples = getCumulatedTriples(cumulatedEvents);
    Assert.assertEquals(3, cumulatedEvents.size());
    Assert.assertTrue(cumulatedEvents.get(0) instanceof RemoveEvent);
    Assert.assertTrue(cumulatedTriples.contains(trpl2));
View Full Code Here

        MGraph mGraph;
        boolean created = false;
        try {
          mGraph = target.getMGraph((UriRef)graphGN.getNode());
          try {
            mGraph.clear();
          } catch (UnsupportedOperationException ex) {
            log.warn("could not restore "+graphGN.getNode()+" as the exsting triple "
                + "collection could not be cleared");
            continue;
          }
View Full Code Here

        return contentItem;
    }

    public String put(ContentItem ci) {
        MGraph metadataGraph = tcManager.getMGraph(ci.getUri());
        metadataGraph.clear();
        metadataGraph.addAll(ci.getMetadata());
        //TODO: handle ContentParts
        return ci.getUri().getUnicodeString();
    }
View Full Code Here

        Assert.assertEquals(1, rewrappedMGraph.size());
        rewrappedMGraph.add(new TripleImpl(new BNode(), SKOS.prefLabel,
                LiteralFactory.getInstance().createTypedLiteral("foo")));
        Assert.assertEquals(2, rewrappedMGraph.size());
        Assert.assertEquals(2, mGraph.size());
        rewrappedMGraph.clear();
        Assert.assertEquals(0, rewrappedMGraph.size());
    }
}
View Full Code Here

        return contentItem;
    }

    public String put(ContentItem ci) {
        MGraph metadataGraph = tcManager.getMGraph(new UriRef(ci.getUri().getUnicodeString()));
        metadataGraph.clear();
        metadataGraph.addAll(ci.getMetadata());
        return ci.getUri().getUnicodeString();
    }

    public ContentItem get(String id) {
View Full Code Here

                MGraph mGraph;
                boolean created = false;
                try {
                    mGraph = target.getMGraph((UriRef)graphGN.getNode());
                    try {
                        mGraph.clear();
                    } catch (UnsupportedOperationException ex) {
                        log.warn("could not restore "+graphGN.getNode()+" as the exsting triple "
                                + "collection could not be cleared");
                        continue;
                    }
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.