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

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


                log.warn("Merging of Clerezza triple collections is only implemented one level down. Import statements will be preserved for further levels.");
                Iterator<Triple> it;
                Set<Resource> importTargets = new HashSet<Resource>();
                for (OWLOntologyID ontologyId : managedOntologies) {
                    Graph g = getOntology(ontologyId, Graph.class, false);
                    root.addAll(g);

                    it = g.filter(null, OWL.imports, null);
                    while (it.hasNext()) {
                        IRI tgt;
                        Resource r = it.next().getObject();
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

        UriRef ciId = ci.getUri();
        //we need to store the results of Zemanta in an temp graph
        MGraph results = new SimpleMGraph();
        ZemantaAPIWrapper zemanta = new ZemantaAPIWrapper(key);
        try {
            results.addAll(zemanta.enhance(text));
        } catch (IOException e) {
           throw new EngineException("Unable to get Enhancement from remote Zemanta Service",e);
        }
        //now we need to process the results and convert them into the Enhancer
        //annotation structure
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

                log.warn("Merging of Clerezza triple collections is only implemented one level down. Import statements will be preserved for further levels.");
                Iterator<Triple> it;
                Set<Resource> importTargets = new HashSet<Resource>();
                for (IRI ontologyIri : managedOntologies) {
                    Graph g = getOntology(ontologyIri, Graph.class, false);
                    root.addAll(g);

                    it = g.filter(null, OWL.imports, null);
                    while (it.hasNext())
                        importTargets.add(it.next().getObject());
View Full Code Here

        MGraph mGraph = new SimpleMGraph();
        try {
            query = QueryParser.getInstance().parse(sparql);
            UriRef datasetUriRef = new UriRef(datasetURI);
            MGraph dataset = weightedTcProvider.getMGraph(datasetUriRef);
            mGraph.addAll((SimpleGraph) tcManager.executeSparqlQuery(query, dataset));
        } catch (ParseException e) {
            log.error("Unable to execute SPARQL. ", e);
        }

        Model om = JenaToClerezzaConverter.clerezzaMGraphToJenaModel(mGraph);
View Full Code Here

                    default:
                        break;
                }

                if (constructedGraph != null) {
                    unionMGraph.addAll(constructedGraph);
                }

            }

            refactoredOntology = OWLAPIToClerezzaConverter.clerezzaGraphToOWLOntology(unionMGraph);
View Full Code Here

                default:
                    break;
            }

            if (constructedGraph != null) {
                unionMGraph.addAll(constructedGraph);
            }

        }

        refactoredOntology = OWLAPIToClerezzaConverter.clerezzaGraphToOWLOntology(unionMGraph);
View Full Code Here

        UriRef ciId = ci.getUri();
        //we need to store the results of Zemanta in an temp graph
        MGraph results = new SimpleMGraph();
        ZemantaAPIWrapper zemanta = new ZemantaAPIWrapper(key);
        try {
            results.addAll(zemanta.enhance(text));
        } catch (IOException e) {
           throw new EngineException("Unable to get Enhancement from remote Zemanta Service",e);
        }
        //now we need to process the results and convert them into the Enhancer
        //annotation structure
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.