display: >-
  Show me <b>attributes in the knowledge graph</b> that report values with {{id_1}} as their unit of measure, as well as the count of distinct polymer nanocomposite samples and count of distinct research articles linked to that attribute and unit combination, in descending order by {{id_2}} count.
options:
  id_1:
    Celsius: Celsius
    Megapascal: Megapascal
    Hertz: Hertz
    Percent: Percent
    Pascal: Pascal
    Gigapascal: Gigapascal
    Siemens per Centimeter: Siemens per Centimeter
    Siemens per Meter: Siemens per Meter
    Kilovolt per Millimeter: Kilovolt per Millimeter
    Ohm Centimeter: Ohm Centimeter
    Second: Second
    Kelvin: Kelvin
    Micrometer: Micrometer
    Watt per Meter-Kelvin: Watt per Meter-Kelvin
    Kilopascal: Kilopascal
    Kilojoule per Square Meter: Kilojoule per Square Meter
    Joule per Gram: Joule per Gram
    Gram per Cubic Centimeter: Gram per Cubic Centimeter
    Radian per Second: Radian per Second
    Joule per Gram-Kelvin: Joule per Gram-Kelvin
  id_2:
    sample: '?SampleCount'
    article: '?ArticleCount'
SPARQL: |
  PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
  PREFIX sio: <http://semanticscience.org/resource/>
  SELECT DISTINCT ?UnitOfMeasure ?AttributeType
    (COUNT(DISTINCT ?sample) AS ?SampleCount) 
    (COUNT(DISTINCT ?doi) AS ?ArticleCount) 
  WHERE {
    ?attr a ?AttributeType ;
          sio:hasValue ?AttributeValue ;
          sio:hasUnit [ rdfs:label ?UnitOfMeasure ] .
    ?doi sio:hasPart ?sample .
    ?sample sio:hasAttribute ?attr .
    VALUES ?UnitOfMeasure {
      "{{id_1}}"
    }
  } 
  GROUP BY ?UnitOfMeasure ?AttributeType
  ORDER BY DESC ({{id_2}})