Webservices

[version française]

Webservices REST

Opentheso from 4.4.2 version (Miled Rousset)

To download the last version of the API REST documentation, go to GitHub.

PS : https://pactols.frantiq.fr/opentheso/  is the example about PACTOLS thesaurus of Frantiq.

Opentheso now integrates OpenAPI to consult thesauri. Here is a link to test and see how it works : https://pactols.frantiq.fr/opentheso/openapi/doc/

Searching by identifier (ARK) with format precision

https://pactols.frantiq.fr/opentheso/api/26678/pcrtkOgxvd4Ijy.rdf
https://pactols.frantiq.fr/opentheso/api/26678/pcrtkOgxvd4Ijy.json
https://pactols.frantiq.fr/opentheso/api/26678/pcrtkOgxvd4Ijy.jsonld
https://pactols.frantiq.fr/opentheso/api/26678/pcrtkOgxvd4Ijy.ttl

Searching by identifier (Handle) with format precision

https://pactols.frantiq.fr/opentheso/api/20.500.11859/26678.pcrtkOgxvd4Ijy.rdf
https://pactols.frantiq.fr/opentheso/api/20.500.11859/26678.pcrtkOgxvd4Ijy.json
https://pactols.frantiq.fr/opentheso/api/20.500.11859/26678.pcrtkOgxvd4Ijy.jsonld
https://pactols.frantiq.fr/opentheso/api/20.500.11859/26678.pcrtkOgxvd4Ijy.ttl

Searching by concept identifier with format precision

https://pactols.frantiq.fr/opentheso/api/TH_1.13175.rdf
uri REST = https://pactols.frantiq.fr/opentheso/api/
thesaurus id = TH_1
concept id =  13175
format = rdf
valid formats : (.rdf), (.json), (.jsonld), (.ttl).

Search with Curl by choosing the header

curl -L –header “Accept: application/rdf+xml” https://pactols.frantiq.fr/opentheso/api/26678/pcrtkOgxvd4Ijy
curl -L –header “Accept: application/json” https://pactols.frantiq.fr/opentheso/api/26678/pcrtkOgxvd4Ijy
curl -L –header “Accept: application/ld+json” https://pactols.frantiq.fr/opentheso/api/26678/pcrtkOgxvd4Ijy
curl -L –header “Accept: text/turtle” https://pactols.frantiq.fr/opentheso/api/26678/pcrtkOgxvd4Ijy
(also for the research by the identifier of the concept).

Recovery of prefLabel value from identifier ARK

https://pactols.frantiq.fr/opentheso/api/preflabel.fr/20.500.11859/26678.pcrtkOgxvd4Ijy.json

preflabel.fr (.fr) describe the language to recover.

Searching by value

curl -L –header “Accept: application/rdf+xml”
https://pactols.frantiq.fr/opentheso/api/search?q=amphore&lang=fr&theso=TH_1

All this controls are possible for the header:
curl -L –header “Accept: application/rdf+xml »
curl -L –header “Accept: text/turtle »
curl -L –header “Accept: application/json »
curl -L –header “Accept: application/ld+json »
curl -L –header “Accept: application/json”
https://pactols.frantiq.fr/opentheso/api/search?q=amphore&lang=fr&theso=TH_1
curl -L –header “Accept: application/ld+json”
https://pactols.frantiq.fr/opentheso/api/search?q=archi&lang=fr&theso=TH_1
curl -L –header “Accept: text/turtle”  https://pactols.frantiq.fr/opentheso/api/search?q=archi&lang=fr&theso=TH_1

Searching by notation

https://pactols.frantiq.fr/opentheso/api/search?q=notation:Guita1&theso=TH_1

We can also get the data into a specifiv format by specifying

curl   https://pactols.frantiq.fr/opentheso/api/search?q=archi&lang=fr&theso=TH_1&format=jsonld
curl   https://pactols.frantiq.fr/opentheso/api/search?q=archi&lang=fr&theso=TH_1&format=json
curl  https://pactols.frantiq.fr/opentheso/api/search?q=archi&lang=fr&theso=TH_1&format=turtle
curl   https://pactols.frantiq.fr/opentheso/api/search?q=archi&lang=fr&theso=TH_1&format=rdf

We can also specify the language with &lang=fr or don’t choose a language.

We can also obtain datas into a specific format by specifying:
curl   https://pactols.frantiq.fr/opentheso/api/search?q=archi&lang=fr&theso=TH_1&format=jsonld
curl   https://pactols.frantiq.fr/opentheso/api/search?q=archi&lang=fr&theso=TH_1&format=json
curl  https://pactols.frantiq.fr/opentheso/api/search?q=archi&lang=fr&theso=TH_1&format=turtle
curl   https://pactols.frantiq.fr/opentheso/api/search?q=archi&lang=fr&theso=TH_1&format=rdf
curl   https://pactols.frantiq.fr/opentheso/api/search?q=archi&theso=TH_1&format=rdf

We can also filter by domain/group/microthesaurus: &group=6
curl  https://pactols.frantiq.fr/opentheso/api/search?q=archi&theso=TH_1&lang=fr&group=6&format=rdf

Autocomplete

‘Autocomplte’ allows to return data in the format (id, value) in json. This makes it easier to retrieve the data for remote indexing scripts.

Query with language precision

https://pactols.frantiq.fr/opentheso/api/autocomplete/arts?lang=fr&theso=TH_1

result =

0 
uri“https://ark.mom.fr/Arkeo/26678/pcrtkOgxvd4Ijy”
label“arts décoratifs”
1 
uri“https://ark.mom.fr/Arkeo/26678/pcrtGKMelLKwRd”
label“arts mineurs”
2 
uri“https://ark.mom.fr/Arkeo/26678/pcrt6YAjOsQDeM”
label“arts textiles”
3 
urihttps://ark.mom.fr/Arkeo/26678/pcrttq9gp2ZMuc”
label“Arts”
4 
uri“https://ark.mom.fr/Arkeo/26678/pcrtcSQ6O32f6k”
label“Artsakh”

 

Query including all the languages

https://pactols.frantiq.fr/opentheso/api/autocomplete/arts?theso=TH_1

result =

0 
uri“https://ark.mom.fr/Arkeo/26678/pcrtkOgxvd4Ijy”
label“arts décoratifs”
1 
uri“https://ark.mom.fr/Arkeo/26678/pcrtGKMelLKwRd”
label“arts mineurs”
2 
uri“https://ark.mom.fr/Arkeo/26678/pcrt6YAjOsQDeM”
label“arts textiles”
3 
uri“https://ark.mom.fr/Arkeo/26678/pcrtkOgxvd4Ijy”
label“decorative arts”
4 
uri“https://ark.mom.fr/Arkeo/26678/pcrtGKMelLKwRd”
label“minor arts”
5 
uri“https://ark.mom.fr/Arkeo/26678/pcrt6YAjOsQDeM”
label“textile arts”
6 
uri“https://ark.mom.fr/Arkeo/26678/pcrttq9gp2ZMuc”
label“Arts”
7 
uri“https://ark.mom.fr/Arkeo/26678/pcrtcSQ6O32f6k”
label“Artsakh”

Query by specifying all the languages plus the domain or microthesaurus or group

https://pactols.frantiq.fr/opentheso/api/autocomplete/arts?theso=TH_1&group=6

The result is obtained by filtering concepts that belong to the domain which is given as a parameter.

Searching by group or domain or microthesaurus

We can search a group by specifying its ark identifier:
https://pactols.frantiq.fr/opentheso/api/group/26678/pcrtnbDLi2FkAj

All those controls are possible for the header:
curl -L –header “Accept: application/rdf+xml »
curl -L –header “Accept: text/turtle »
curl -L –header “Accept: application/json »
curl -L –header “Accept: application/ld+json »

We can search by group by specifying its internal identifier:
https://pactols.frantiq.fr/opentheso/api/group/?id=5&theso=TH_1

Informations

Advanced functions

How to find a complete branch by ‘autopostage’ from the concept to the top terme (root): https://pactols.frantiq.fr/opentheso/api/expansion/concept?theso=TH_1&id=300&way=top

How to find a complete branch by ‘autopostage’ from the concept to the last specific term (downward):

https://pactols.frantiq.fr/opentheso/api/expansion/concept?theso=TH_1&id=300&way=down 

Query to recover a complete branch from a particular group:

Ex : to recover the complete branch from group « 2 » of « TH_1 » thesaurus
https://pactols.frantiq.fr/opentheso/api/all/group?id=2&theso=TH_1

By specifying data format:
https://pactols.frantiq.fr/opentheso/api/all/group?id=2&theso=TH_1&format=rdf
https://pactols.frantiq.fr/opentheso/api/all/group?id=2&theso=TH_1&format=json
https://pactols.frantiq.fr/opentheso/api/all/group?id=2&theso=TH_1&format=turtle
https://pactols.frantiq.fr/opentheso/api/all/group?id=2&theso=TH_1&format=jsonld

Informations

The Webservice sends information related to the hierarchy of the concept in the thesaurus. If the concept retrieved is poly-hierarchical (foud in several branches), the information is then duplicated, example for the concept ‘14990’ of the PACTOLS thesaurus:
https://pactols.frantiq.fr/opentheso/api/TH_1.14990.rdf
TH_1
= thesaurus identifier
14990 = concept identifier

Result:

<rdf:RDF>
<rdf:Description rdf:about=”https://ark.frantiq.fr/ark:/26678/pcrtbptj4SOA1W”>
<rdf:type rdf:resource=”http://www.w3.org/2004/02/skos/core#Concept”/>
<skos:prefLabel xml:lang=”it”>abitato</skos:prefLabel>
<skos:prefLabel xml:lang=”fr”>habitat</skos:prefLabel>
<skos:prefLabel xml:lang=”es”>hábitat</skos:prefLabel>
<skos:prefLabel xml:lang=”en”>settlement</skos:prefLabel>
<skos:prefLabel xml:lang=”de”>Siedlungswesen</skos:prefLabel>
<skos:prefLabel xml:lang=”nl”>woonplaats</skos:prefLabel>
<skos:prefLabel xml:lang=”ar”>سكن</skos:prefLabel>
<skos:altLabel xml:lang=”fr”>bâtiment domestique</skos:altLabel>
<skos:altLabel xml:lang=”it”>insediamento</skos:altLabel>
<skos:altLabel xml:lang=”fr”>structure d’habitat</skos:altLabel>
<skos:related rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtD2Eo6Sz7IY”/>
<skos:related rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtUu5zfknZ1x”/>
<skos:related rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrt9PJh9aTXv4″/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtsrlRWaly2K”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtqsNPWjGG9u”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtRFSvuXH6BD”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtERsRub9G3c”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtMVyOncjILc”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrthXosl9QxQ2″/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtSxe2PZMWR8″/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrterZpcqUSuG”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrt2f8QaSD6TS”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtaGBUR5Ekx1″/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtcnLd0ZlR3X”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtHe4IcZbXxI”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtQ9Tq9TeP3P”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtISZAuzsISK”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtT7xkUlGGbB”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtn0kjwckvyL”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtLEIWWX4Z3O”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/crtukWSYV7gtL”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtSmefwuwa97″/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrt5uHlswsQmN”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtVnWeKqGpcj”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtKfL11q1qOk”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrta8oqpcTSuo”/>
<skos:narrower rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtlEYVJzjAU6″/>
<skos:broader rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtWegewfItfX”/>
<skos:broader rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtDlzbGxWvTo”/>
<skos:inScheme rdf:resource=”https://pactols.frantiq.fr/opentheso/TH_1″/>
<opentheso:memberOf rdf:resource=”https://ark.frantiq.fr/ark:/26678/pcrtnbDLi2FkAj”/>
<dcterms:created rdf:datatype=”http://www.w3.org/2001/XMLSchema#date”>2007-02-08</dcterms:created>
<dcterms:modified rdf:datatype=”http://www.w3.org/2001/XMLSchema#date”>2014-06-25</dcterms:modified><dcterms:identifier>14990</dcterms:identifier><dcterms:description>13289##13290##13296##14990</dcterms:description><dcterms:description>13289##17634##14990</dcterms:description><skos:definition xml:lang=”fr”>Lieu d’habitation construit.</skos:definition></rdf:Description>
</rdf:RDF>



Citer ce billet
Alyssa Turgis (2022, 12 avril). Webservices. Opentheso. Consulté le 20 juin 2024, à l’adresse https://doi.org/10.58079/sjk4

Vous aimerez aussi...

Laisser un commentaire

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Ce site utilise Akismet pour réduire les indésirables. En savoir plus sur comment les données de vos commentaires sont utilisées.

Rechercher dans OpenEdition Search

Vous allez être redirigé vers OpenEdition Search