You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been reading omero-rdf code because I'm looking into building a similar tool to scrape data from the electronic notebook system (and possibly build a more generic tool for extracting data).
I thought I might write some small "how to use" docs for omero-rdf.
fromomero.plugins.rdfimportRdfControlfromomero.cliimportCLIdefmain():
# OMERO server connection detailshost='localhost'port=4064username='your_username'password='your_password'# Image ID to export as RDFimage_id=123# Create an instance of the CLI classcli=CLI()
# Login to the OMERO servercli.invoke(["login", host, "-u", username, "-w", password, "-p", str(port)])
# Create an instance of the RdfControl classrdf_control=RdfControl(cli)
# Set up the arguments for exporting the RDFargs=Namespace(
target=[f"Image:{image_id}"],
pretty=True,
ellide=False,
trim_whitespace=False
)
# Run the action to export RDFrdf_control.action(args)
# Logout from the OMERO servercli.invoke(["logout"])
if__name__=="__main__":
main()
This is an improved (by chatgpt) version of the script I first wrote to use omero-rdf, though, I'm not entirely sure if that's how it's supposed to be used?
I also could try to add some little introduction on how to build a plugin, which might be helpful for #11.
Please let me know whether I'm on the right path and if docs would be helpful here. :)
The text was updated successfully, but these errors were encountered:
This is really interesting, @marimeireles! It's like ChatGPT read the implementation and did something that would be technically correct, but not optimal (and not something that I think any human has ever done).
With OMERO plugins, there are usually two styles of access:
CLI based, i.e. from Bash
Library based
For the second, we really should do some refactoring so that you don't need any of the boilerplate above. i.e., our goal would be something like:
from omero.gateway import BlitzGateway
from omero_rdf import RdfLibrary
with BlitzGateway("root","omero","xx.xxx.xxx.xx") as conn:
lib = RdfLibrary(connection)
# Load whatever you want here.
Hi Josh,
I've been reading
omero-rdf
code because I'm looking into building a similar tool to scrape data from the electronic notebook system (and possibly build a more generic tool for extracting data).I thought I might write some small "how to use" docs for
omero-rdf
.This is an improved (by chatgpt) version of the script I first wrote to use omero-rdf, though, I'm not entirely sure if that's how it's supposed to be used?
I also could try to add some little introduction on how to build a plugin, which might be helpful for #11.
Please let me know whether I'm on the right path and if docs would be helpful here. :)
The text was updated successfully, but these errors were encountered: