Rename individual in Protege - protege

With others types, like classes or properties it works to rename object. But for individual I can't find such option.
Is it possible to rename individual without deleting and recreating it? And if not, why?

In order to rename an individual or any other entity on Protégé you will need to click on the entity and choose: Refactor -> Rename Entity...
This will open the following dialog where you can enter the new name:
Another way of doing this is clicking the entity and then pressing Ctr + U, this shortcut will open the same dialog (and it's way faster if you have to rename many things).

Found a solution
Select the entity and go to the top menu - Refactor > Rename Entity and you'll get a renaming dialogue.

Renaming a named individual is the same as renaming any other entity from OWLAPI, so if you can't find it in the UI it might just be a missing functionality.
If you wish to write Java code with the owlapi, you can use OWLEntityRenamer.
Editing with an XML tool will also work, for XML formats - however the operations will be different for rdf/XML and owl/XML.
Plain text editing will also work. Pay attention to name changes that also change the namespace, though - it might require changes in the declared entities.

Haven't found any capabilities to edit from UI, but it's possible to edit from any XML-editor

Another option is to create a slot "name" then go to the instance you created and give the name you wish.
To display the instance with the name you just gave go to the instance browser->menu->select display slot->choose name.You can see here a screenshot which will make it clear!

Related

select and copy files + directory [duplicate]

I am using Tkinter for building a GUI for a python script. I need a button which opens up a dialog box which allows me to select both files and directories.
Till now, I've come across
tkFileDialog.askdirectory(parent=root, title=dirtext1)
which allows just to select directories in the dialog box
and,
tkFileDialog.askopenfilename(parent=root, title=filetext)
which allows me to just select files. As of now, I access these dialog boxes using separate buttons, each of which calls one of these functions.
Is there anyway to select either a file or a folder using a single dialog box?
I don't think so. There is no built-in class to do it easily
Investigation
If you look at the tkFileDialog module's source code, both the Open and the Directory classes inherit from _Dialog, located in tkCommonDialog.
Good so far; these classes are simple and only extend two methods. _fixresult is a hook that filters based on your options (promising), and _fixoptions adds the right tcl parameters (like initial directory).
But when we get to the Dialog class (parent of _Dialog), we see that it calls a tcl command by a given name. The names built-in are "tk_getOpenFile" and "tk_chooseDirectory". We don't have a lot of python-level freedom of the command after this. If we go to see what other tcl scripts are avaliable, we are disappointed.
Looks like your options are
ttk::getOpenFile
ttk::getSaveFile
ttk::chooseDirectory
ttk::getAppendFile
Conclusion
Rats! Luckily, it should be quite easy for you to make your own dialog using listboxes, entry fields, button, (and other tk-builtins), and the os module.
Simple Alternative
From your comments, it looks like a viable simple work-around might be to use
directory = os.path.dirname(os.path.realpath(tkFileDialog.askopenfilename()))
They'll have to select a file, but the "Open" button will "return a path", in the sense that the path is computed from the file location
But I really want it!
If for some reason you really want this behaviour but don't want to remake the widget, you can call tcl scripts directly. It may be possible to copy the code from getOpenFile and provide more loose arguments that allow for selecting a more generic object. This isn't my speciality and seems like a really bad idea, but here is how you call tcl directly and here is where you can learn more about the underlying commands.
I've had a similar issue.
In the end, I used askopenfilenames() (plural) and split the path from the files. Then with a radiobutton, ask the user to choose if they want to process all the files in the directory, or just those they selected.
filetypes = [('All files', '*.*'), ('CSV files', '*.csv'),]
data_list = askopenfilenames(title='Select folder', filetypes=filetypes)
data_dir = data_list[0].rsplit('/', 1)[0]
I mention it because askopenfilenames() doesn't get suggested much, but is closer to selecting a folder, as can ctrl+A all files.

Is it possible to navigate to symbol in class in Rider/Resharper?

There is an option to navigate to symbol in file, but if a file contains many classes it is not very helpful.
Is there an option to navigate within the current class?
In VS we have combo boxes at the top of the file that let us choose the class and the symbol within the class.
In Rider it is possible to open the file structure and look for the symbol there, but it is less convenient.
Am I missing anything?
Instead of the file-specific Go to File Member that you mentioned, try using the more generic Search Everywhere that looks for symbols globally. From there, you can filter to only include members in a certain class: for example, if you're looking for myMember in ClassFoo, enter something like cf mm (or the full ClassFoo myMember if you're not a fan of lowerCamelHumps).
I would expect Go to File Member to also support this kind of filters but it looks like it doesn't.

In visual c++, how to move a class to it's own file?

I have multiple classes within one file and within another class. I need to pull one of the classes out and put in it's own file. I tried the right click: "Add class" option... but get the ERROR "Class 'xxx' is either invalid or already implemented in the selected source file." If I try a different name it works... but I need the same name as before.
Make a new file, Ctrl+X, Ctrl+V - the simplest solution

How can I use a dialog to define the program group name in Installshield 2015

I am currently trying to expand our installation program with an option for the user to specify the name of the program group where shortcuts are created under the start menu. (I am aware that this is a somewhat outdated concept)
I am using InstallShield 2015.
I created a localizable property named [PROGRAMGROUP_NAME]. This has automatically created an {ID_STRING46} which I've set to the desired default value. So far so good.
I managed to create a custom dialog with an edit control, which is linked to the above property.
Now comes the tricky part: Under Shortcuts, under "Programs Menu" I first want to add a folder with the program group name, under which to place several shortcuts.
If I enter [PROGRAMGROUP_NAME] that is literally what the name becomes. If I use {ID_STRING46}, it uses the default value, and not what I've entered in the dialog.
Incidentally, when I tried to rename ID_STRING46 to something more meaningful, other things started going wrong so I've left that as is.
What is going wrong here? How do I get the value of the property to be used for the folder name?
EDIT
I am trying to use a custom action now, but I have trouble defining it. My Dialog that sets the property is after CostFinalize, so I assume I have to use SetDirectory - but I have trouble defining it. I get an error stating "could not access network location "
EDIT
I've managed to progress a step. I have manually added a directory with key DIRECTORY_PROGRAM_GROUP (important that it's all caps to make it public) to the directory table. Then, I use a custom action to set that directory to the desired value [ProgramMenuFolder][PROGRAM_GROUP_NAME] after I've run my dialog, and I've modified the shortcut to be created in that folder.
Seems to work great, however, now the program group is no longer removed when uninstalling...
Shortcuts are installed to folders, and the name of the folders below ProgramMenuFolder become the program group as you describe it. So you will need to either build up the Directory table (either directly---note that the DefaultDir column is localizable, and there may already be a string you can update---or through the Files and Folders view) to do what you want, or use custom actions (set property, if before costing; set directory, if after costing) to adjust the location to which your shortcut is installed.
As for the problems renaming ID_STRING46, odds are you didn't update a reference after you changed the name of the string. The simplest way to track down where these are may be to examine differences in the built installer (perhaps using InstallShield's MSI Diff) and then update the relevant references using the direct editor if you can't find them in the normal views.

How Do I Let the User Save to a Directory?

Language: C++
Development Environment: Microsoft Visual C++
Libraries Used: MFC
Question: I am creating a large preference editing tool with pages of dialogs with different settings for the user to customize. Each "page" of settings will be written to its own XML file.
The user will have two options: 1) Save These, where they will be prompted to specify which pages they wish to save, and 2) Save All, which will save each page into their own XML files.
For the Save All function, I'd like it if the user only had to specify a directory into which he/she wishes to save all of the files. I'm fairly certain that I have to use the FolderBrowserDialog class, but I'm not sure how. I imagine it's very similar to an OpenFile dialog or a SaveFile dialog with one of the arguments specifying to save to a directory.
I found the FolderBrowserDialog class on the MSDN, but it wasn't very helpful. Any help would be greatly appreciated!
SOLUTION: I have found a working solution. It is essentially a combination of a few answers above, but for people seeking a similar solution in the future, I referenced THIS page. The author created a wrapper class for the messy code that is needed to create a directory-chooser dialog. Thank you for all the suggestions. You all helped me along in the right direction. Cheers.
~ Jon
Use ::SHBrowseForFolder(). It shows the standard "browse for folder dialog" (at least up to Windows XP; I've no idea if Vista/7 have a new one).
I personally use it wrapped in a class, as seen here.
I think asking the user to save "individual" pages is weird, me think you should save all of them in one file (hey, but that just me).
If you need to save individual page, you will have to prompt the user with a small dialog that lists the pages and let the user select which page; or you can decide to save only the pages that were modified.
To select a folder, the simplest way is to use ShBrowseForFolder (http://msdn.microsoft.com/en-us/library/bb762115(v=vs.85).aspx)
Max.
Look into the OPENFILENAME structure and the GetSaveFileName function. The latter actually displays the save file dialog.

Resources