-
Notifications
You must be signed in to change notification settings - Fork 9
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
Test if OME fields are in JSON-LD OME context #29
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few intermediate comments while you hammer away.
OME = "http://www.openmicroscopy.org/rdf/2016-06/ome_core/" | ||
OMERO = "http://www.openmicroscopy.org/TBD/omero/" | ||
OME = "ome:" | ||
OMERO = "ome:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think I would differentiate here. i.e., either we need no OMERO =
or leave it as omero:
. I'm thinking keep OMERO and will have to split https://gist.githubusercontent.com/stefanches7/5b3402331d901bb3c3384bac047c4ac2/raw/cd45da585bfa630a56ef55670d2b5da2be50ff76/context.ld.json into two files (before we're done)
src/omero_rdf/__init__.py
Outdated
if '@context' in data: | ||
return data['@context'] | ||
else: | ||
print(f"No @context found in {url}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to use logging.warning to prevent losing stdout
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
implementing it right now
src/omero_rdf/__init__.py
Outdated
""" | ||
try: | ||
# Make HTTP request | ||
response = requests.get(url, headers={'Accept': 'application/ld+json'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really want to have this document built into the library so it need not be downloaded remotely but that can be phase 2.
cf. https://github.com/hyperledger-archives/aries-framework-go/blob/main/docs/jsonld_context.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we'd keep a local version of the context, or how? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In XML-land, you create a catalog.xml
(https://github.com/ome/ome-model/blob/908c6ef501f18b329d46a65fb7bd563f0d5580a6/specification/src/main/resources/released-schema/catalog.xml#L5) then you put it into your Java jar (for example) and you never have to hit the network.
Updated the branch to origin/main, resolved conflicts and flake8 warnings. At this stage I'm seeing:
|
|
A heads up that I think this PR will ultimately be more for debugging. I'd really like to find a strategy so we're not |
No description provided.