[Eagle-i-admins] Eagle-i update for location of existing resource

Cheng, Sophia Kuen Sophia_Cheng at hms.harvard.edu
Wed May 4 14:46:19 EDT 2016


Dear Jim,

There is no easy user interface for doing this, but it is possible using the graph endpoint of the repository (https://open.med.harvard.edu/wiki/display/eaglei/Repository+Design+Specification+and+API+Manual#RepositoryDesignSpecificationandAPIManual-LoadSerializedRDFintoNamedGraph(/graph-POST,PUT)). This endpoint allows users to directly manipulate the triples in the triple store.

One possible solution is to get the list of URIs for the resources that need to moved and then write a script which first deletes the triple “resource location oldLocation” and then adds the triple “resource location newLocation”. The following are two example curl commands which do this for a resource, delete & add:

curl -s -S -u USERNAME:PASSWORD
-F 'content=@-;type=text/rdf+n3'
-F 'name=http://eagle-i.org/ont/repo/1.0/NG_Published'
-F 'action=delete' "https://alaska.qa.eagle-i.net:8443/repository/graph" <<.
<http://alaska.qa.eagle-i.net/i/0000012b-d012-84c9-cc6c-4dda80000000> <http://purl.obolibrary.org/obo/RO_0001025> <http://alaska.qa.eagle-i.net/i/0000012a-25c2-586d-76e0-f22c80000000> .
.

curl -s -S -u USERNAME:PASSWORD
-F 'content=@-;type=text/rdf+n3'
-F 'name=http://eagle-i.org/ont/repo/1.0/NG_Published'
-F 'action=add’ "https://alaska.qa.eagle-i.net:8443/repository/graph" <<.
<http://alaska.qa.eagle-i.net/i/0000012b-d012-84c9-cc6c-4dda80000000> <http://purl.obolibrary.org/obo/RO_0001025> <http://alaska.qa.eagle-i.net/i/00000154-7d0c-6df8-8a67-527480000000> .
.

Please note the following:

  *   There is intentionally an extra period on its own line at the end
  *   Replace USERNAME:PASSWORD with credentials for a user that has editing permissions
  *   This command specifically assumes the resource has been published. If you are moving resources that are in the Withdrawn or Draft state, update the name parameter accordingly

I would highly recommend testing this out on test data as the changes that are made are not reversible. Or making a backup of your data prior to trying this out.

I hope this helps. Let me know if you have any other questions.

Thanks,
Sophia

From: <eagle-i-admins-bounces at open.med.harvard.edu<mailto:eagle-i-admins-bounces at open.med.harvard.edu>> on behalf of "Robertson, Jim" <jrobertson3 at hmc.psu.edu<mailto:jrobertson3 at hmc.psu.edu>>
Date: Monday, May 2, 2016 at 4:08 PM
To: eagle-i-admins <eagle-i-admins at open.med.harvard.edu<mailto:eagle-i-admins at open.med.harvard.edu>>
Subject: [Eagle-i-admins] Eagle-i update for location of existing resource

Dear eagle-i admins,
  We have resources which need to be moved to a new provider.  Is there a built-in way to update the location on a record other than to duplicate the record?

Regards,
Jim Robertson
Systems Analyst – Research Informatics
Phone: (717) 531-0003 x289483
Email:   jrobertson3 at hmc.psu.edu<mailto:jrobertson3 at hmc.psu.edu>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://open.med.harvard.edu/pipermail/eagle-i-admins/attachments/20160504/b8636d98/attachment.html>


More information about the Eagle-i-admins mailing list