Let us make data management easier with the help of linked data and the DATEX format.


Do you not know what this means?

Do not worry, we will explain this to you by giving an example!

Read more

Hi! I’m Anna. My friend John and I just arrived in Ghent and we are in quite a hurry to find a parking spot!

next

On my phone, I can install apps which show me information about parking sites in for instance Brussels and Ghent

But the parking app for Ghent does not work on my phone

next
john

John has apps for all the cities he frequently visits but they clutter his phone

next

Would it not be great if developers could include more data in their apps without too much effort for their specific use case?

next

There's an easy solution!

Linked data is a way to easily structure all the data that is being published.

When all the data is published as linked data, a developer can gather and combine it!

next

This will result in apps for each device that can give a complete overview of the parkings in different cities !

Now John and I can find the parking spot way quicker and enjoy Ghent longer!

Let us dive into two preferred ways to publish data

JSON-LD RDFa

JSON to JSON-LD

To add machine-readable data with JSON-LD to a webpage, the first step is defining what data to send. We will now create a JSON file that can be embedded in a page.

To be able to read the definitions of all the terms it is necessary to provide context. Providing context in JSON-LD is done with the @context-tag, in which prefixes or vocabularies are defined. We will use a dtx prefix for the DATEX vocabulary.

The next part is defining the type of the data. In our case we will set a parking site. Following our vocabulary this is defined as dtx:ParkingSite.

Following that step it is possible to provide all of the data. By browsing through the vocabulary it is possible to find relevant terms. Let us try this by dragging the correct terms on this JSON:

Finally you should put the data in a script-tag with type application/ld+json.

Drag the values to their places

{
  
  
  
  "name": "Parking Schoondracht",
  "addresss": "Cataloniëstraat 4",
  "city": "9000 Ghent",
  "longitude": "51.053865",
  "latitude": "3.722578",
  "tel": "0032497466234",
  "descr": "P16 Gent: Schoondracht",
  "occupied": 150,
  "capacity": 450
}

see your progress here

Implementing RDFa into HTML

The first step in adding rdfa to your existing html page is by defining the correct prefix(es).

In our case we are adding one prefix for DATEX, you do this by inserting a prefix attribute into the html tag. <html prefix="dtx:vocab.datex.org/terms#">

The next step is defining a resource (a URI which contains the relevant data that specifies the parking site). Our data is contained on the same page and thus we will use a relative link. <article resource="#parking">

Our data is a parking site, in DATEX this is called a ParkingSite. To signify this we will add <article resource="#parking" typeof="dtx:ParkingSite">.

Data is more then a resource alone, it contains several properties. These specify the exact data that #parking has.

To find what properties are possible we will look at our vocabulary and add the properties like this for example <p property="dtx:parkingName">Pj's awesome parking!</p>

To make things easier for you we have searched for the correct properties in this case

  • dtx:parkingName
  • dtx:parkingSiteAddress
  • dtx:parkingLocation
  • dtx:contactDetailsTelephoneNumber
  • dtx:parkingDescription
  • dtx:parkingSpaceOccupied
  • dtx:totalCapacity

You can try this out here:

fill in the attributes explained in the above section

RDFa play