Hello,
Can any one help me with the property/query to find all the assets with missing metadata in a folder path?
Thanks,
Rahul
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Views
Replies
Total Likes
Hi @RahulMohan ,
Please find the below query for finding the asset which are not having a specified metadata properties.
type=dam:Asset
path=/content/dam/your-project-folder-name
1_property.operation:exists
1_property=jcr:content/metadata/dam:ColorSpace
1_property.value:false
p.limit=-1
Above query will fetch all the asset which does not have property dam:ColorSpace as metadata fields.
As you have mentioned you want to search for 10 metadata fields you may use group mechanism. Below is just a reference you may modify as per your requirement. Below query checks for three properties(if any of the three not present it will fetch in the result, you may twist with or / and as per requirements)
type=dam:Asset
path=/content/dam/your-project-folder-name
group.p.or=true
group.1_property.operation:exists
group.1_property=jcr:content/metadata/dam:ColorSpace
group.1_property.value:false
group.2_property.operation:exists
group.2_property=jcr:content/metadata/dam:Fileformat
group.2_property.value:false
group.3_property.operation:exists
group.3_property=jcr:content/metadata/dc:format
group.3_property.value:false
p.limit=-1
Hope this help!
Thanks,
@RahulMohan There are 2 ways to achieve this:
1. Create a metadata export by selecting specific folder. This will generate a CSV file of all assets and their metadata. You can filter out blanks.
2. Or run the following query for your folder path containing the assets:
{
"path": "/content/dam/your-folder-path",
"type": "dam:Asset",
"property.operation": "exists",
"property": "jcr:content/metadata",
"property.value": "false",
"p.limit": "-1",
"p.guessTotal": "true"
}
Hope this helps.
Hi ,
If you are looking for assets missing mandatory metadata then :-
I don't think 2 way is correct as when you upload an asset , it extracts embedded metadata in file like dc:title etc , and also some OOTB generated metadata like dam:size , dc:format , dam:sha etc
For checking missing mandatory metadata - > you will need to write a custom logic .
Hi @digarg ,
Thanks for the response. If there is a missing metadata, the card shows a 'Required Metadata Missing' flag in the card view. And this is OOB. Do we know how that works? It should be using some property to determine that. Even if we need to write custom logic, would like to know what should be the best way to do it. We have around 10 mandatory fields in our schema and that's where I'm looking for any property that denotes missing metadata rather than checking all the 10 fields.
Thanks,
Rahul
Hi @diksha_mishra ,
Thanks for the response. We are aware about the first method. But we are looking for a report we can create and make available to the users to get a list of assets missing metadata in one click or so. I've tried the below query and it is giving all assets in the folder irrespective of the missing metadata or not.
Thanks,
Rahul
Hi @RahulMohan ,
Please find the below query for finding the asset which are not having a specified metadata properties.
type=dam:Asset
path=/content/dam/your-project-folder-name
1_property.operation:exists
1_property=jcr:content/metadata/dam:ColorSpace
1_property.value:false
p.limit=-1
Above query will fetch all the asset which does not have property dam:ColorSpace as metadata fields.
As you have mentioned you want to search for 10 metadata fields you may use group mechanism. Below is just a reference you may modify as per your requirement. Below query checks for three properties(if any of the three not present it will fetch in the result, you may twist with or / and as per requirements)
type=dam:Asset
path=/content/dam/your-project-folder-name
group.p.or=true
group.1_property.operation:exists
group.1_property=jcr:content/metadata/dam:ColorSpace
group.1_property.value:false
group.2_property.operation:exists
group.2_property=jcr:content/metadata/dam:Fileformat
group.2_property.value:false
group.3_property.operation:exists
group.3_property=jcr:content/metadata/dc:format
group.3_property.value:false
p.limit=-1
Hope this help!
Thanks,
Hi @RahulMohan ,
There can be following two scenario.
For this scenario above reply (in this thread)perfectly match and you can easily fetch the list.
2. Find all the asset with properties fields are present but having empty value (which are not set).
We cannot search for empty property from query builder console so we can write custom java code for query builder and check the length( 0 or empty / blank/ boolean whatever applicable).
However with the help of xPath we can search for empty field
PFA
Example1.
Example 2
Above results are for asset shown shown below
Queries:-
/jcr:root/content/dam//*[fn:name()="metadata" and @customproperties= ""]
or
/jcr:root/content/dam//*[jcr:content/metadata/@customproperties= ""]
or
/jcr:root/content/dam//*[@customproperties= ""]
However you can use your project structure path to narrow down the result / query execution time
/jcr:root/content/dam/path-to-projectfolder//*[jcr:content/metadata/@customproperties= ""]
Reference:- https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/aem-query-for-property-wit...
Hi @RahulMohan
please specify if there's any metadata property which you are searching for that you don't want to be available because in general if you don't have metadata node for image then that would cause error(at least in my case).
can you specify then probably i can help you with the exact query for the meantime i am posting a query assuming you are searching for a asset which is having a metadata property dc:title and value is exampleAsset
type=dam:Asset
path=/content/dam
property=jcr:content/metadata/dc:title
property.value=exampleAsset
if you are searching for images which don't have a metadata node that would not make much sense.
Views
Likes
Replies