...
To create a new EditorialObject
, use class instance, send a POST request using the following curl command to send a POST
request. Ensure that the namedGraph
key and value (namedGraph specifies the graph in the triplestore where your information is preserved), are included in the post POST body with the information you want to create. Passing the namedGraph
is necessary when using ENAPSO together free version.
...
language | bash |
---|
...
with the free version.
You can include an optional namespace variable, which is used to create a unique iri
by attaching it to the iri
before the UUID. If you pass both namespace
and iri
in the variables
object, it will use the iri
you provide. If you pass only the namespace
and not iri
, the iri
will be generated using the namespace.
If you do not pass either iri
or namespace
, it will use the default namespace
(http://ont.enapso.com/dotnetpro#
)and create the iri.
The namespace
should end with a separator # or /, with # being the more practical choice.
Code Block | ||
---|---|---|
| ||
curl -X POST "http://localhost/enapso-dev/view-management/v1/editorialObject" -H "Content-Type: application/json" -d "{\"namedGraph"{\"namedGraph\": \"http://www.ebu.ch/metadata/ontologies/ebucoreplus/demodata\",\"namespace\": \"http://ontwww.enapso.comebu.ch/metadata/ontologies/ebucoreplus/demoDatademodata#\",\"variables\": {\"iri\": \"http://ont.enapso.com/sparql-template#EditorialObject_2f9b1462-e937-4416-8c23-ce96fc42dc55\", \"title\": \"Never Look Away\", \"shotLog\": \"Visual storytelling that captures the protagonist artistic journey and the tumultuous history of Germany.\"}}" |
...
This command sends the data to create a new instance of an EditorialObject
.
2. Read (GET)
To retrieve information of EditorialObject
instances, use the following curl
command to send a GET
request
Basic GET Request
...
\", \"title\": \"Never Look Away\", \"shotLog\": \"Visual storytelling that captures the protagonist artistic journey and the tumultuous history of Germany.\"}}" |
...
This command sends the data to create a new instance of an EditorialObject
.
2. Read (GET)
To retrieve information of EditorialObject
instances, use the following curl
command to send a GET
request
Basic GET Request
To retrieve information about EditorialObject
instances, you can use the following curl command:
Code Block | ||
---|---|---|
| ||
curl -X GET http://localhost/enapso-dev/view-management/v1/editorialObject |
...
Passing Limit and Offset Parameters
To retrieve information about EditorialObject
instances with limit
and offset
parameters, The limit
parameter specifies the maximum number of results to return, while the offset
parameter specifies the starting point in the list of results, effectively skipping the first offset
number of results. you can use the following curl command:
Code Block | language | sh
---|
curl --Xget GET "http://localhost/enapso-dev/view-management/v1/editorialObject |
...
?limit=10&offset=10" |
...
Passing namedGraph Parameters
To retrieve information about EditorialObject
instances with limit and offset namedGraph
parameters, The limit
parameter specifies the maximum number of results to return, while the offset
parameter specifies the starting point in the list of results, effectively skipping the first offset
number of results namedGraph
parameter retrieves the class instances from a specific namedGraph
of the graph database repository. you can use the following curl command:
Code Block |
---|
curl --get "http://localhost/enapso-dev/view-management/v1/editorialObject?limit=10&offset=10"" --data-urlencode "namedGraph=http://www.ebu.ch/metadata/ontologies/ebucoreplus/demodata" |
...
Passing Filters
You can pass filters using the filter.propertyName=value
format in the query parameters. For example, if the property IRI is http://www.ebu.ch/metadata/ontologies/ebucoreplus#title
, you will use the property name title
after the hash.
...
Code Block | ||
---|---|---|
| ||
curl --get "http://localhost/enapso-dev/view-management/v1/editorialObject" --data-urlencode "filter.%3Chttp%3A%2F%2Fwww.ebu.ch%2Fmetadata%2Fontologies%2Febucoreplus%23hasRelatedEditorialObject%3E=http://www.ebu.ch/metadata/ontologies/ebucoreplus/data/Assetdata#Asset_37f6d90c-87c9-4c1f-9a46-ff1102f9bd8a" |
...
The property
title
isRun Lola Run
.The
child-to-parent
(Asset
toEditorialObject
) property<http://www.ebu.ch/metadata/ontologies/ebucoreplus#hasRelatedEditorialObject>
ishttp://www.ebu.ch/metadata/ontologies/ebucoreplus/data/Assetdata#Asset_37f6d90c-87c9-4c1f-9a46-ff1102f9bd8a.
Code Block | ||
---|---|---|
| ||
curl --get "http://localhost/enapso-dev/view-management/v1/editorialObject" --data-urlencode "filter.title=Run Lola Run" --data-urlencode "filter.%3Chttp%3A%2F%2Fwww.ebu.ch%2Fmetadata%2Fontologies%2Febucoreplus%23hasRelatedEditorialObject%3E=http://www.ebu.ch/metadata/ontologies/ebucoreplus/data/Assetdata#Asset_37f6d90c-87c9-4c1f-9a46-ff1102f9bd8a" |
...
To update an existing EditorialObject
, use the following curl
command to send a PATCH
request with the IRI
and new values. Make sure to include the namedGraph
key and value in the post body with the information you want to update. The namedGraph
specifies the graph in the triplestore where your information is preserved. Passing the namedGraph
is necessary when using ENAPSO together free version. otherwiseOtherwise, the update operation will not perform.
Code Block | ||
---|---|---|
| ||
curl -X PATCH "http://localhost/enapso-dev/view-management/v1/editorialObject" -H "Content-Type: application/json" -d "{\"namedGraph\": \"http://ontwww.enapso.comebu.ch/metadata/ontologies/ebucoreplus/demoDatademodata\",\"variables\": {\"iri\": \"http://ont.enapso.com/sparql-template#EditorialObject_2f9b1462-e937-4416-8c23-ce96fc42dc55\", \"productionSynopsis\": \"Directed by Florian Henckel von Donnersmarck, this sweeping historical drama delves into themes of art, love, tragedy, and the inescapable impact of politics on personal lives.\"}}" |
...
Code Block | ||
---|---|---|
| ||
curl -X DELETE "http://localhost/enapso-dev/view-management/v1/editorialObject" -H "Content-Type: application/json" -d "{\"namedGraph\": \"http://ontwww.enapsoebu.comch/ebucoreplus/demoData\",\"variables\": {\"iri\": \"http://ont.enapso.com/sparql-template#EditorialObject_2f9b1462-e937-4416-8c23-ce96fc42dc55\"}}" |
...
This command deletes the EditorialObject
identified by the given IRI
.
These curl
commands provide a direct way to interact with your RESTful API, enabling you to perform create
, read
, update
, and delete
operations on EditorialObject
CORS
Here we need to talk about:
Adding the CORS Plugin for Firefox, Chrome, Edge and Safari.
Configuring the CORS plugin. Here we need also to talk about that we need to support ALL HTTP Methods. In the default Config PATCH is not included!
...
metadata/ontologies/ebucoreplus/demodata\",\"variables\": {\"iri\": \"http://ont.enapso.com/sparql-template#EditorialObject_2f9b1462-e937-4416-8c23-ce96fc42dc55\"}}" |
...
This command deletes the EditorialObject
identified by the given IRI
.
These curl
commands provide a direct way to interact with your RESTful API, enabling you to perform create
, read
, update
, and delete
operations on EditorialObject
CORS
Setting Up CORS for Your Web Client
...