Skip to content

Adding docs #21

Open
Open
@marimeireles

Description

@marimeireles

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.

from omero.plugins.rdf import RdfControl
from omero.cli import CLI

def main():
    # OMERO server connection details
    host = 'localhost'
    port = 4064
    username = 'your_username'
    password = 'your_password'

    # Image ID to export as RDF
    image_id = 123

    # Create an instance of the CLI class
    cli = CLI()

    # Login to the OMERO server
    cli.invoke(["login", host, "-u", username, "-w", password, "-p", str(port)])

    # Create an instance of the RdfControl class
    rdf_control = RdfControl(cli)

    # Set up the arguments for exporting the RDF
    args = Namespace(
        target=[f"Image:{image_id}"],
        pretty=True,
        ellide=False,
        trim_whitespace=False
    )

    # Run the action to export RDF
    rdf_control.action(args)

    # Logout from the OMERO server
    cli.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. :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions