-
Notifications
You must be signed in to change notification settings - Fork 5
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
Switch query to ebrain-kg-core
#33
Comments
Hi Michael, You might find Example for listing repository contents:
|
@apdavison that looks fantastic! I will take a closer look shortly! Thanks much! |
Hey @apdavison! I now had a chance to try this out, and it works just as advertized -- really cool! I particularly like the readily accessible content of properties, e.g. the type of a file hash >>> f.hash
Hash(algorithm='MD5', digest='1dc869c088d4ebd615287fb79b5853b2') I was hoping that you had also come up with a convention to derive local file paths from the IRIs of files, but I could not find something related to that. To be more specific: I can know the repo a file is in: >>> f.file_repository
KGProxy([<class 'fairgraph.openminds.core.data.file_repository.FileRepository'>], 'https://kg.ebrains.eu/api/instances/00932cbe-f90f-4968-a91f-da717c554320') I can also know the IRI of the file, pointing into that repo >>> f.iri
IRI(https://object.cscs.ch/v1/AUTH_4791e0a3b3de43e2840fe46d9dc2b334/ext-d000017_DiFuMoAtlases_pub/64/DataDescriptor-DiFuMo(64-dimensions).pdf) But there seems to be no standard implementation to derive from this information that a suitable local path could be It seems to require something like "longest-common-prefix". However, this would quickly become messy when a dataset incorporates files from different file repositories (which I understand is not done (yet?), but possible. Are you aware of an implementation for that? Thanks in advance! Unrelated, but worth noting: |
We have some code that does this for CSCS Swift containers, which is the most commonly used file repository in EBRAINS, but nothing for the general case. |
So far we have used hard-crafted queries. With
ebrains-kg-core
available, it makes sense to remove this complication and switch to standard queries provided by this API wrapper. Here are examples:Establish query setup:
Get info on a dataset (by ID):
Get info on a file repository (by ID from dataset version record)
At present it is unclear to me how to get the actual file repository content listing. The only way I see it to visit the
https://core.kg.ebrains.eu/vocab/lastSyncIRI
-type URL, which yields an XML-formatted response that has the container content list. There is likely a better way that does not require a different query/parsing paradigm.The text was updated successfully, but these errors were encountered: