protected void activate(ComponentContext componentContext) { this.context = componentContext.getBundleContext(); try { tcManager.getGraph(Constants.CONFIG_GRAPH_URI); } catch (NoSuchEntityException nsee) { tcManager.createGraph(Constants.CONFIG_GRAPH_URI); } }
private Graph getOrCreatePermisionGraph() { try { return tcManager.getMGraph(permissionGraphName); } catch (NoSuchEntityException e) { return tcManager.createGraph(permissionGraphName); } }
private Graph getOrCreatePermisionGraph() { try { return tcManager.getMGraph(permissionGraphName); } catch (NoSuchEntityException e) { return tcManager.createGraph(permissionGraphName); } }
protected void activate(ComponentContext context) { try { tcManager.getGraph(Constants.CONTENT_GRAPH_URI); } catch (NoSuchEntityException nsee) { tcManager.createGraph(Constants.CONTENT_GRAPH_URI); } String[] additionUriStrings = (String[]) context.getProperties().get( CONTENT_ADDITIONS); additions = new IRI[additionUriStrings.length]; for (int i = 0; i < additionUriStrings.length; i++) { additions[i] = new IRI(additionUriStrings[i]); } }
/** * Should be called within both OSGi and non-OSGi environments. * * @param configuration * @throws IOException */ protected void activate(Dictionary<String,Object> configuration) throws IOException { if (recipeIndexLocation == null || recipeIndexLocation.trim().isEmpty()) { String value = (String) configuration.get(RECIPE_INDEX_LOCATION); if (value != null && !value.trim().isEmpty()) recipeIndexLocation = value; else recipeIndexLocation = _RECIPE_INDEX_LOCATION_DEFAULT; } recipes = new ArrayList<IRI>(); Graph tripleCollection = null; try { tripleCollection = tcManager.getGraph(new IRI(recipeIndexLocation)); } catch (NoSuchEntityException e) { tripleCollection = tcManager.createGraph(new IRI(recipeIndexLocation)); } for (Triple triple : tripleCollection) { IRI recipeID = (IRI) triple.getSubject(); recipes.add(recipeID); } log.info("Rule Store activated. It contains " + recipes.size() + " recipes.", this); }
/** * Should be called within both OSGi and non-OSGi environments. * * @param configuration * @throws IOException */ protected void activate(Dictionary<String,Object> configuration) throws IOException { if (recipeIndexLocation == null || recipeIndexLocation.trim().isEmpty()) { String value = (String) configuration.get(RECIPE_INDEX_LOCATION); if (value != null && !value.trim().isEmpty()) recipeIndexLocation = value; else recipeIndexLocation = _RECIPE_INDEX_LOCATION_DEFAULT; } recipes = new ArrayList<IRI>(); Graph tripleCollection = null; try { tripleCollection = tcManager.getGraph(new IRI(recipeIndexLocation)); } catch (NoSuchEntityException e) { tripleCollection = tcManager.createGraph(new IRI(recipeIndexLocation)); } for (Triple triple : tripleCollection) { IRI recipeID = (IRI) triple.getSubject(); recipes.add(recipeID); } log.info("Rule Store activated. It contains " + recipes.size() + " recipes.", this); }
public static Graph createOntology(String id, TcManager tcm) { IRI name = new IRI(id); Graph ont = tcm.createGraph(name); ont.add(new TripleImpl(name, RDF.type, OWL.Ontology)); return ont; }
public static Graph createOntology(String id, TcManager tcm) { IRI name = new IRI(id); Graph ont = tcm.createGraph(name); ont.add(new TripleImpl(name, RDF.type, OWL.Ontology)); return ont; }
mGraph = tcManager.createGraph(graphIRI);
} catch (NoSuchEntityException e) { log.info(" ... create new Graph {} for Yard {}",yardGraphUri,config.getName()); this.graph = tcManager.createGraph(yardGraphUri);
@Override public Recipe createRecipe(IRI recipeID, String recipeDescription) throws AlreadyExistingRecipeException { Graph tripleCollection; try { // create the Graph in the TcManager tripleCollection = tcManager.createGraph(recipeID); } catch (EntityAlreadyExistsException e) { throw new AlreadyExistingRecipeException(e.getMessage()); } Triple recipeTriple = new TripleImpl(recipeID, RDF.type, Symbols.Recipe); Graph recipeIndexGraph = tcManager.getGraph(new IRI(recipeIndexLocation)); recipeIndexGraph.add(recipeTriple); if (recipeDescription != null && !recipeDescription.isEmpty()) { Triple descriptionTriple = new TripleImpl(recipeID, Symbols.description, new PlainLiteralImpl( recipeDescription)); tripleCollection.add(descriptionTriple); recipeIndexGraph.add(descriptionTriple); } // add the recpe ID to the list of known recipes recipes.add(recipeID); return new RecipeImpl(recipeID, recipeDescription, null); }
@Override public Recipe createRecipe(IRI recipeID, String recipeDescription) throws AlreadyExistingRecipeException { Graph tripleCollection; try { // create the Graph in the TcManager tripleCollection = tcManager.createGraph(recipeID); } catch (EntityAlreadyExistsException e) { throw new AlreadyExistingRecipeException(e.getMessage()); } Triple recipeTriple = new TripleImpl(recipeID, RDF.type, Symbols.Recipe); Graph recipeIndexGraph = tcManager.getGraph(new IRI(recipeIndexLocation)); recipeIndexGraph.add(recipeTriple); if (recipeDescription != null && !recipeDescription.isEmpty()) { Triple descriptionTriple = new TripleImpl(recipeID, Symbols.description, new PlainLiteralImpl( recipeDescription)); tripleCollection.add(descriptionTriple); recipeIndexGraph.add(descriptionTriple); } // add the recpe ID to the list of known recipes recipes.add(recipeID); return new RecipeImpl(recipeID, recipeDescription, null); }
ConstructQuery.class); Graph mGraph = tcManager.createGraph(refactoredOntologyID); for (ConstructQuery constructQuery : constructQueries) { mGraph.addAll(this.sparqlConstruct(constructQuery, datasetID));