我想在Allegrograph中创建一个带有推理的联合商店;我可以在同一个Allegrograph系统中使用2个存储库,但是当我尝试创建一个联合存储,其中有两个存储库位于不同的服务器上;方法server.federated显示错误。
我尝试使用两种解决方案解决这个问题:
第一个我使用virtualRepository来组合两个存储库,它可以工作,但是当我想从我的virtualRepository中获取getConnection时,它会显示以下错误: 代码:
AGVirtualRepository s = server.virtualRepository("<http://ip:10035/repositories/repo1> + <http://ip:10036/repositories/repo2>");
s.initialize();
AGRepositoryConnection rainbowConn = s.getConnection();
closeBeforeExit(rainbowConn);
错误:org.eclipse.rdf4j.repository.RepositoryException: com.franz.agraph.http.exception.AGHttpException: org.apache.commons.httpclient.NoHttpResponseException: The server myserver failed to respond
第二个解决方案我使用Federation Sail添加我的存储库,但是当我运行查询时,即使我调用tupleQuery.setIncludeInferred(true);
代码:
AGServer server = new AGServer(SERVER_URL, USERNAME, PASSWORD);
AGServer server2 = new AGServer(SERVER_URL2, USERNAME2, PASSWORD2);
AGRepository repo1 = server.getCatalog(CATALOG_ID).openRepository("repo1");
AGRepository repo2 = server2.getCatalog(CATALOG_ID).openRepository("repo2");
Federation federation = new Federation();
federation.addMember(repo1);
federation.addMember(repo2);
federation.setReadOnly(true);
SailRepository combinedRepo = new SailRepository(federation);
combinedRepo.initialize();
SailRepositoryConnection gg = combinedRepo.getConnection();
我不知道是否有任何提示可以解决我的问题,谢谢
答案 0 :(得分:0)
使用public class FuelCar : Car
{
private float m_CurrentFuelAmountInCar;
public FuelCar(string i_ModelName, string i_LicenseNumber, int i_NumberOfDoors, eColor i_ColorType, float i_CurrentPressureInWheel,
float i_CurrentFuelAmountInCar): base(i_ModelName, i_LicenseNumber,i_NumberOfDoors,i_ColorType,i_CurrentPressureInWheel)
{
i_Engine = new WorkedOnFuel(WorkedOnFuel.eFuelType.Octan98, 0, 45);
i_Engine.i_Current = i_CurrentFuelAmountInCar; // עידכון כמות הדלק
i_Engine.i_PercentageOfEnergyLeft = i_CurrentFuelAmountInCar / i_Engine.i_Max; // חישוב אחוז שנשאר במנוע
}
public float i_CurrentFuelAmountInCar
{
get
{
return m_CurrentFuelAmountInCar;
}
set
{
m_CurrentFuelAmountInCar = value;
}
}
}
的推理工作我已经这样做了你的查询可能有问题,你能告诉我你的查询并告诉我错误是什么