Some additional IOGDS Test Queries

NOTES:
  1. Paste into http://logd.tw.rpi.edu/sparql
  2. USE AT YOUR OWN RISK; Some optimization may be required

Catalogs and their countries (basic)

PREFIX dgtwc:      <http://data-gov.tw.rpi.edu/2009/data-gov-twc.rdf#>
PREFIX conversion: <http://purl.org/twc/vocab/conversion/>
 
SELECT DISTINCT ?catalog ?country
WHERE {
  GRAPH <http://purl.org/twc/vocab/conversion/MetaDataset> {
    ?catalog a conversion:DatasetCatalog;
       dgtwc:catalog_country ?country .
  }
}
ORDER BY DESC(?country)
See for example that one of them is...
<http://logd.tw.rpi.edu/source/texas-gov/dataset/catalog/version/2012-Feb-21/conversion/enhancement/1>

Catalogs, titles and countries

PREFIX dgtwc:      <http://data-gov.tw.rpi.edu/2009/data-gov-twc.rdf#>
PREFIX conversion: <http://purl.org/twc/vocab/conversion/>
 
SELECT DISTINCT ?catalog ?title ?country
WHERE {
  GRAPH <http://purl.org/twc/vocab/conversion/MetaDataset> {
    ?catalog a conversion:DatasetCatalog;
       dgtwc:catalog_country ?country;
       dgtwc:catalog_title ?title.
  }
}
ORDER BY DESC(?country)
Again, note that one of them is...
<http://logd.tw.rpi.edu/source/texas-gov/dataset/catalog/version/2012-Feb-21/conversion/enhancement/1>

All the properties of a given catalog

PREFIX conversion: <http://purl.org/twc/vocab/conversion/>
 
SELECT ?p ?o
WHERE {
  GRAPH <http://purl.org/twc/vocab/conversion/MetaDataset> {
    <http://logd.tw.rpi.edu/source/texas-gov/dataset/catalog/version/2012-Feb-21/conversion/enhancement/1> ?p ?o.
  }
}

List the datasets associated with a given catalog

  • Uses isReferencedBy to refer to a specific catalog version (which you would get from a listing of catalogs)
PREFIX dcterms: <http://purl.org/dc/terms/>
PREFIX conversion: <http://purl.org/twc/vocab/conversion/>
PREFIX void: <http://rdfs.org/ns/void#>
PREFIX dgtwc: <http://data-gov.tw.rpi.edu/2009/data-gov-twc.rdf#>
 
SELECT  ?dataset ?title ?catalog
WHERE {
   {
       SELECT ?abstract (MAX(?m) AS ?modified)
       WHERE {
           GRAPH conversion:MetaDataset {
               ?abstract void:subset [ void:subset [ a
conversion:LayerDataset, conversion:MetaDataset ]; dcterms:modified ?m
]
           }
       }
       GROUP BY ?abstract
   }
   GRAPH conversion:MetaDataset {
       ?abstract void:subset ?versioned .
       ?versioned dcterms:modified ?modified .
       ?dataset a conversion:CatalogedDataset;
                void:inDataset ?versioned ;
                dcterms:title ?title;
                dgtwc:catalog_title ?catalog.
       <http://logd.tw.rpi.edu/source/texas-gov/dataset/catalog/version/2012-Feb-21/conversion/enhancement/1>
dgtwc:catalog_title ?catalog.
   }
}