Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

External link to subgroup of domain #109

Open
znarthur opened this issue Mar 22, 2017 · 3 comments
Open

External link to subgroup of domain #109

znarthur opened this issue Mar 22, 2017 · 3 comments

Comments

@znarthur
Copy link

znarthur commented Mar 22, 2017

I am trying to repackage individual groups (of nexus entries) stored under separate domains into one hdf5 file. I have already created an external database of searchable metadata from within the individual scans, and want to be able to download (using the exporth5.py or a modifed version) the contents of this temporary domain (which is just a series of links of similiar scans from across the h5server database) . To this end I started by creating a temporary domain, temp.sgm.clsi.ca, and started adding external links to the desired groups. It turns out that the generated external link e.g.
links": [ { "target": "http://localhost:5000/#h5path(/entry1)?host=Cu_mesh_scan.zarthur.sgm.clsi.ca", "h5path": "/entry1", "title": "entry1", "h5domain": "Cu_mesh_scan.zarthur.sgm.clsi.ca", "href": "http://localhost:5000/groups/8ad1657e-0e78-11e7-b869-080027f91ab0/links/entry1?host=temp.sgm.clsi.ca", "class": "H5L_TYPE_EXTERNAL" } ]
.. doesn't actually refer to anything and is redirected to the base uri for the h5serv. In fact, even the root of the domain isn't accessible using this href construct. I created the external link using the python requests library:

payload
{'h5domain': 'Cu_mesh_scan.zarthur.sgm.clsi.ca', 'h5path': '/entry1'}
string
'http://localhost:5000/groups/8ad1657e-0e78-11e7-b869-080027f91ab0/links/entry1'
rsg = requests.put(string, data = json.dumps(payload), headers={'host':'temp.sgm.clsi.ca'})

Additionaly, no matter how I construct the GET request using h5path and h5domain parameters I can't seem to get the desired response from getUUIDByPath coming out of hdf5db either. In summary, it seems like the external linking is not functioning the way one would hope, and I am unsure of how best to remedy or work around this problem.

@jreadey
Copy link
Member

jreadey commented Mar 22, 2017

I'm not surprised you've ran into some issues with external links. Even with the HDF5 lib, it's not exactly defined how the client should deal with the filename and path values returned (e.g. what happens to a relative path if the file is moved to a different directory?).

Anyway, I did use external links for the TOC (table of contents) functionality in h5serv. If you go to: https://data.hdfgroup.org:7258/groups/65a37100-45a3-11e6-9008-0242ac110003/links and look at some of the external links, you'll see how the h5domain and h5keys work. (you may want to install a JSON plugin for your browser to make this easier to see).

Clicking on "target" key in an external link jumps you to that domain/path (though it doesn't seem any of these are using any other path than '/').

Does that help? If this is a bug rather than a usage issue, can you submit a PR with a h5serv/test/integ/linktest.py test that illustrates the problem?

@znarthur
Copy link
Author

I didn't end up looking too much into this. I instead just used a little visititems from h5pyd to copy the contents under /entry# and write it to a local file. I will see if I can reproduce the original problem and submit a PR next week.

@jreadey
Copy link
Member

jreadey commented May 11, 2017

Ok, that will be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants