Table of Contents | ||
---|---|---|
|
...
Still, in your command prompt or terminal, pull the latest version of ENAPSO together free:
Here we already need to add that a backup is required, since a new pull overwrites existing data!
Code Block | ||
---|---|---|
| ||
docker pull registry.innotrade.com/innotrade/enapso-together-free |
...
This maps the container's port 80 to your local machine's port 80.
If you encounter a port conflict when attempting to run the Docker container for the ENAPSO together Free platform, you have an option to resolve it and access the service:
Change the Host Port
If port 80 is already in use on your machine, you can map the container's internal port (80) to a different port on your host. For example, if you choose to use port 8080 on your host, you can modify your Docker run command like this:
...
Access Swagger Documentation: Navigate to the GraphDB Management Service documentation in your web browser.
Prepare Your Ontology File: Ensure the
ebucoreplus
ontology file is saved on your local machine. 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 theDownload
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?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 for your ontology 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 (Optional): 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/ebucoreplus
. 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
buttonUpon 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.
Uploading Provided Demo Data
Caution! Re-Pulling Docker Images leads to data loss!
Access Swagger Documentation: Navigate to the GraphDB Management Service documentation in your web browser.
Editorial Object Demo Data: Below is the provided Turtle-formatted demo data for the Editorial Object. This data includes predefined instances that demonstrate the use and structure of the Editorial Object within ebucoreplus ontology.
...
Access View Management API Docs: Use the link provided in the Swagger Documentation Access section.
Generate CRUD Templates: Find the
create-crud-sparql-template-4-class
endpoint in the documentation. This endpoint is used to automatically generate CRUD (Createcreate
, Readread
, Updateupdate
, Deletedelete
) templates for a specific class you specify in the POST body. For instance, if you pass the classhttp://www.ebu.ch/metadata/ontologies/ebucoreplus#EditorialObject
, the endpoint will create four SPARQL templates:readEditorialObject
,createEditorialObject
,updateEditorialObject
, anddeleteEditorialObject
. 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"http://ont.enapso.com/dotnetpro#Person"
associated with"cls"
with the 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 theExecute
button to send the request.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.
...
After generating your CRUD templates, you'll need to use them to manage data. This section explains how to execute the "read
", "create
", "update
" , and "delete
" templates for the EditorialObject
class.
Executing the Read Template
To view existing instances of the EditorialObject
class, follow these steps:
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.
Prepare to Execute the Read Template:
Locate the "
execute-template by name
" endpoint.Click the
Try it out
button to enable input.In Against the
templateName
field key, enterreadEditorialObject
, which is the name of the read template for theEditorialObject
class.Ensure that any existing
variables
are cleared out before executing to avoid any unintended filtering.Click the
Execute
button to send the request.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.
...
To create a new instance of the EditorialObject
class, follow these instructions:
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 against thetemplateName
field key, which is the name of the create template for theEditorialObject
class.Provide necessary
variables
for the new instance. Typically, this would be in JSON format in the body of the request, for example.Code Block { "title": "M - A City Hunts a Murderer", "productionSynopsis": "Directed by Fritz Lang, this thriller is one of the earliest masterpieces of sound cinema, exploring themes of justice, vigilance, and societal response to crime.", "shotLog": "Iconic scenes using shadows and sound to create suspense, notably the murderers eerie whistling of In the Hall of the Mountain King." }
...
After creating a new instance of the EditorialObject
class, it's important to confirm that the instance has indeed been added to the graph database. Follow these steps to verify the creation:
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 Against the
templateName
field key, enterreadEditorialObject
again. This is the same read template you used earlier to view instances.Click the
Execute
button to send the request once more.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.
...
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 against thetemplateName
field key.In the
variables
object, specify theiri
of the instance you wish to update and the properties you want to change. For example,Code Block { "iri": "http://ont.enapso.com/sparql-template#EditorialObject_bf161f6f-4b89-431f-8f83-eb7b51b9a89f", "contentDescription": "In Berlin during the Weimar Republic, the police and the criminal underworld scramble to capture a child murderer who has caused panic across the city." }
Click the
Execute
button to send the update request.The response should indicate whether the update was successful, including confirmation of the changes.
...
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 against thetemplateName
field key.In the
variables
object, provide the IRI of the instance you wish to delete. For example,Code Block { "iri": "http://ont.enapso.com/sparql-template#EditorialObject_bf161f6f-4b89-431f-8f83-eb7b51b9a89f" }
Click the
Execute
button to send the delete request.The response should confirm that the instance has been successfully deleted from the database.
...