Skip to content

OP-TED/ted-open-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

122 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TED Open Data Service1

A web-based tool for exploring TED Open Data — the public procurement data published by the Publications Office of the EU as Linked Open Data. The app combines two complementary workflows over the same RDF backend:

  • Look up an individual notice by its publication number and inspect its full RDF graph as a navigable tree, raw Turtle, or backlinks view. Procedure timeline, breadcrumb navigation, drill-into-resource, and shareable URLs included.
  • Write SPARQL queries against the entire dataset using a CodeMirror 6 editor with ePO-aware autocomplete and syntax linting. SELECT and ASK results render as a table; CONSTRUCT and DESCRIBE results render as the same RDF graph view used by notice lookup.

The two workflows share a single Reuse tab that auto-picks the right rendering based on the query type (tabular for SELECT/ASK, graph for CONSTRUCT/DESCRIBE).

Features

  • Notice browser: type a publication number → navigate the resulting RDF graph
  • Procedure timeline: see all sibling notices in the same procurement procedure with one click
  • SPARQL editor with ePO autocomplete, syntax linting, and a curated query library
  • Auto-routing by query type: SELECT/ASK → tabular results, CONSTRUCT/DESCRIBE → tree/turtle/backlinks
  • Shareable URLs for any notice or sub-resource view (?facet=…)
  • Multiple result formats for SELECT (JSON, HTML, XML, CSV, TSV, Spreadsheet) and graph downloads (Turtle, RDF/XML, N-Triples)
  • Reusable query URLs for embedding into Excel, Power BI, etc.

Live Version

Visit TED Open Data to use the live version of the application.

Development Setup

Prerequisites

  • Node.js (v18 or higher)
  • npm (v8 or higher)

Installation & Running

  1. Clone the repository:

    git clone https://github.com/OP-TED/ted-open-data.git
    cd ted-open-data
  2. Install dependencies:

    npm install
  3. Start the CORS proxy:

    npm start
    # or directly:
    node src/js/cors-proxy.cjs
  4. Open the application:

    • Simply open the index.html file in your browser
    • The application will use the CORS proxy running on http://localhost:8080 for all SPARQL queries

Local Development Setup

The application consists of:

  1. A static web interface (index.html and associated files)
  2. A CORS proxy server for handling SPARQL queries

To run the application locally:

  1. Start the CORS proxy using npm start
  2. Open index.html in your web browser
  3. That's it! No additional web server is needed

Updating CodeMirror

The editors use a self-hosted CodeMirror v6 bundle (src/vendor/codemirror-bundle.js) to avoid CDN version drift issues. The bundle exports the SPARQL language (used by the Query Editor) and the Turtle language (used by the notice browser's Turtle view). This bundle only needs to be rebuilt when updating CodeMirror versions:

  1. Update the versions in package.json under devDependencies
  2. Run npm install
  3. Run npm run build:codemirror
  4. Commit the updated bundle

Simulating Server Errors

The CORS proxy supports a SIMULATE environment variable that forces every /proxy and /sparql request to return a canned failure. This is useful for evaluating the friendly error states in the app without needing to craft a broken query or wait for an endpoint outage.

# Virtuoso-shaped 400 parser error
SIMULATE=400 npm start

# Virtuoso-shaped 500 internal error
SIMULATE=500 npm start

# 504 Gateway Timeout
SIMULATE=504 npm start

# Network failure (connection reset)
SIMULATE=network npm start

Any other value is ignored and the proxy behaves normally. The active simulation mode is logged at startup.

Corporate Proxy Configuration

If you're behind a corporate proxy:

  1. Set the proxy environment variables before starting the CORS proxy:

    # Windows
    set HTTP_PROXY=http://username:password@your.proxy.host:port
    set HTTPS_PROXY=http://username:password@your.proxy.host:port
    
    # Linux/Mac
    export HTTP_PROXY=http://username:password@your.proxy.host:port
    export HTTPS_PROXY=http://username:password@your.proxy.host:port
  2. Or add them to your system environment variables permanently

Environment Configuration

The application supports two environments:

  • Production: Uses the live Cellar endpoint (production server)
  • Test: Uses the Cellar endpoint dedicated for testing. Caution: The test endpoint only contains sample data.

The endpoints are configured in config.json

Third-Party Components

This project uses the following third-party components:

Application

Development Tools

All third-party components are used under their respective licenses.

Footnotes

  1. Copyright 2024 European Union
    Licensed under the EUPL, Version 1.2 or – as soon they will be approved by the European Commission – subsequent versions of the EUPL (the "Licence"); You may not use this work except in compliance with the Licence. You may obtain a copy of the Licence here.
    Unless required by applicable law or agreed to in writing, software distributed under the Licence is distributed on an "AS IS" basis, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the Licence for the specific language governing permissions and limitations under the Licence.

About

The TED Open Data Service is a gateway for exploring, accessing and reusing EU public procurement data.

Resources

License

Stars

Watchers

Forks

Contributors