Package org.apache.clerezza.rdf.core

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


            otimizationIndicator.createNewFile();
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
        MGraph mGraph = getMGraph(tcDir);
        mGraph.addAll(triples);
        Graph result = mGraph.getGraph();
       
        graphMap.put(name, result);
        return result;
    }
View Full Code Here


    try {
      MGraphUtils.removeSubGraph(mGraph, revokedGraph);
    } catch (NoSuchSubGraphException ex) {
      throw new RuntimeException(ex);
    }
    mGraph.addAll(assertedGraph);
  }

  @GET
  public PathNode getStaticFile(@Context UriInfo uriInfo) {
    TrailingSlash.enforcePresent(uriInfo);
View Full Code Here

      otimizationIndicator.createNewFile();
    } catch (IOException ex) {
      throw new RuntimeException(ex);
    }
    MGraph mGraph = getMGraph(tcDir);
    mGraph.addAll(triples);
    Graph result = mGraph.getGraph();
   
    graphMap.put(name, result);
    return result;
  }
View Full Code Here

      Resource object = triple.getObject();
      if (object instanceof BNode) {
        BNode bNodeObject = (BNode) object;
        if (!dontExpand.contains(bNodeObject)) {
          dontExpand.add(bNodeObject);
          result.addAll(getContextOf(bNodeObject, dontExpand, graph));
        }
      }
    }
    Iterator<Triple> backwardProperties = graph.filter(null, null, node);
    while (backwardProperties.hasNext()) {
View Full Code Here

      NonLiteral subject = triple.getSubject();
      if (subject instanceof BNode) {
        BNode bNodeSubject = (BNode) subject;
        if (!dontExpand.contains(bNodeSubject)) {
          dontExpand.add(bNodeSubject);
          result.addAll(getContextOf(bNodeSubject, dontExpand, graph));
        }
      }
    }
    return result;
  }
View Full Code Here

  @Test
  public void twoLine() throws GraphNotIsomorphicException {
    NonLiteral start1 = new BNode();
    MGraph tc1 = Utils4Testing.generateLine(4,start1);
    tc1.addAll(Utils4Testing.generateLine(5,start1));
    NonLiteral start2 = new BNode();
    MGraph tc2 = Utils4Testing.generateLine(5,start2);
    tc2.addAll(Utils4Testing.generateLine(4,start2));
    Assert.assertEquals(9, tc1.size());
    final Map<BNode, BNode> mapping = new HashMatching(tc1, tc2).getMatchings();
View Full Code Here

    NonLiteral start1 = new BNode();
    MGraph tc1 = Utils4Testing.generateLine(4,start1);
    tc1.addAll(Utils4Testing.generateLine(5,start1));
    NonLiteral start2 = new BNode();
    MGraph tc2 = Utils4Testing.generateLine(5,start2);
    tc2.addAll(Utils4Testing.generateLine(4,start2));
    Assert.assertEquals(9, tc1.size());
    final Map<BNode, BNode> mapping = new HashMatching(tc1, tc2).getMatchings();
    Assert.assertNotNull(mapping);
    Assert.assertEquals(10, mapping.size());
  }
View Full Code Here

    if (first) {
      while (concepts.hasNext()) {
        resultNode.addProperty(QUERYRESULT.concept, concepts.next()
            .getSubject());
      }
      resultMGraph.addAll(graph);
    } else {
      while (concepts.hasNext()) {
        NonLiteral concept = concepts.next().getSubject();
        GraphNode conceptGraphNode = new GraphNode(concept, graph);
        Iterator<Resource> sameAsConcepts = conceptGraphNode
View Full Code Here

        } catch (NoSuchEntityException ex) {
          mGraph = target.createMGraph((UriRef)graphGN.getNode());
          created = true;
        }
        try {
          mGraph.addAll(extracted);
        } catch (Exception ex) {
          String actionDone = created ? "created" : "cleared";
          log.error("after the mgraph "+graphGN.getNode()+" could successfully be "+actionDone
              + ", an exception occured adding the data", ex);
        }
View Full Code Here

  private static void renameGraphs(TcManager tcManager, UriRef oldGraphUri, UriRef graphUri) {
    try {
      MGraph oldMGraph = tcManager.getMGraph(oldGraphUri);
      MGraph newMGraph = tcManager.createMGraph(graphUri);
      logger.info("renaming "+oldGraphUri+" to "+graphUri);
      newMGraph.addAll(oldMGraph);
      tcManager.deleteTripleCollection(oldGraphUri);
    } catch (NoSuchEntityException ex) {
    } catch (EntityAlreadyExistsException ex) {
      logger.warn("could not rename " + oldGraphUri + " to " +
          graphUri + " because target graph already exists", ex);
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.