Is your feature request related to a problem? Please describe.
GET /api/files/{id}/metadata.jsonld
GET /api/datasets/{id}/metadata.jsonld
the response of above two endpoints do not include metadata id; when working on the React frontend, in order to properly delete a metadata, we need that metadata id in the response
Describe the solution you'd like
here is an example of the current response:
[
{
"@context": [
"https://clowderframework.org/contexts/metadata.jsonld",
{
"csv_headers": "http://clowder.ncsa.illinois.edu/metadata/ncsa.csvheaders"
}
],
"attached_to": {
"resource_type": "cat:file",
"url": "https://clowder.ncsa.illinois.edu/clowder/files/610d55745e0e9253e6586490"
},
"created_at": "Fri Sep 17 14:47:20 GMT 2021",
"agent": {
"@type": "cat:extractor",
"name": "https://clowderframework.org/clowder/extractors/ncsa.csvheaders/1.0",
"extractor_id": "https://clowderframework.org/clowder/extractors/ncsa.csvheaders/1.0"
},
"content": {
"csv_headers": [
"Site_ID",
"Date&Time",
"Discharge(cms)"
]
}
}
]
proposing to add a id field there
Describe alternatives you've considered
NA
Additional context
probably we need to do something in here
def getExtractedMetadataByAttachTo(resourceRef: ResourceRef, extractor: String): List[Metadata] = {
val regex = ".*extractors/"+extractor
val order = MongoDBObject("createdAt" -> -1)
MetadataDAO.find(MongoDBObject(
"attachedTo.resourceType" -> resourceRef.resourceType.name,
"attachedTo._id" -> new ObjectId(resourceRef.id.stringify),
// Get only extractors metadata even if specific extractor not given
"creator.extractorId" -> (regex).r
)).sort(order).toList
}
Is your feature request related to a problem? Please describe.
GET /api/files/{id}/metadata.jsonld
GET /api/datasets/{id}/metadata.jsonld
the response of above two endpoints do not include metadata id; when working on the React frontend, in order to properly delete a metadata, we need that metadata id in the response
Describe the solution you'd like
here is an example of the current response:
proposing to add a
idfield thereDescribe alternatives you've considered
NA
Additional context
probably we need to do something in here