public void connectMarkLogic() { string query = "SELECT * WHERE {?s ?p ?o} LIMIT 50"; var endpoint = new VDS.RDF.Query.SparqlRemoteEndpoint(new Uri("http://*****:*****@123"); SparqlResultSet results = endpoint.QueryWithResultSet(query); }
public void connectOntotext() { string query = "SELECT * WHERE {?s ?p ?o} LIMIT 50"; var endpoint = new VDS.RDF.Query.SparqlRemoteEndpoint(new Uri("http://localhost:7200/repositories/786")); VDS.RDF.Options.ForceHttpBasicAuth = true; endpoint.SetCredentials("admin", "admin"); SparqlResultSet results = endpoint.QueryWithResultSet(query); }
private static IDataObjectContext MakeSparqlDataObjectContext(ConnectionString connectionString) { var queryEndpoint = new SparqlRemoteEndpoint(new Uri(connectionString.DnrQuery)); if (!String.IsNullOrEmpty(connectionString.UserName) && !String.IsNullOrEmpty(connectionString.Password)) { queryEndpoint.SetCredentials(connectionString.UserName, connectionString.Password); } var queryProcessor = new RemoteQueryProcessor(queryEndpoint); ISparqlUpdateProcessor updateProcessor = null; if (!String.IsNullOrEmpty(connectionString.DnrUpdate)) { #if PORTABLE || SILVERLIGHT throw new NotSupportedException("The PCL and mobile builds of BrightstarDB do not currently support stores that use SPARQL Update. The store may be opened as a read-only store by removing the update= parameter in the connection string."); #else var updateEndpoint = new SparqlRemoteUpdateEndpoint(new Uri(connectionString.DnrUpdate)); if (!String.IsNullOrEmpty(connectionString.UserName) && !String.IsNullOrEmpty(connectionString.Password)) { updateEndpoint.SetCredentials(connectionString.UserName, connectionString.Password); } updateProcessor = new RemoteUpdateProcessor(updateEndpoint); #endif } return new SparqlDataObjectContext(queryProcessor, updateProcessor, connectionString.OptimisticLocking); }