SPARQL e RDF

To query Einaudi Foundation’s datasets and access LOD, two main technologies are used: SPARQL and RDF.

SPARQL

It is the standard query language that allows retrieving and manipulating data in RDF format. It enables querying and extracting information from multiple linked datasets.

RDF

Resource Description Framework is a specific standardized structure for describing resources and their relationships in a format that is readable for both humans and machines. This structure allows representing data according to the subject-predicate-object format.

How to write a query in SPARQL

Identifying your search needs and recognizing which information you want to extract or visualize are the first steps to start writing the query in SPARQL.

To write a correct SPARQL query, it is necessary to follow the subject-predicate-object structure:

  1. use the SELECT keyword to specify the variables you want to retrieve from the query

  2. use the WHERE clause to define the search criteria and conditions that must be met

  3. add additional clauses like:

    • FILTER to filter results based on specific conditions

    • UNION to combine multiple pattern models

    • ORDER BY to order results

    • GROUP BY to group results

  4. start searching

The elemental structure is:
SELECT ?subject?predicate?object
WHERE { ?subject ?predicate?object}

Picture

SPARQL Query Editor e RDF

Start searching: access SPARQL

FAQ

Below you can see some query examples

How to write a query?

To write a correct SPARQL query, it is necessary to follow the subject-predicate-object structure.
The basic structure is:

 

SELECT ?soggetto ?predicato ?oggetto
WHERE { ?soggetto ?predicato ?oggetto}

How to look for Luigi Einaudi’s photograph?

According to the basic structure, if you are looking for all the photos representing Luigi Einaudi, the query would be:

select distinct * where {
?document a <http://xmlns.com/foaf/0.1/Document>.
?document rdfs:label ?labelDocument.
?document <http://purl.org/dc/elements/1.1/type> 'fotografia' .
?document <http://xmlns.com/foaf/0.1/depiction> ?urlFoto}

How to search for writings about Luigi Einaudi?

According to the basic structure, if you are looking for all the writings about Luigi Einaudi, the query would be:

select distinct * where
{?opera a <http://id.loc.gov/ontologies/bibframe/Instance>.
?opera rdfs:label ?titolo.
?opera <http://id.loc.gov/ontologies/bibframe/subject> 'Einaudi, Luigi'}

If you are looking for all the writings by Luigi Einaudi, the query would be:

select distinct * where
{?opera a <http://id.loc.gov/ontologies/bibframe/Instance>.
?opera rdfs:label ?titolo.
?opera <http://schema.org/author> ?autore.
FILTER (?autore = <https://dati.fondazioneeinaudi.it/lod/resource/agent/IT_ICCU_CFIV_026671>)}

How do you filter search results?

According to the basic structure, if you would like to filter search results to obtain videos about Luigi Einaudi. The query would be:

select distinct * where { ?document a <http://xmlns.com/foaf/0.1/Document>.
?document rdfs:label ?labelDocument.
?document <http://purl.org/dc/elements/1.1/type> 'video' .
?document <https://schema.org/url> ?urlVideo}

How do you get resources from a specific historical period?

According to the basic structure, if you would like to get resources from the period of the Presidency of the Republic, the query would be:

select distinct * where {
?document a <http://xmlns.com/foaf/0.1/Document>.
?document rdfs:label ?labelDocument.
?document <http://purl.org/dc/elements/1.1/date> ?date .
FILTER (regex(str(?labelDocument),'Presidente della Repubblica','i'))}

How to search for sources that have been used in the project?

If you would like to get the list of sources used in the project, the query would be:

select distinct * where {
?institute a <http://culturalis.org/cult/0.1#CulturalInstitutionOrSite>.
?institute rdfs:label ?labelInstitute.}

Address

Palazzo d'Azeglio

Via Principe Amedeo 34 - 10123 Torino

Tel. +39 011835656

Opening hours

Library

from Monday to Friday 9 a.m. - 5 p.m.

Book and serial checkout from storage facilities

9 a.m. - 12.30 p.m. and 2 p.m. - 4.45 p.m.

Historical archive

from Monday to Friday 9 a.m - 5 p.m.

by appointment only

Administration offices

from Monday to Friday

9 a.m. - 5 p.m.

Picture
Picture
Picture
Picture
Picture

© 2021 Fondazione Luigi Einaudi NPO - VAT number and Fiscal Code 01359310016