You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
hydrus will support treating collections as a resource once PR HTTP-APIs/hydrus#488 gets merged.
This will bring in some changes to the endpoints at which hydrus is serving data.
Those changes need to be added to agent appropriately.
Expected Behaviour:
Brief description of major changes to the endpoints:
(Note: For below discussion, CommandCollection is a collection class, Command would be non-collection class / parsed class. The meaning of non-collection class would be any class which will not act as a 'collection' of items.)
GET on /collection/
Example endpoint: /CommandCollection/
This fetches the data from the 'CommandCollection' table.
In the above example, 'aaaaaa', 'bbbbb' and 'ccccc' are the ids(primary key) of the instances in Command table.
This adds data in the 'CommandCollection' table.
Example response:
{
"@context": "http://www.w3.org/ns/hydra/context.jsonld",
"@type": "Status",
"description": "Object with ID 50ed3b68-9437-4c68-93d4-b67013b9d412 successfully added",
"statusCode": 201,
"title": "Object successfully added."
}
NOTE: The id returned is actually the value of the collection_id column in the table, not the primary key id.
3) GET on /collection/id
Example endpoint: /CommandCollection/50ed3b68-9437-4c68-93d4-b67013b9d412
Note: The id is corresponding to the collection_id column in the CommandCollection table, not the primary key id.
Example response:
Will return all the members belonging to the collection with given collection_id.
Seems like we need to discuss the Redis layer again due to the latest changes. Earlier, collection members were fetched from the server everytime a request was made to the Collection endpoint and only class instances were stored. And now since a class can have members just like collections, so we need to decide whether to cache them or not.
I'm submitting a
Current Behaviour:
hydrus
will support treating collections as a resource once PR HTTP-APIs/hydrus#488 gets merged.This will bring in some changes to the endpoints at which
hydrus
is serving data.Those changes need to be added to
agent
appropriately.Expected Behaviour:
Brief description of major changes to the endpoints:
(Note: For below discussion,
CommandCollection
is a collection class,Command
would be non-collection class / parsed class. The meaning of non-collection class would be any class which will not act as a 'collection' of items.)/collection/
Example endpoint:
/CommandCollection/
This fetches the data from the 'CommandCollection' table.
Example response:
Will return a list of collections.
/collection/
Example endpoint:
/CommandCollection/
The request body should have the list of ids of class instances which would be grouped into a collection.
For eg,
In the above example, 'aaaaaa', 'bbbbb' and 'ccccc' are the
ids
(primary key) of the instances inCommand
table.This adds data in the 'CommandCollection' table.
Example response:
NOTE: The
id
returned is actually the value of thecollection_id
column in the table, not the primary keyid
.3) GET on
/collection/id
Example endpoint:
/CommandCollection/50ed3b68-9437-4c68-93d4-b67013b9d412
Note: The
id
is corresponding to thecollection_id
column in theCommandCollection
table, not the primary keyid
.Example response:
Will return all the members belonging to the collection with given
collection_id
./collection/id
Example endpoint:
/CommandCollection/50ed3b68-9437-4c68-93d4-b67013b9d412
The request body should have the list of members to be updated for the given collection.
For eg,
Note: The
id
is corresponding to thecollection_id
column in theCommandCollection
table, not the primary keyid
.Example response:
Will update all the members belonging to the collection with given
collection_id
with the members given in the request body./collection/id
Example endpoint:
/CommandCollection/50ed3b68-9437-4c68-93d4-b67013b9d412
Note: The
id
is corresponding to thecollection_id
column in theCommandCollection
table, not the primary keyid
.Example response:
Will delete that collection from the table.
/non-collection-class
Example endpoint:
/Command/
or/Area
NOTE: All of these will have the same behaviour as what would have happened before on
/CommandCollection/
endpointThe text was updated successfully, but these errors were encountered: