protegeproject / protege

Protege Desktop
http://protege.stanford.edu
Other
1.03k stars 230 forks source link

Add functionality to Auto-replace IRIs and Auto-generate IDs #940

Open rrovetto opened 4 years ago

rrovetto commented 4 years ago

Please add the following functionalities to Protege, either in the Auto-generate IDs section, or elsewhere:

1) Functionality to automatically change all existing entity IRIs to (alpha)numerical or random-generated (globally unique) IRIs. 2) For sequential IRI option, please also add the ability to do so in a user-specified sequence, e.g., change existing or add new IRIs numerically by 5's, 10's, 20's, etc. Example: each entity or new entity is given an IRI by 5's... 0005, 0010, 0015, etc.

Context: The Auto-generate ID option in Preferences menu under the New Entities tab can adds numerical or random-generated IRIs to new entities only. For numerical it only increments by 1's. But there does not appear to be ability to change existing entities.

Benefit: this will allow users to save a lot of time from manually having to change all IRIs

Thank you.

jamesaoverton commented 4 years ago

Hi @rrovetto. I think that the batch editing functionality you're requesting is quite different from existing Protege features, and I would be surprised if the team agree to add it. However ROBOT is designed for this sort of work. You could:

  1. write a bit of SPARQL and run robot query to get a list of all entity IRIs in the source ontology
  2. use spreadsheet program to specify a mapping from the old IRIs to your preferred IRIs -- the "fill down" function of Excel is good for repeating patterns
  3. run robot rename to apply the mapping and generate a new OWL file
rrovetto commented 4 years ago

hi @jamesaoverton. That might be one way to do it, but I suspect many would not want to do all of that, and some may not know how. The general Auto-generate feature is already there, but the more specific functionality I request above isn't (Alan had said it might already be there in the Auto-generate section), so I'm confident the community would find the functionality valuable if Protege would add it.

rsgoncalves commented 4 years ago

Hi @rrovetto. As @jamesaoverton said, the kind of ontology manipulation functionality that you request does sit outside core Protege purposes, and so we don't plan to implement it.

Fortunately ROBOT is designed to do this kind of operation, and we recommend you give it a try.

Out of curiosity, why do you want to have custom increments for sequential IRIs?

rrovetto commented 4 years ago

FYI: the question was asked before at http://protege-project.136.n4.nabble.com/Updating-entity-IRIs-along-with-ontology-IRI-td4278763.html#a4289822