Package org.apache.clerezza.rdf.core

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


        } catch (EntityAlreadyExistsException ex) {
            log.info("Entity " + ref + " already exists in store. Replacing...");
            mg2 = tcManager.getMGraph(ref);
        }

        mg2.addAll(mg);
    }

    @Override
    public OWLOntology ontologyRefactoring(OWLOntology inputOntology, IRI recipeIRI) throws RefactoringException,
                                                                                    NoSuchRecipeException {
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

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

                        Properties.DC_RELATION, textAnnotation));
                }
                //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

                } 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

    @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

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.