public GraphSource(UriRef graphId) { this(graphId, TcManager.getInstance()); }
/** * Creates a new input source by querying the default triple collection manager for a graph named with the * supplied <code>graphId</code>. The supplied ID will also be set as the graph origin. * * @param graphId * the graph ID. * @throws NullPointerException * if there is no default triple collection manager available. * @throws org.apache.clerezza.rdf.core.access.NoSuchEntityException * if no such graph can be found. */ public GraphSource(IRI graphId) { this(graphId, TcManager.getInstance()); }
/** * Creates a new input source by querying the default triple collection manager for a graph named with the * supplied <code>graphId</code>. The supplied ID will also be set as the graph origin. * * @param graphId * the graph ID. * @throws NullPointerException * if there is no default triple collection manager available. * @throws org.apache.clerezza.rdf.core.access.NoSuchEntityException * if no such graph can be found. */ public GraphSource(IRI graphId) { this(graphId, TcManager.getInstance()); }
public ClerezzaOntologyProvider(TcProvider store, OfflineConfiguration offline, Parser parser) { this(); this.offlineConfig = offline; // Re-assign the TcManager if no store is supplied if (store == null) store = TcManager.getInstance(); this.store = store; if (this.tcManager == null) this.tcManager = TcManager.getInstance(); // Same for the parser if (parser == null) this.parser = Parser.getInstance(); else this.parser = parser; activate(new Hashtable<String,Object>()); }
public ClerezzaOntologyProvider(TcProvider store, OfflineConfiguration offline, Parser parser) { this(); this.offlineConfig = offline; // Re-assign the TcManager if no store is supplied if (store == null) store = TcManager.getInstance(); this.store = store; if (this.tcManager == null) this.tcManager = TcManager.getInstance(); // Same for the parser if (parser == null) this.parser = Parser.getInstance(); else this.parser = parser; activate(new Hashtable<String,Object>()); }
public ClerezzaOntologyProvider(TcProvider store, OfflineConfiguration offline, Parser parser) { this(); this.offlineConfig = offline; // Re-assign the TcManager if no store is supplied if (store == null) store = TcManager.getInstance(); this.store = store; if (this.tcManager == null) this.tcManager = TcManager.getInstance(); // Same for the parser if (parser == null) this.parser = Parser.getInstance(); else this.parser = parser; activate(new Hashtable<String,Object>()); }
public static MGraph createOntology(String id) { return createOntology(id, TcManager.getInstance()); }
public static Graph createOntology(String id) { return createOntology(id, TcManager.getInstance()); }
public static Graph createOntology(String id) { return createOntology(id, TcManager.getInstance()); }
private MGraph getConceptCacheMGraph() { MGraph conceptCacheMGraph = null; TcManager tcManager = TcManager.getInstance(); try { conceptCacheMGraph = tcManager.getMGraph(CONCEPT_CACHE_MGRAPH); } catch (NoSuchEntityException nsee) { conceptCacheMGraph = tcManager.createMGraph(CONCEPT_CACHE_MGRAPH); } return conceptCacheMGraph; }
@Override public void setCache(OntologyProvider<?> cache) { if (cache == null) cache = new ClerezzaOntologyProvider(TcManager.getInstance(), null, Parser.getInstance()); else { Object store = cache.getStore(); if (!(store instanceof TcProvider || store instanceof OWLOntologyManager)) throw new IllegalArgumentException( "Type " + store.getClass() + "is not supported. This ontology library implementation only supports caches based on either " + TcProvider.class + " or " + OWLOntologyManager.class); } this.cache = cache; }
@Override public void setCache(OntologyProvider<?> cache) { if (cache == null) cache = new ClerezzaOntologyProvider(TcManager.getInstance(), null, Parser.getInstance()); else { Object store = cache.getStore(); if (!(store instanceof TcProvider || store instanceof OWLOntologyManager)) throw new IllegalArgumentException( "Type " + store.getClass() + "is not supported. This ontology library implementation only supports caches based on either " + TcProvider.class + " or " + OWLOntologyManager.class); } this.cache = cache; }
protected Set<TripleCollection> getImportedGraphs(TripleCollection g, boolean recursive) { Set<TripleCollection> result = new HashSet<TripleCollection>(); UriRef u = OWLUtils.guessOntologyIdentifier(g); Iterator<Triple> it = g.filter(u, OWL.imports, null); while (it.hasNext()) { Resource r = it.next().getObject(); if (r instanceof UriRef) { TripleCollection gr = TcManager.getInstance().getTriples((UriRef) r); // Avoid calls to getGraph() to save memory // if (gr instanceof Graph) result.add(/* (Graph) */gr); // else if (gr instanceof MGraph) result.add(((MGraph) gr).getGraph()); if (recursive) result.addAll(getImportedGraphs(gr, true)); } } return result; }
/** * This method creates an {@link MGraph} to store concepts' descriptions * if this graph does not already exist. * * @return * an {@link MGraph} */ public MGraph getRemoteConceptsDescriptionMGraph() { MGraph remoteConceptsDescriptionMGraph = null; TcManager tcManager = TcManager.getInstance(); try { remoteConceptsDescriptionMGraph = tcManager.getMGraph(REMOTE_CONCEPTS_DESCRIPTION_MGRAPH); } catch (NoSuchEntityException nsee) { remoteConceptsDescriptionMGraph = tcManager.createMGraph(REMOTE_CONCEPTS_DESCRIPTION_MGRAPH); } return remoteConceptsDescriptionMGraph; }
if(tcManager == null){ //this will be the case if we are not in an OSGI environment tcManager = TcManager.getInstance();
cache = new ClerezzaOntologyProvider(TcManager.getInstance(), offline, Parser.getInstance()); if (child instanceof Library) { if (this.cache != null) ((Library) child).setCache(this.cache); else ((Library) child).setCache(new ClerezzaOntologyProvider(TcManager.getInstance(), offline, Parser.getInstance()));
cache = new ClerezzaOntologyProvider(TcManager.getInstance(), offline, Parser.getInstance()); if (child instanceof Library) { if (this.cache != null) ((Library) child).setCache(this.cache); else ((Library) child).setCache(new ClerezzaOntologyProvider(TcManager.getInstance(), offline, Parser.getInstance()));