Package org.apache.clerezza.rdf.core

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


        tripleCollection = JenaToClerezzaConverter.jenaModelToClerezzaMGraph(jenaModel);

        MGraph mGraph = tcm.createMGraph(new UriRef(
                "http://incubator.apache.com/stanbol/rules/refactor/test/graph"));
        mGraph.addAll(tripleCollection);

        Recipe recipe;
        try {
            recipe = store.createRecipe(new UriRef(
                    "http://incubator.apache.com/stanbol/rules/refactor/test/recipeA"),
View Full Code Here


        }
        MGraph graph = ci.getMetadata();
        Boolean includeExecutionMetadata = (Boolean)enhancementPropertis.get(INCLUDE_EXECUTION_METADATA);
        if (includeExecutionMetadata != null && includeExecutionMetadata.booleanValue()) {
            try {
                graph.addAll(ci.getPart(ExecutionMetadata.CHAIN_EXECUTION, TripleCollection.class));
            } catch (NoSuchPartException e) {
                // no executionMetadata available
            }
        }
    }
View Full Code Here

                List<ConstructQuery> constructQueries = (List<ConstructQuery>) ruleAdapter.adaptTo(recipe,
                    ConstructQuery.class);

                MGraph mGraph = tcManager.createMGraph(refactoredOntologyID);
                for (ConstructQuery constructQuery : constructQueries) {
                    mGraph.addAll(this.sparqlConstruct(constructQuery, datasetID));
                }
            } catch (RecipeConstructionException e) {
                throw new RefactoringException(
                        "The cause of the refactoring excpetion is: " + e.getMessage(), e);
            } catch (UnavailableRuleObjectException e) {
View Full Code Here

                ConstructQuery.class);

            unionMGraph = new SimpleMGraph();

            for (ConstructQuery constructQuery : constructQueries) {
                unionMGraph.addAll(this.sparqlConstruct(constructQuery, graphID));
            }

        } catch (NoSuchRecipeException e1) {
            log.error("Refactor : No Such recipe in the Rule Store", e1);
            throw e1;
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

        // 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

                    new UriRef(RdfResourceEnum.site.getUri()),
                    new PlainLiteralImpl(referencedSiteName)));
                //in case dereferencing of Entities is enabled we need also to
                //add the RDF data for entities
                if(dereferenceEntitiesState){
                    metadata.addAll(
                        RdfValueFactory.getInstance().toRdfRepresentation(
                            suggestion.getRepresentation()).getRdfGraph());
                }
            }
        }
View Full Code Here

            }
            // if dereferneceEntities is true the entityData will also contain
            // all
            // Representations to add! If false entityData will be empty
            for (Representation rep : entityData.values()) {
                graph.addAll(factory.toRdfRepresentation(rep).getRdfGraph());
            }
        } finally {
            ci.getLock().writeLock().unlock();
        }
View Full Code Here

        // Query the Entity Hub
        Entity signature = referencedSiteManager.getEntity(entityURI);
        if (signature != null) {
            RdfRepresentation rdfSignature = RdfValueFactory.getInstance().toRdfRepresentation(
                signature.getRepresentation());
            graph.addAll(rdfSignature.getRdfGraph());
        }
        return graph;
    }

    @Override
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 (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

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.