View on GitHub

artsdata-data-model

Overview of how data is modelled in Artsdata.ca.

Artsdata Guidelines about the @id property and URIs

The Schema.org documentation does not, unfortunately, say much about the "@id" property, nor how to generate URIs for them. In order to make up for these shortfalls, Artsdata prepared the following guidelines. These guidelines are intended primarily for web developers.

In these guidelines, the word “Thing” is borrowed from the Schema terminology to designate any real-world object, such as a specific event, place or person. It is synonymous with the term “entity” (commonly used in Artsdata documentation), in the sense of an object with an identity.

General documentation for the @id property

   
Data type xsd:anyURI
Instructions The value should be a URI constituting a unique persistent identifier for the Thing (for example, an Event or Place entity) within the website domain.
Note Do not populate the same URI under both @id and url.
A webpage URL is the unique persistent identifier for that webpage, and nothing else. It should not be used to identify any of the things described on that webpage. In Schema structured data (and in any other RDF-based ontologies), a “real-world object” (such as an Event or Place entity) and the web document describing it are two distinct things: they each deserve their own URI.

Scroll down to learn how to generate functional URIs.

Benefits of using @id to assign URIs to Things

How to generate a functional URI

For the purpose of identifying a Thing, a URI is functional if it uniquely identifies a single real-world object AND if this real-world object is assigned a single URI within the web domain. In other words, the cardinality must be one-to-one. While it is preferable that the URI resolves to some representation (HTML, JSON-LD or other) of the Thing, Artsdata can use any type of functional URI to refer to external Things, even if these URIs lead to “404 Not Found” responses.

Webpage-based HashURIs

Note: This method may not be suitable for websites with language negotiation or with dynamic content.

Examples of webpage-based HashURIs

Here are a few examples of improper and proper uses of URIs derived from webpage URLs:

Example Suitability as URI

"@id": "https://someorg.ca/events/eventname/"
(Where the value is the same as the page URL, without a fragment identifier)
Critical Error
The "@id" and "url" values should not be the same.

"@id": "https://someorg.ca/events/eventname/#event"

(Where the same fragment identifier is used for all entities of the same type.)
Good
Note: This naming convention won’t work if more than one event is listed on the same page, because multiple events would be assigned the same URI.

"@id": "https://someorg.ca/events/eventname/#123abc"

(Where the fragment identifier 123abc follows a naming convention that guarantees uniqueness within the webpage.)

Better!

"@id": "https://someorg.ca/events/eventname/#key"

(Where key is the primary key identifying the event entity in your local database.)

Even better!

Basing the fragment identifier on the Thing’s primary key in your database is a simple and efficient means of ensuring that the fragment identifier is unique within the site’s domain.

If you can’t base your fragment identifier on database keys, we recommend using a naming convention that will ensure the uniqueness of the fragments identifier today and in the future. For example, you could base your fragment identifier on the startDate string and the location.name string, as in this naming convention: YYMMDDHH-SOMEPLACE.

Other strategies to generate URIs

HashURIs based on existing webpage URLs, as described above, are only one of many ways of generating functional URIs to identify the things described on your website. Here are other strategies for generating flexible, stable and persistent URIs:

External resources on URIs

If you are unable to generate your own URIs…

Don’t worry. Artsdata can handle data without URIs.

As an alternative (or in complement to "@id"), consider using the "sameAs" property to assign an external persistent identifier to your Place, Person and Organization entities. This is a simple and highly effective way to identify a Thing, and to provide a link to more data about it.

Read more