cubiql icon indicating copy to clipboard operation
cubiql copied to clipboard

Search datasets by metadata

Open zeginis opened this issue 7 years ago • 0 comments

We need a functionality to search for datasets based on their metadata:

  • Category or theme (e.g. dcat:keyword, dcat:theme, dct:subject)
  • Publisher (e.g. dct:publisher)
  • License (dct:license)
  • Issued (e.g. dct:issued)
  • Modified (dct:modified)

Expected GraphQL queries:

{datasets(theme:{
       and / or :["http://statistics.gov.scot/def/concept/folders/themes/economy"  
                  “http://statistics.gov.scot/def/concept/folders/themes/population”]}) {
        title
}}
{datasets(publisher:{
            or:["http://statistics.gov.scot/id/organisation/scottish-government"
                 “http://data.ordnancesurvey.co.uk/id/ordnancesurvey”]}) {
        title
}}
{datasets(license:{                                       
            or:["http://www.opendatacommons.org/licenses/pddl/1.0/"  
                  “https://creativecommons.org/licenses/by/4.0/”]}) {
        title
}}
{datasets(issued:{                                       
            or:["22-9-2016" “22-9-2015”]}) {
        title
}}

{datasets(issued:{                                       
             smaller / greater :["22-9-2016"]}) {
        title
}}
{datasets(modified:{                                       
             and /or :["22-9-2016" “22-9-2015”]}) {   //multiple modifications may occur
        title
}}

{datasets(modified:{                                       
               smaller / greater :["22-9-2016"]}) {
        title
}}

Required changes at schema:

:queries
 {:datasets
  {:type    (list :dataset)
   :resolve :resolve-datasets
   :args
            {:dimensions {:type :filter}
             :theme      {:type :filter}   --> add
             :publisher {:type :filter}   --> add
            :license      {:type :filter}  --> add
            :issued      {:type :filter}  --> add
            :modified  {:type :filter}  --> add
             :uri        {:type :uri}}}}    

{:filter
  {:fields
   {:or  {:type        (list :uri)
          :description "List of URIs for which at least one must be contained within matching datasets."}
    :and {:type        (list :uri)
          :description "List of URIs which must all be contained within matching datasets."}
    :greater {:type        (list :uri)                                                    -->add
          :description "List of URIs which matching datasets must have greater values."}  -->add
    :smaller {:type        (list :uri)                                                    -->add  
          :description "List of URIs which matching datasets must have smaller values."}   -->add
}}

zeginis avatar Sep 28 '17 11:09 zeginis