» Publisher Help » Publisher Console

1. Specify a query to retrieve data

You will need:

  • an endpoint to query, with authentication details. If you followed this guide, you get that information at the end of step 3.
  • the query string itself.

Go to the Publisher Console. Create a new query by clicking on + Add next to "Queries".


This will open the "Add query" form.


Start by providing a Name and a Description for your query.

Select type of query you will create (field Query type). In this example we issue a SPARQL query (type: SPARQL (DataGraft)).

Parameters are type-dependent. Our example requires the query endpoint to be configured according to the following format:

{"endpoint": {
    "url": "https://rdf.datagraft.net/12345678/db/repositories/example-repo",
    "auth": {
        "api_key": "api1234key5678",
        "key_secret": "key1234secret5678"
    }
}}
Substitute "url", "api_key" and "key_secret" with appropriate values.

Use the Query field to input the query itself. It should have the following characteristics:

  • an attribute that describes the geographic features to display on the map (name this attribute the_geom)
  • other attributes you want to attach to said features

Example:

PREFIX prodm-cad: 
PREFIX prodm-com: 
PREFIX prodm-soe: 
PREFIX schema: 
PREFIX gsp: 
PREFIX sf: 
PREFIX cp: 
PREFIX dul: 
PREFIX dbo: 
PREFIX dcterms: 
PREFIX rdfs: 
PREFIX rdf: 
PREFIX au: 
PREFIX xsd: 
SELECT ?name ?code ?coords (?underStormRisk/?totalAmount*100 AS ?eis)
WHERE {
    SELECT DISTINCT ?name ?code ?totalAmount ?underStormRisk (?coords as ?the_geom)
    WHERE {
        ?au a au:AdministrativeUnit;
        au:nationalCode ?code;
        rdfs:label ?name ;
        prodm-com:hasBuildingsWithStormRisk ?underStormRisk ;
        prodm-com:hasBuildingsTotal ?totalAmount ;
        gsp:hasGeometry [ gsp:asWKT ?coords ;].
    }
}


In the "Field Metadata" Section, add metadata for the fields of the query result. In particular, the Type is necessary to map values to simple types (Integer, Number, String, Boolean or Geometry). In any case, it will be a lot easier for potential users to get interested in your data if you describe it properly.


Press Save. You will see your new query in the list of queries. Click on Publisher console to go back.

2. Specify a layer that will display data from your query

Create a new layer by clicking on + Add next to "Layers".

This will open the "Add layer" form.


Select the Query you created in Step 1.

Provide a Label and optionally a Description for your layer.

Select which fields from the query results you will use. Provide this information as JSON list in Field parameters.

Example:

["name", "code", "eif", "eis"]


Define filter widgets for this layer in the "Filters" Section.


Specify a Field for the filter to operate on (must be one of the list in Field parameters) and its Filter Type.

What you put in Parameters is filter type dependent.

For Discrete filters, parameters must follow this format:

{
  "title": <a title for the filter>,
  "description": <a short description>,
  "range": [
    {
      "value": <minimum value>,
      "color": <color for minimum value>,
      "label": <a label to show instead of the minimum value>
    },
    {
      "value": <maximum value>,
      "color": <color for maximum value>,
      "label": <a label to show instead of the maximum value>
    }
  ]
}

For Category filters, parameters must follow this format:

{
  "title": <a title for the filter>,
  "description": <a short description>,
  "categories": [
    {
      "value": <category 0 value>,
      "color": <color for category 0>,
      "label": <a label to show instead of the value for category 0>
    },
    {
      "value": <category 1 value>,
      "color": <color for category 1>,
      "label": <a label to show instead of the value for category 1>
    },
    ...
    {
      "value": <category n value>,
      "color": <color for category n>,
      "label": <a label to show instead of the value for category n>
    }
  ]
}


Select fields to display for the geographical features in the "Infobox Fields" Section. Specify fields and labels that will be shown when hovering on top of features in the map layer.


Press Save to create the new layer and then click on Publisher console to go back.

3. Define a new visualization set

In this step you will include the newly created layer(s) in one or more visualizations. Each visualization specifies what is going to be rendered, under which license and what is required from the user to access the visualisation. You can offer variations of your visualization under different licenses and access options (e.g.: free and paid tier). These visualizations are grouped under a visualization set.

Create a new visualization set by clicking on + Add next to "Visualization sets". This will open the "Add visualization set" form.


Start by providing a Title and descriptions for your set. The (short) Description will be seen when your visualization set is listed among other sets. The Long description version will be seen when a user clicks on your visualisation set to get more details. For the later, take the opportunity to tell interested users what your data is about and show its value through concrete examples (e.g., how they can use the visualization to answer specific questions).

Upload an appropriate image for the visualization set (like title and short description, it will be shown when your visualization set is listed among other sets).


Create a new visualization. Go to the "Visualizations" Section, give your visualization a Title, and choose the layer you created in the previous step (move it from Available layers to Chosen layers).


Give your new visualization a License. Choose among the available ones or contact us if you need a different one.

Next you need to specify how your visualization will be priced.

Select the tier Level. Once a user gets access (e.g., by purchasing) to a visualization of level n, they can no longer purchase visualizations of lower levels.

Afterwards, choose a Pricing model.

Pricing model parameters for the "Gratis" option must follow this format:

{
  "color": <one of "default", "blue", "green", "yellow", "red">,
  "properties": <a JSON list of strings citing interesting properties of the visualization>
}

If the choice is "One-time payment" the format is the following:

{
  "color": <one of "default", "blue", "green", "yellow", "red">,
  "properties": <a JSON list of strings citing interesting properties of the visualization>,
  "trial": {
    "quantity": <the duration of the trial period, in units specified in the next key>,
    "unit": <one of "month", "day", "year">
  },
  "pricing": {
    "unit": <same as the trial unit>,
    "amount": <a number representing the price of the offering>,,
    "currency": <one of "EUR", "USD">
  }
}


Specify extra options in the Parameters field. Currently supported are center and zoom parameters, in the following format:

{
  "map_config": {
    "zoom": <a number from 0 to 18 to specify initial zoom>,
    "center": {"lat": <latitude as a float>, "lon": <longitude as a float>}
  }
}


Press Save to create the new visualization set.

Your part is done!

Contact us and we will run your query, configure some extra details (e.g., a paypal account to receive money from the selling of your data) and then publish your visualization.