public ServiceDiscoveryDialog(KEStore ke, IEnumerable <IResource> selectedNodes) { KE = ke; SelectedNodes = new List <IResource>(selectedNodes); Seen = new Hashtable(); InitializeComponent(); }
public void Register(IServiceProvider serviceProvider) { ITripleStoreProvider tripleStoreProvider = (ITripleStoreProvider)serviceProvider.GetService(typeof(ITripleStoreProvider)); ITripleStoreFactory tripleStoreFactory = ((IFactoryProvider)serviceProvider.GetService(typeof(IFactoryProvider))).Factory; IVisibilityManager visibilityManager = ((IVisibilityManager)serviceProvider.GetService(typeof(IVisibilityManager))); KE = new KEStore(tripleStoreProvider, tripleStoreFactory, visibilityManager); SelectionProvider = (ISelectionProvider)serviceProvider.GetService(typeof(ISelectionProvider)); callServicesItem = new ToolStripMenuItem("Find SADI services..."); callServicesItem.Click += new EventHandler(callServicesItem_Click); IContextMenuProvider contextMenuProvider = (IContextMenuProvider)serviceProvider.GetService(typeof(IContextMenuProvider)); contextMenuProvider.ContextMenu.Opening += new System.ComponentModel.CancelEventHandler(ContextMenu_Opening); contextMenuProvider.ContextMenu.Items.Add(new ToolStripSeparator()); contextMenuProvider.ContextMenu.Items.Add(callServicesItem); try { string logFolder = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); //Trace.Listeners.Add(new TextWriterTraceListener(System.IO.File.AppendText(logFolder + "\\SADI.KE.log"))); Debug.WriteLine("new logging session at " + DateTime.Now); Debug.Flush(); } catch (Exception e) { MessageBox.Show( "Unable to configure logging;\n" + e.Message, "SADI error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }
public ServiceInvocationDialog(KEStore ke, ICollection <SADIService> services, IEnumerable <IResource> selectedNodes) { KE = ke; Services = new List <SADIService>(services); SelectedNodes = new List <IResource>(selectedNodes); InitializeComponent(); }
public void assembleInput(Store store, IEntity inputRoot, KEStore KE) { String uri = inputRoot.Uri.ToString(); Entity root = new Entity(uri); if (inputInstanceQuery != null) { if (KE.SPARQLConstruct(store, inputRoot, inputInstanceQuery)) { store.Add(new Statement(root, SemWebVocab.rdf_type, new Entity(inputClass))); return; } } // if we make it here, we didn't find any input via SPARQL and // have to try and cheat a little... if (KE.HasType(inputRoot, inputClass)) { store.Add(new Statement(root, SemWebVocab.rdf_type, new Entity(inputClass))); LSRNEntity lsrn = LSRNHelper.getEntity(inputRoot.Uri); if (lsrn != null && lsrn.EntityType == inputClass) { store.Add(new Statement(root, SemWebVocab.rdf_type, new Entity(lsrn.EntityType))); Entity identifier = new BNode(); Entity identifier_type = new Entity(lsrn.IdentifierType); store.Add(new Statement(root, SemWebVocab.has_identifier, identifier)); store.Add(new Statement(identifier, SemWebVocab.rdf_type, identifier_type)); store.Add(new Statement(identifier, SemWebVocab.has_value, new Literal(lsrn.ID))); } } }
public KEMapper(KEStore ke) { _ke = ke; _toKE = new Dictionary <string, IEntity>(); _fromKE = new Dictionary <string, Entity>(); }