Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

tAlexander Schulze Review!

...

Before you begin, ensure the following requirements are met:

  • Docker Installed: Docker must be installed and running on your machine to facilitate the deployment of applications within containers. For optimal performance and compatibility, ensure that your Docker installation is version 20.10 or above. To check your Docker version, open your command prompt or terminal and enter:

    Code Block
    languagebash
    docker --version
  • Internet Connection: Necessary to pull the Docker image from the repository.

  • Credentials: Obtain a To request your username and access token by contacting , send an email to support@innotrade.de with the subject line "Request for Credentials."

Docker Setup

Docker Login

Open your command prompt or terminal. Log in to the Docker registry to access the ENAPSO together image using the following command:

...

  1. Access Swagger Documentation: Navigate to the GraphDB Management Service documentation in your web browser.

  2. Prepare Your Ontology File: Ensure the "ebucoreplus" ontology file is saved in text/turtle format on your local machine.

    View file
    nameebucoreplus.ttl
    . You can obtain the EBUCorePlus ontology from the EBU GitHub repository. Once you open the link, you will see the content of the ontology file displayed. To download it, locate the "Download" icon on the upper right side of the page and click on it. This will automatically save the file to the default download folder on your local machine. <= How does this work?

  3. Upload the Ontology: Utilize the "upload-ontology-from-file" endpoint :to upload the ontology to the graph database repository.

    • Click the "Try it out" button.

    • Fill out the following fields:

      • filename: Select and upload your "ebucoreplus" ontology file.

      • format: Specify the format as "text/turtle".

      • baseIRI (Optional): Enter the base IRI if it is necessary for your ontology .
        baseIRI: such as http://www.ebu.ch/metadata/ontologies/ebucoreplus#. Using this base IRI helps ensure consistent referencing within your ontology. If you need to use a specific or different IRI, replace the default with your custom IRI. Enter the base IRI for your ontology.

      • context: Define the context (also known as a named graph) for your ontology within the graph database repository. The context is an identifier that organizes data within the graph database, such as http://www.ebu.ch/metadata/ontologies/ebucorepluscontext: Define the context for your ontology within the graph database repository. If the context field is left empty, behavior varies by triplestore:

        • In Fuseki, data will be added to the default context http://ont.enapso.com/default.

        • In GraphDB by Ontotext, data will be added to the graph database's default context, as described in their documentation.

    • Execute the upload by clicking the "Execute" button.

      execute-button.PNGImage Added

    • Upon execution, the response will indicate that the ontology has been successfully uploaded. You will see a message or a status code in the Swagger interface confirming that the upload was successful.

      execute-response.PNGImage Added

CRUD Template Management

  1. Access View Management API Docs: Use the link provided in the Swagger Documentation Access section.

  2. Generate CRUD Templates: Find the "create-crud-sparql-template-4-class" endpoint in the documentation. This endpoint is used to automatically generate CRUD (Create, Read, Update, Delete) templates for a specific class you specify in the POST body. For instance, if you pass the class http://www.ebu.ch/metadata/ontologies/ebucoreplus#EditorialObject, the endpoint will create four SPARQL templates: readEditorialObject, createEditorialObject, updateEditorialObject, and deleteEditorialObject. These templates enable you to manage instances of the class easily, providing a streamlined approach to handle CRUD operations in your graph database.

    • Click the "Try it out" button.

    • In the displayed POST body, you will find a JSON object with a cls key. Replace the "valuehttp://ont.enapso.com/dotnetpro#Person" associated with "cls" with the ontology class IRI you intend to manage. For example, to manage the EditorialObject class, input: http://www.ebu.ch/metadata/ontologies/ebucoreplus#EditorialObject.

    • After replacing the cls default value in the post body, click the Execute button to send the request.

      Create CRUD Template.PNGImage Added

    • Once executed, the response will confirm the creation of CRUD templates. You'll see a success message along with the names of the CRUD operations (create, read, update, delete) for your class and their respective status codes.

      Create CRUD Template Response.PNGImage Added

Executing CRUD Operations

...

  1. Access Template Execution API: Navigate to the API documentation where you can execute templates by name. This is typically found under the same View Management Service documentation.

  2. Prepare to Execute the Read Template:

    • Locate the "execute-template by name" endpoint.

    • Click the "Try it out" button to enable input.

    • In the templateName field, enter readEditorialObject, which is the name of the read template for the EditorialObject class.

    • Ensure that any existing variables are cleared out before executing to avoid any unintended filtering.

    • Click the "Execute " button to send the request.

      readEditorialObject.PNGImage Added

    • Upon successful execution, the API will return a response displaying all instances of the EditorialObject class. This verifies that the read operation is functioning correctly.

      readEditorialObjectResponse.PNGImage Added

Creating a New Instance

...

  1. Set Up Creation Request:

    • Go back to the "execute-template by name" endpoint if you aren't already there.

    • Click "Try it out" button again to set up a new request.

    • Enter createEditorialObject in the templateName field, which is the name of the create template for the EditorialObject class.

    • Provide necessary variables for the new instance. Typically, this would be in JSON format in the body of the request, such as { "label": "New Editorial Object" }. Make sure to replace "New Editorial Object" with the actual data you wish to use for the new instance.

      createEditorialObject.PNGImage Added

    • Click the "Execute" button to send the creation request.

      createEditorialObjectResponse.PNGImage Added

    • The response will confirm that the new instance has been successfully created. Look for a success message and any details provided about the newly created instance.

...

  1. Re-execute the Read Template:

    • Navigate back to the "execute-template by name" endpoint in the View Management Service documentation.

    • Click the "Try it out" button to enable input for a new request.

    • In the templateName field, enter readEditorialObject again. This is the same read template you used earlier to view instances.

    • Click the "Execute" button to send the request once more.

      readEditorialObject.PNGImage Added

    • The response will now include the list of all current instances of the EditorialObject class. Look through the list to find the newly created instance. You should see the details you entered for the instance, such as the label or any other identifiers, confirming that it has been successfully persisted in the database.

      verify readEditorialObject.PNGImage Added

This process of re-executing the read template serves as a straightforward method to ensure that your CRUD operations are impacting the graph database as expected, providing clear evidence of successful data management within the ENAPSO platform.

...

  1. Access Update Template Execution:

    • Navigate to the "execute-template by name" endpoint in the View Management Service documentation.

    • Click the "Try it out" button.

    • Enter the name of the update template (e.g., updateEditorialObject) in the templateName field.

    • In the variables object, specify the iri of the instance you wish to update and the properties you want to change. For example, you would provide the iri and other properties you are updating.

    • Click the "Execute" button to send the update request.

      updateEditorialObject.PNGImage Added

    • The response should indicate whether the update was successful, including confirmation of the changes.

      updateEditorialObjectResponse.PNGImage Added

Deleting an Instance

To delete an instance from your ontology, you need to specify which instance to remove:

  1. Access Delete Template Execution:

    • Go to the "execute-template by name" endpoint in the View Management Service documentation.

    • Click the "Try it out" button.

    • Enter the name of the delete template (e.g., deleteEditorialObject) in the templateName field.

    • In the variables object, provide the IRI of the instance you wish to delete.

    • Click the "Execute" button to send the delete request.

      deleteEditorialObject.PNGImage Added

    • The response should confirm that the instance has been successfully deleted from the database.

      deleteEditorialObjectResponse.PNGImage Added

Conclusion

Congratulations on successfully setting up and starting to use the ENAPSO Together Free platform for broadcasters. You've learned how to upload an ontology and manage data through CRUD operations, which are crucial for effective data handling within the platform.

...