Sparqlxml2exhibitjson.xsl

From Data-gov Wiki

Jump to: navigation, search
Infobox (Technology) edit with form
  • name: Sparqlxml2exhibitjson.xsl


sparqlxml2exhibitjson.xsl will convert SPARQL XML Bindings to the JSON that Simile Exhibit requires for data input. It can be found at http://data-gov.tw.rpi.edu/ws/sparqlxml2exhibitjson.xsl.

Example

Input

When querying Dataset 326:

<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
  <head>
    <variable name="age_label"/>
    <variable name="sex_label"/>
    <variable name="race_label"/>
    <variable name="occupation_label"/>
    <variable name="state_label"/>
    <variable name="area_label"/>
    <variable name="laborforce_label"/>
  </head>
  <results>
    <result>
      <binding name="age_label">
        <literal>16+</literal>
      </binding>
      <binding name="occupation_label">
        <literal>adminstrative support, including clerical</literal>
      </binding>
      <binding name="state_label">
        <literal>Alabama</literal>
      </binding>
      <binding name="area_label">
        <literal>Statewide</literal>
      </binding>
      <binding name="laborforce_label">
        <literal>employed</literal>
      </binding>
    </result>
 </results>
</sparql>

Output

{ "items" : [
  {
    "age_label"        : "16+",


    "occupation_label" : "adminstrative support, including clerical",
    "state_label"      : "Alabama",
    "area_label"       : "Statewide",
    "laborforce_label" : "employed"
  },
]}
Facts about Sparqlxml2exhibitjson.xslRDF feed
Dcterms:modified2010-5-8
Foaf:homepagehttp://data-gov.tw.rpi.edu/ws/sparqlxml2exhibitjson.xsl  +
Foaf:nameSparqlxml2exhibitjson.xsl
Skos:altLabelSparqlxml2exhibitjson.xsl  +, sparqlxml2exhibitjson.xsl  +, and SPARQLXML2EXHIBITJSON.XSL  +
Personal tools
internal pages