Overview
- Mediaflux intro
- Import data with metadata
- Query data based on metadata searches
Mediaflux concepts
- assets - the file content and associated metadata
- namespaces - remote folder structure on the mediaflux server
- XML-based
- has it's own query language
- asset.get - display metadata for an asset
- asset.set - alter metadata for an asset
- asset.query - find assets based on metadata queries
Mediaflux commands
asset.get :id ASSET-ID asset.get :id "path=FULL-PATH-TO-FILE"
asset.set :id ASSET-ID :name "new filename"
A more complex example, where we assign a geospatial location (in this case a point) to an asset:
asset.set :id 1234 :geoshape < :point < :latitude -31.95 :longitude 115.86 :elevation 10.0 > >
This last case is an example of specifying an XML document that details the xpath + value for metadata items.
It is equivalent to an XML metadata document that looks like this:
<geoshape> <point> <latitude> -31.95 </latitude> <longitude> 115.86 </longitude> <elevation> 10.0 </elevation> </point> </geoshape>
If we wanted to extract one of those pieces of information we could do:
asset.get :id 1234 :xpath geoshape/point/elevation value = 10.0
Some arguments to mediaflux require an XML document as input. A common use case might be: populating a metadata template on an asset.
Metadata templates
The doc type shows the metadata that can be queried and specified.
Custom doc types can be made.
Asset is a special "first-order" type attached to everything.
Custom doc types get added under the <meta> element.
asset.doc.type.describe :type asset
asset.set :id ASSET-ID :meta < :mf-note "This is my note >
asset.query :where "LOGICAL-EXPRESSION" asset.query :where "namespace='/projects/Demo'" asset.query :where "namespace>='/projects/Demo' and name='*.jpg'" asset.query :where "namespace>='/projects/Data Team/sean' and (name='*.JPG' or name='*.PNG')"
Simple actions on the results
asset.query :where "namespace>='/projects/Data Team/sean' and name='*.jpg'" :action get-value :xpath -ename name name
Exercises
Exercise 1 - upload a file and then inspect the metadata in the system.
Exercise - querying metadata - geospatial search? TODO - import some geoshape attached