Endpoint SPARQL

SPARQL (SPARQL Protocol and RDF Query Language) is a query language for data represented using the Resource Description Framework (RDF), which describes concepts and relationships about them through the introduction of triples (subject-predicate-object). SPARQL is one of the key elements of semantic Web technologies. It allows information to be extracted from distributed knowledge bases on the web through the construction of queries based on triples.

From this section you can access the SPARQL endpoint of the RESTORE project and build your own queries or consult the example queries made available by the OVI-CNR lab team.

Sample Queries

All objects of type "Painting"

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
SELECT DISTINCT ?Opere
WHERE {?soggetto
crm:P2_has_type
"Opera d'Arte" ;
rdfs:label ?Opere .
}

All documents referring to "Fazzi Antonio Francesco di Orazio"

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> 
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
SELECT DISTINCT ?uriDocumento ?Nome_Documento
WHERE {?soggetto ?proprietà ?oggetto .
?oggetto bif:contains "'Fazzi Antonio Francesco di Orazio'" .
?evento crm:P67_refers_to ?soggetto .
?uriDocumento crm:P92i_was_brought_into_existence_by ?evento;
rdfs:label ?Nome_Documento
}

Information about the letters from the Datini correspondence in the Prato State Archives

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>

SELECT DISTINCT ?Segnatura ?Mittente ?Destinatario ?Data_Invio ?Data_Ricezione ?Luogo_Invio ?Luogo_Ricezione ?Materiale ?Dimensioni ?Localizzazione
WHERE {
GRAPH < http://dev.restore.ovi.cnr.it:8890/aspo/datini>
{?soggetto crm:P25i_moved_by ?eventoMovimento .}
?invio rdfs:subClassOf ?eventoMovimento ;
rdf:type crm:EL2_Send_Letter .
?ricezione rdfs:subClassOf ?eventoMovimento ;
rdf:type crm:EL3_Receive_Letter .

OPTIONAL {?soggetto crm:P54_has_current_permanent_location ?uriLocalizzazione .
?uriLocalizzazione rdfs:label ?Localizzazione . }
OPTIONAL {?soggetto crm:P45_consist_of ?uriMateriale .
?uriMateriale rdfs:label ?Materiale . }
OPTIONAL {?soggetto crm:P43_has_dimension ?uriDimensioni .
?uriDimensioni rdfs:label ?Dimensioni . }
OPTIONAL {?soggetto crm:P1_is_identified_by ?uriId .
?uriId rdfs:label ?Segnatura . }

OPTIONAL {?invio crm:P4_has_time-span ?time_span_invio .
?time_span_invio rdfs:label ?Data_Invio }OPTIONAL {?ricezione crm:P4_has_time-span ?time_span_ricezione .
?time_span_ricezione rdfs:label ?Data_Ricezione }

OPTIONAL {?invio crm:P27_moved_from ?uriLuogoInvio .
?uriLuogoInvio rdfs:label ?Luogo_Invio }
OPTIONAL {?ricezione crm:P26_moved_to ?uriLuogoRicezione .
?uriLuogoRicezione rdfs:label ?Luogo_Ricezione }

OPTIONAL {?invio crm:P01_has_domain ?dominioInvio .
?dominioInvio crm:P02_has_range ?uriMittente .
?uriMittente rdfs:label ?Mittente }
OPTIONAL {?ricezione crm:P01_has_domain ?dominioRicezione .
?dominioRicezione crm:P02_has_range ?uriRicezione .
?uriRicezione rdfs:label ?Destinatario }
}
LIMIT 100

Information about people

PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>
PREFIX schema: <http://schema.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX person: <http://www.w3.org/ns/person#>

SELECT DISTINCT ?uri ?Id
(GROUP_CONCAT(DISTINCT ?name ;separator='\n') as ?Nome) ?Nome_Proprio ?Nome_di_Famiglia
(GROUP_CONCAT(DISTINCT ?otherName ;separator='\n') as ?Alias) ?Patronimico
(GROUP_CONCAT(DISTINCT ?relative ;separator='\n') as ?Parenti)
?Sesso ?Data_di_Nascita ?Luogo_di_Nascita ?Data_di_Morte ?Luogo_di_Morte
?Occupazione ?Luogo_Lavoro
(GROUP_CONCAT(DISTINCT ?qualification ;separator='\n') as ?Qualifica)
(GROUP_CONCAT(DISTINCT ?group ;separator='\n') as ?Gruppi) ?BiogHist
WHERE {
GRAPH ?graph {?uri rdfs:label ?label}
?uri foaf:name ?name .
OPTIONAL {?uri crm:P1_is_identified_by ?identificatore .
?identificatore rdfs:label ?Id }
OPTIONAL {?uri foaf:givenName ?Nome_Proprio}
OPTIONAL {?uri foaf:familyName ?Nome_di_Famiglia}
OPTIONAL {?uri schema:alternateName ?otherName }
OPTIONAL {?uri foaf:gender ?Sesso}
OPTIONAL {?uri person:patronymicName ?Patronimico }
OPTIONAL {?uri schema:hasOccupation ?uriOccupazione .
?uriOccupazione rdf:type schema:Occupation;
rdfs:label ?Occupazione }
OPTIONAL {?uri schema:workLocation ?Luogo_Lavoro }
OPTIONAL {?uri schema:honorificPrefix ?qualification}
OPTIONAL {?uri schema:relatedTo ?uriParente .
?uriParente rdfs:label ?relative}
OPTIONAL {?uri crm:P100i_died_in ?Morte .
?Morte crm:P4_has_time-span ?Morte_TS;
crm:P7_took_place_at ?Luogo_D .
?Morte_TS rdfs:label ?Data_di_Morte .
?Luogo_D rdfs:label ?Luogo_di_Morte }
OPTIONAL {?uri crm:P98i_was_born ?Nascita .
?Nascita crm:P4_has_time-span ?Nascita_TS;
crm:P7_took_place_at ?Luogo_B .
?Nascita_TS rdfs:label ?Data_di_Nascita .
?Luogo_B rdfs:label ?Luogo_di_Nascita }
OPTIONAL {?uri crm:P107i_is_current_or_former_member_of ?uriGroup .
?uriGroup rdfs:label ?group }
OPTIONAL {?uri schema:description ?BiogHist }
}
LIMIT 100