java - allegro graph - federate repositories located on different server -
I am trying to create an abstract repository for a federal search on the Alegre graph. I am able to connect to the repository stored on different servers. However, when I try to combine them using the Federal Union, it throws an error that it can not get repo on the other server whether it is stored on separate servers Is there a way to collect two repositories in an abstract repository where federal search can be done?
AGServer server = new AGServer (SERVER_URL1, USERNAME1, PASSWORD1); AGRepository repo1 = server.getRootCatalog (). OpenRepository (REPO1); AGServer server2 = new AGServer (SERVER_URL2, USERNAME2, PASSWORD2); AGRepository repo2 = server2.getRootCatalog (). OpenRepository (REPO2); Println (.repo1.getConnection () size ()); Println (. Repo2.getConnection () size ()); AGAbstractRepository Combined Repo = server.federate (repo1, repo2); JointRepo.initialize (); JointRepo.getConnection (); // This thread "main" org.openrdf.repository.RepositoryException: org.openrdf.repository.RepositoryException the returns an exception exception was not found in the repository with ID: repository not .AGCatalog on com.franz.agraph.repository .openRepository (AGCatalog. Java: 264) ... on sun.reflect.NativeMethodAccessorImpl.invoke0 (sun.reflect.DellegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl on SunkreflectkNativeMethodAccessorImplkinvoke (NativeMethodAccessorImplkjava:57) on the Basic Law). Java: 43) by Java.lang.reflect.Method.invoke (method.java:606) com.intellij.rt.execution.application.AppMain.main (AppMain.java:120) Reason: org.openrdf.repository .RepositoryException: Found with no repository ID: REPO2 com.franz .agraph.repository.AGCatalog.openRepository (AGCatalog.java, 60) ... 6 more
TIA
Sesame Framework supports a Federatio N cell
which you can wrap many sesame repositories (living in various servers / locations) in a virtual store Can use for You can try and use the BSP Federation Code of Alegraphograph (which is only prepared for multiple repositories on the same server):
// create your AG repositories in the same way as AGServer Server = new AGServer (SERVER_URL1, USERNAME1, PASSWORD1); AGRepository repo1 = server.getRootCatalog (). OpenRepository (REPO1); AGServer server2 = new AGServer (SERVER_URL2, USERNAME2, PASSWORD2); AGRepository repo2 = server2.getRootCatalog (). OpenRepository (REPO2); // Use a sesame federation to combine them org.openrdf.sail.federation.Federation federation = new Federation (); Federation.addMember (repo1); Federation.addMember (repo2); Federation.setReadOnly (true); // assuming that you use it only for the query repository combined Repo = new SailRepository (federation); JointRepo.initialize (); (ObDisclaimer: Above the code written above the top of my head, I've ignored a required conference description to work on it - but hopefully you are expecting it) One option is that you work with SPARQL support for services, through the SERVICE section. It would be necessary that you want to ask that each repository is accessible as a SPARQL endpoint via HTTP.
Comments
Post a Comment