public Proxy createProxy(URI proxyURI, URI arURI) throws OREException { // first validate whether this is allowed: // - proxy must be unique in Aggregation // - proxy must be unique to AggregatedResource Selector selector = new SimpleSelector(model.createResource(proxyURI.toString()), null, (RDFNode) null); StmtIterator itr = model.listStatements(selector); if (itr.hasNext()) { throw new OREException( "URI: " + proxyURI.toString() + " is already in use by this Aggregation"); } // go ahead and create the proxy Proxy proxy = OREFactory.createProxy(proxyURI); // if the URI doesn't exist, it will be created proxy.setProxyForURI(arURI); this.addProxy(proxy); ((ProxyJena) proxy).setModel(model, proxyURI); return proxy; }
public static Proxy createProxy(Model model, URI resourceURI) throws OREException { ProxyJena proxy = new ProxyJena(); proxy.setModel(model, resourceURI); return proxy; }