Package org.apache.clerezza.rdf.core

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


        // Delete old enhancements which belong to this content item from the
        // global enhancements graph.
        removeEnhancements(ci.getUri().getUnicodeString());
        // Add new enhancements of this content item to the global enhancements
        // graph.
        enhancementGraph.addAll(ci.getMetadata());
    }

    @Override
    public String enhanceAndPut(ContentItem ci, String chainName) throws StoreException {
        enhance(ci, chainName);
View Full Code Here


    }

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

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

        final MGraph resultGraph;
        if(resultObject instanceof MGraph){
            resultGraph = (MGraph)resultObject;
        } else if(resultObject instanceof Graph){
            resultGraph = new IndexedMGraph();
            resultGraph.addAll((Graph)resultObject);
        } else {
            log.error("Unable to create "+MGraph.class+" instance for query reults of type "+resultObject.getClass()+" (this indicates that the used SPARQL Query was not of type CONSTRUCT)");
            log.error("FieldQuery: "+query);
            log.error("SPARQL Query: "+sparqlQueryString);
            throw new YardException("Unable to process results of Query");
View Full Code Here

        //create the graphs in Clerezza
        tcManager = TcManager.getInstance();
        MGraph graph = tcManager.createMGraph(READ_WRITEGRAPH_URI);
        //add the test data to the MGrpah
        for(TripleCollection tc :entityData.values()){
            graph.addAll(tc);
        }
        //create the read only graph
        tcManager.createGraph(READ_ONLY_GRAPH_URI, graph);
       
        //init the ClerezzaYards for the created Clerezza graphs
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

                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

                    tcManager.deleteTripleCollection(new UriRef(baseURI));
                }
                persistentGraph = tcManager.createMGraph(new UriRef(baseURI));
            }
            log.info("Saving the triple collection having base URI: {}", baseURI);
            persistentGraph.addAll(cmsGraph);
        } else {
            persistentGraph = cmsGraph;
        }
        return persistentGraph;
    }
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

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.