Package org.apache.clerezza.rdf.core.impl

Examples of org.apache.clerezza.rdf.core.impl.SimpleMGraph.addAll()


  }

  private List<MSG> decomposeGraphToMSGs(TripleCollection tc) {

    TripleCollection tmp = new SimpleMGraph();
    tmp.addAll(tc);

    List<MSG> msgSet = new LinkedList<MSG>();

    while (tmp.size() > 0) {
      Triple triple = tmp.iterator().next();
View Full Code Here


        }

        String name = "";
        try {
            name = rootNode.getName();
            cmsGraph.addAll(getGraphForNode(baseURI, rootNode));
        } catch (RepositoryException e) {
            log.warn("Repository exception while processing node having name: {}", name, e);
        }
        return cmsGraph;
    }
View Full Code Here

                NonLiteral childURI = getNodeURI(baseURI, child);
                if (childURI == null) {
                    continue;
                }
                graph.add(new TripleImpl(childURI, CMSAdapterVocabulary.CMS_OBJECT_PARENT_REF, subject));
                graph.addAll(getGraphForNode(baseURI, child));
            }
        } catch (RepositoryException e) {
            log.warn("Error while processing children of node: {}", nodeName, e);
        }
        return graph;
View Full Code Here

        // Annotate raw RDF with CMS vocabulary annotations according to bridges
        log.info("Graph annotation starting...");
        MGraph annotatedGraph = new SimpleMGraph();
        for (RDFBridge bridge : rdfBridges) {
            long startAnnotation = System.currentTimeMillis();
            annotatedGraph.addAll(bridge.annotateGraph(rawRDFData));
            log.info("Graph annotated in: " + (System.currentTimeMillis() - startAnnotation) + "ms");
        }
        log.info("Graph annotation finished");

        // Store annotated RDF in repository
View Full Code Here

        RDFMapper mapper = getRDFMapper(session);
        MGraph cmsGraph = new SimpleMGraph();
        for (RDFBridge bridge : rdfBridges) {
            MGraph generatedGraph = mapper.generateRDFFromRepository(baseURI, session, bridge.getCMSPath());
            bridge.annotateCMSGraph(generatedGraph);
            cmsGraph.addAll(generatedGraph);
        }

        MGraph persistentGraph = null;
        if (store) {
            TcManagerClient tcManagerClient = new TcManagerClient(tcManager);
View Full Code Here

                rootPath));
        }

        while (cmisObjectIt.hasNext()) {
            CmisObject o = cmisObjectIt.next();
            cmsGraph.addAll(getGraphForObject(baseURI, o, (Folder) rootObject, null));
        }
        return cmsGraph;
    }

    private MGraph getGraphForObject(String baseURI, CmisObject o, Folder parentFolder, NonLiteral parentURI) {
View Full Code Here

        ContentItem ci = ciReader.readFrom(ContentItem.class, null, null, contentType, null, in);
        //assert ID
        assertEquals(contentItem.getUri(), ci.getUri());
        //assert metadata
        MGraph copy = new SimpleMGraph();
        copy.addAll(contentItem.getMetadata());
        assertTrue(copy.removeAll(ci.getMetadata()));
        assertTrue(copy.isEmpty());
        //assert Blob
        assertEquals(contentItem.getBlob().getMimeType(), ci.getBlob().getMimeType());
        String content = IOUtils.toString(contentItem.getStream(),"UTF-8");
View Full Code Here

            if (additionalExpansionRes.size() == 0) {
                return result;
            }
            for (Resource resource : additionalExpansionRes) {
                final GraphNode additionalNode = new GraphNode(resource, node.getGraph());
                result.addAll(additionalNode.getNodeContext());
                expandedResources.add(resource);
            }
        }
    }
View Full Code Here

                System.out.println(constructQuery.toString());
            }

            MGraph unionMGraph = new SimpleMGraph();
            for (ConstructQuery constructQuery : constructQueries) {
                unionMGraph.addAll(sparqlConstruct(constructQuery, inputGraph));
            }

            return unionMGraph;
        } catch (UnavailableRuleObjectException e) {
            throw new RefactoringException("The cause of the refactoring excpetion is: " + e.getMessage(), e);
View Full Code Here

                Triple roleTriple = roleIterator.next();
                // rolesGraph.add(roleTriple);
                NonLiteral roleNode = roleTriple.getSubject();
                SimpleGraph detailsGraph = new SimpleGraph(systemGraph.filter(
                        roleNode, null, null));
                rolesGraph.addAll(detailsGraph);
            }
        }
        return rolesGraph;
    }
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.