Table of Contents | ||
---|---|---|
|
...
Note |
---|
When running the pull command, please note that if an image is already running and you pull the latest one, it will overwrite existing data in the knowledge graph repository, resetting it to the default state. To avoid losing your data, follow the guidelines on the provided /wiki/spaces/ENAPSODOCS/pages/2239528974 to create a backup before pulling the latest image, and then restore your data afterward. |
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.Clone EBUCorePlus Repository: If you want to clone the entire repository, ensure that Git is installed on your computer. You can check this by running
git --version
in your terminal. If Git is not installed, you will need to download and install it from the official Git website. Open your command prompt (CMD), and move to the directory where you want the repository to be cloned. You can do this by running the commandcd path/to/your/directory
, replacingpath/to/your/directory
with the path to the desired directory on your local machine. Once you're in the desired directory, run the following command to clone the repository:Code Block language bash git clone https://github.com/ebu/ebucoreplus.git
This will clone the entire ebucoreplus repository to your local machine.
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
button: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 the successful upload.
If you receive both HTTP
200
and HTTP201
responses for similar requests, it means:HTTP
200
is returned when you upload data that
already exists in the graph database repository, indicating a successful overwrite.
HTTP
201
is returned when the upload adds new data to the graph database repository.
Uploading Provided Demo Data
...
Note |
---|
When running the pull command, please note that if an image is already running and you pull the latest one, it will overwrite existing data in the knowledge graph repository, resetting it to the default state. To avoid losing your data, follow the guidelines on the provided /wiki/spaces/ENAPSODOCS/pages/2239528974 to create a backup before pulling the latest image, and then restore your data afterward. |
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.
...
Upload the Ontology Text: Utilize the
upload-ontology-from-text
endpoint to upload the demo data to the graph database repository.Click the
Try it out
button.Fill out the following fields:
fileData: Copy the Turtle text from the
EditorialObject Escaped Demo Data
section and paste it against thefileData
key. Make sure to include the entire text block to preserve the integrity of the data.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#
.context (Optional): Define the context (also known as a named graph) for your demo data, such as
http://www.ebu.ch/metadata/ontologies/ebucoreplus/demodata
.
Execute the upload by clicking the
Execute
button.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.
...
If you receive both
HTTP 200
andHTTP 201
responses for similar requests, it means:HTTP 200
is returned when you upload data that already exists in the graph database repository, indicating a successful overwrite.HTTP 201
is returned when the upload adds new data to the graph database repository.
CRUD Template Management
This section provides detailed instructions on how to generate CRUD (create
, read
, update
, delete
) templates for specific classes within your ontology using the View Management API. By following these steps, you can automate the creation of SPARQL templates that facilitate the management of instances of any specified class, such as the EditorialObject
from the EBUCorePlus
ontology. This process simplifies the implementation of CRUD operations in your graph 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
) against thetemplateName
key.In the
variables
object, specify theiri
of the instance you wish to update, which you can obtain through reading the instance data. Also, include the properties and their values 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.
Deleting an Instance
...
a confirmation message or status code. It's important to note that an HTTP
200
status is returned whether the specific instance whoseIRI
was provided exists or not. This status also indicates successful query execution, not necessarily that any update was performed. Even if no update occurs due to specific conditions not being met, you will still receive a200
OK, signifying that the query itself was processed without errors.
Deleting an Instance
To delete an instance from your ontology, you need to specify which instance to remove by using its IRI (Internationalized Resource Identifier). The IRI serves as a unique identifier for each instance and can be obtained by reading the instance data beforehand. Once you have the IRI, use it to indicate which instance you wish to delete.:
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
) against thetemplateName
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 graph database repository. Even if the instance with the specified
IRI
doesn't exist or if a delete wasn't performed due to certain conditions, the request will still return a200
status code. This indicates that the query was executed successfully, even if no actual deletion occurred.
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.
...