public KnowledgeGraphConnectionProperties( Uri serviceURL )
Public Function New( _ ByVal serviceURL As Uri _ )
Parameters
- serviceURL
- A valid path to a service URL.
KnowledgeGraphConnectionProperties
class.public KnowledgeGraphConnectionProperties( Uri serviceURL )
Public Function New( _ ByVal serviceURL As Uri _ )
Exception | Description |
---|---|
System.ArgumentNullException | serviceURL is null. |
string url = @"https://acme.server.com/server/rest/services/Hosted/AcmeKnowledgeGraph/KnowledgeGraphServer"; QueuedTask.Run(() => { //Create a connection properties var kg_props = new KnowledgeGraphConnectionProperties(new Uri(url)); try { //Open a connection using (var kg = new KnowledgeGraph(kg_props)) { //TODO...use the KnowledgeGraph } } catch (GeodatabaseNotFoundOrOpenedException ex) { System.Diagnostics.Debug.WriteLine(ex.ToString()); } });
QueuedTask.Run(() => { //Create a connection properties var kg_props = new KnowledgeGraphConnectionProperties(new Uri(url)); //Connect to the KnowledgeGraph datastore //KnowledgeGraph datastores contain tables and feature classes using (var kg = new KnowledgeGraph(kg_props)) { //Get the featureclass definitions from the KG datastore var fc_defs = kg.GetDefinitions<FeatureClassDefinition>(); //For each feature class definition, get the corresponding //feature class. Note: The name of the feature class will match //the name of its corresponding KnowledgeGraph named object type //in the KnowledgeGraph graph data model foreach (var fc_def in fc_defs) { var fc_name = fc_def.GetName(); using (var fc = kg.OpenDataset<FeatureClass>(fc_name)) { //TODO - use the feature class } } } });
QueuedTask.Run(() => { //Create a connection properties var kg_props = new KnowledgeGraphConnectionProperties(new Uri(url)); //Connect to the KnowledgeGraph datastore //KnowledgeGraph datastores contain tables and feature classes using (var kg = new KnowledgeGraph(kg_props)) { //Get the table definitions from the KG datastore var tbl_defs = kg.GetDefinitions<TableDefinition>(); //For each table definition, get the corresponding //table. Note: The name of the table will match the name //of its corresponding KnowledgeGraph named object type in //the KnowledgeGraph graph data model foreach (var tbl_def in tbl_defs) { var tbl_name = tbl_def.GetName(); using (var fc = kg.OpenDataset<Table>(tbl_name)) { //TODO - use the table } } } });
Target Platforms: Windows 11, Windows 10