APIs

From organic_lingua
Jump to: navigation, search

Contents


APIs

MosesCore Services

MT service based on moses (and moses core models) are available at http://research.celi.it:8080/MosesServerProxy/
The service supports en-fr, fr-en, en-de, de-en, es-en, en-es language pairs.


MT Selector

The goal of MT Selector, the Machine Translation Selection service, is to provide an optimal translation of a text segment, by analysing the textual information, identifying certain characteristics and assigning the translation to a translation service better suited to these characteristics.

Get the optimum translation as defined by the classifier

1. In order to get the optimum translation as defined by the classifier you need to call the following web service:
http://62.217.125.219:8080/MT_Services_Server/restTranslate/services/getOptimalTranslation?&id=<user_id>&text=<text>&src=<from>&trg=<to>
where:
(a) <user_id> is an integer that corresponds to the user that requested the translation. This option is used for the personalization features. At this stage we can use just id = 1.
(b) <text> the original text to be translated. Please use the rules for valida URLs i.e. the spaces should be replaced by "+".
(c) <from> and <to> is the language of the original text and the target language subsequently. ISO-639-1 codes must be used ("en", "de", "it" etc).


Example:

http://62.217.125.219:8080/MT_Services_Server/restTranslate/services/getOptimalTranslation?&id=1&text=This%20is%20an%20organic%20tomato&src=en&trg=el

Response:

{"task_id": "135","engine": "bing","translation": "Αυτό είναι μια οργανική ντομάτα"}


Get the optimum MT service as defined by the classifier

2. In order to get the optimum MT service for your text segment as defined by the classifier you need to call the following web service:

http://62.217.125.219:8080/MT_Services_Server/restTranslate/services/classifyTask?&text=<text>&src=<from>&trg=<to>
where:

(a) <text> the original text to be translated. Please use the rules for valida URLs i.e. the spaces should be replaced by "+".
(c) <from> and <to> is the language of the original text and the target language subsequently. ISO-639-1 codes must be used ("en", "de", "it" etc).


Example:

http://62.217.125.219:8080/MT_Services_Server/restTranslate/services/classifyTask?&text=this%20is%20an%20organic%20tomato&src=en&trg=el


Response:

{"text": "this is an organic tomato","from": "en","to": "el","engine": "bing"}

Cross Language Information Retrieval Services

A demo of the CLIR services can be found here.


MT Caching Service

The MT caching service of the Organic.Lingua is available at http://research.celi.it:8080/MT_caching_service/.


Domain Terminology Checking Service

The Organic.Lingua Domain Terminology Checking provide a "shallow" domain adaptation service, decoupling it from the actual translation performed by a given MT engine.
“Shallow” Domain Adaptation in this context means that this component is not performing a general transformation/adaptation of the translated text, but rather it checks that the Domain Terminology (imported from Agrovoc) is correctly translated and present to the user the correct translations if not. This approach aims at providing a “trusted” translation for a textual fragment considered relevant to the domain regardless of the overall quality of the translation obtained by a MT system.


The service aims at being a generic tool (and a contribution to other similar projects or initiatives) and support a configuration based import of terminologies/ontologies to be used for the domain specific translation refinement.

The Domain Terminology is available at http://research.celi.it:8080/DomainTerminologyChecker/.


Automatic metadata extraction API


Extracting metadata

Service used by the UGC to extract the LOM metadata from a web- page. The service tries to extract the microdata, microformat and metadata out of the html. If it doesn't find them it uses the text rank algorithm combined with the ontology/agrovoc keyword extraction. This service is intended to produce best quality and scale combination.

Parameters
Parameter Type Description
extractDescription Operation main operational parameter
element Mandatory specify the URL from which to extract the meta-data
jsoncallback Optional specifies the JSON callback for JSONP call
Example
Request http://organiclingua.know-center.tugraz.at:8080/ol/Service?operation=extractDescription&element=http%3A%2F%2Fwww.oercommons.org%2Fcourses%2F11-368-environmental-justice-fall-2004&jsoncallback=test
Response

test(

{
"authors":[],
"title":"Environmental Justice, Fall 2004",
"keywords":["examines","environmental","environmental justice","environmental justice","environmental issues","practice of environmental"],
"description":"Examines theories and practice of environmental justice, concerns about race, poverty, and the environment in both domestic and international contexts, exploring and critically analyzing philosophies, frameworks, and strategies underlying environmental justice movements.Examines case studies of environmental injustices, including: distribution of environmental quality and health, unequal enforcement of regulations, unequal access to resources to respond to environmental problems, and the broader political economy of decision-making around environmental issues.",
"classification":"http://www.cc.uah.es/ie/ont/OE-OAAE#EnvironmentIssue",
"language":"en",
"license":"",
"url":"http://www.oercommons.org/courses/11-368-environmental-justice-fall- 2004"
}

);


Extract microdata, metadata, microformat

It downloads the html page and extracts from it the microdata, microformat and metadata. It can be used for crawling pages that have good metadata and decide not to use the text rank algorithm in the case where the text of the pages is not meaningful

Parameters
Parameter Type Description
extractMicroFormat Operation main operational parameter
element Mandatory specify the URL from which to extract micro-data
jsoncallback Optional specifies the JSON callback for JSONP call
Example
Request http://organiclingua.know-center.tugraz.at:8080/ol/Service?operation=extractMicroFormat&element=http%3A%2F%2Fwww.oerafrica.org%2FResourceResults%2Ftabid%2F1562%2Fmctl%2FDetails%2Fid%2F38298%2FDefault.aspx
Response

{

"authors":["\"Abidoye, Babatunde Lawrence, John D.\""],
"title":"OER Africa | Resource - A Limited Information Bayesian Forecasting Model of the Cattle SubSector",
"keywords":["africaoer","Bayesian","Cattle","agricultureoer","forecasting","Slaughte r","Inventory"],
"description":"<p>The first step towards forecasting the price and output of the cattle industry is understanding the dynamics of the livestock production process. This study follows up on the Weimar and Stillman (1990) paper by using data from 1970 to 2005 to estimate the parameters that characterizes the cattle output supply. The model is then used to estimate forecast values for the periods 2006 and 2007. Bayesian limited information likelihood method is used to estimate the parameters when endogeneity exists between these variables. The forecasting ability of the model for a two-step ahead forecast for majority of the variables are relatively good and test statistic of the forecast are reported.</p>",
"language":"en",
"license":"http://creativecommons.org/licenses/by/3.0/", "url":"http://www.oerafrica.org/ResourceResults/tabid/1562/mctl/Details/id/38298/Default.aspx"

}


Automatic keywords extraction API


Annotate with Agrovoc

Annotates the containing text of a web page with agrovoc thesaurus terms. It can be used from experts to extract all the mentioned agrovoc terms in the text. They can use that for example as an indicator about the topic of the resource.

Parameters
Parameter Type Description
annotateAgrovoc Operation main operational parameter
element Mandatory the url of the element to annotate
jsoncallback Optional specifies the JSON callback for JSONP call
Example
Request http://organiclingua.know-center.tugraz.at:8080/ol/Service?operation=annotateAgrovoc&element=http%3A%2F%2Fwww.oercommons.org%2Fcourses%2F11-368-environmental-justice-fall-2004&jsoncallback=test
Response

test(

{
"http://aims.fao.org/aos/agrovoc/xl_en_1299525119623":["economy"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299525773657":["strategies"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299511240282":["movement","movements"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299513035115":["sustainable development"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299519571414":["environmental policy"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299519427208":["regulations"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299486441896":["case"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299519315394":["environment"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299519219351":["application"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299525894812":["States"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299518787213":["domestic"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299519556910":["policy"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299525839272":["emerging"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299525909609":["health"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299513002677":["civil"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299517185767":["philosophies"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299519212025":["Explores","explores","exploring"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299523258111":["society"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299517517409":["distribution"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299526827520":["resources"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299518790729":["analysis"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299517588451":["planning"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299488247487":["quality"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299523343928":["United"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299523259689":["civil society"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299512620211":["political"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299523343111":["frameworks"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299509584217":["groups"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299523137317":["foundations"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299486246858":["case studies"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299526055910":["poverty"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299488458252":["sustainable"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299512998413":["development"],
"http://aims.fao.org/aos/agrovoc/xl_en_1299523278817":["planning"]
}

);


Annotate with Organic Edunet ontology

Annotates the containing text with ontology terms. It can be used from experts to extract all the mentioned terms of the ontology in the text. It can be used as an indicator of the topic of the resource, of the ontology concept that the resource can be classified and an indicator of missing ontology concept for phrases that are mentioned in the resource.

Parameters
Parameter Type Description
annotateOE Operation main operational parameter
element Mandatory the url of the element to annotate
jsoncallback Optional specifies the JSON callback for JSONP call
Example
Request http://organiclingua.know-center.tugraz.at:8080/ol/Service?operation=annotateOE&element=http%3A%2F%2Fwww.oercommons.org%2Fcourses%2F11-368-environmental-justice-fall-2004&jsoncallback=test
Response

test(

{
"http://www.cc.uah.es/ie/ont/OE-OAAE#Sustainability":["sustainable"],
"http://www.cc.uah.es/ie/ont/OE-OAAE#Issue":["issues"],
"http://www.cc.uah.es/ie/ont/OE-OAAE#EnvironmentIssue":["environmental issues"],
"http://www.cc.uah.es/ie/ont/OE-OAAE#Regulation":["regulations"],
"http://www.cc.uah.es/ie/ont/OE-OAAE#Policy":["policy"],
"http://www.cc.uah.es/ie/ont/OE-OAAE#Diversity":["diverse"]
}

);


Extract keyword from Organic.Edunet ontology

Extracts the content of the web page and tries to extract keywords using the Organic Edunet ontology. This service can be used to extract prominent keywords with the help of the ontology. The ontology provides better coverage of languages than the agrovoc thesaurus.

Parameters
Parameter Type Description
annotateOE Operation main operational parameter
element Mandatory the url of the page to extract the keywords
keywordsNumber the maximum number of keywords to extract
jsoncallback Optional specifies the JSON callback for JSONP call
Example
Request http://organiclingua.know-center.tugraz.at:8080/ol/Service?keywordsNumber=3&operation=extractKeywordsOE&element=http%3A%2F%2Fwww.oercommons.org%2Fcourses%2F11-368-environmental-justice-fall-2004&jsoncallback=test
Response

test(

{
"keywords":["environmental justice","environmental issues","practice of environmental"]
}

);



Analytics Service API

The core of the translation services offered by Organic.Edunet search engine relies on the Analytics Service API. Among other functions, this API is used for:

  • Translate words or phrases of the resources of the project. This includes translating search terms, titles, descriptions, etc., when needed. For example, if a resource title is not in the language of the current user, this API would get a request for an automated translation of the title. This kind of translation is explicitly specified to the user, so he can rate the translation.
  • Takes in charge of the “social” aspect of the search engine. This means that any rating or comments systems used must be requested to this API.
  • Creates and manage logs of the requests made to the translation services.

The Analytics Service is not in charge of translating the interface language of the applications that uses its services. This is due to the fact that this service is only in charge of translating the metadata of the resources, or related with the core functionalities of Organic.Edunet or the raw data it uses.


API architecture

The API is based on the following class diagram. There is also a new database for storing log info when needed, like search term, date, returned data for the search, etc. At this moment, it is just a MySQL table, but the diagram will be adapted to allow more log types, like to a file, NoSQL, etc.
AnalytisServiceAPI.png


Installation Instructions

  1. Download https://github.com/ieru/ieru-oe-apis (Analytic Service)
  2. Download https://github.com/ieru/ieru-rest-engine (Ieru Engine Service)
  3. Root folder create .htaccess with the code:

 <IfModule mod_rewrite.c>
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(?!api) index.php/$1 [L]
</IfModule>

  1. Root folder create api.php

 <?php
// Autoload files with the Symfony autoloader, according to PSR-0
// It can be downloaded from the Symfony Github project
// https://github.com/symfony/ClassLoader/blob/master/ClassLoader.php
// I have placed it in a vendor/Symfony/Component directory, relative to this file
require_once( 'vendor/Symfony/Component/ClassLoader.php' );
$loader = new \Symfony\Component\ClassLoader\ClassLoader();

// register classes with namespaces
$loader->addPrefix( 'Ieru\\', __DIR__.'/ieru' ); ///folder that include the folders that you have download
$loader->register();
$loader->setUseIncludePath(true);

// Start ieru restengine, with api URI identifier and API URI namespace
$api = new \Ieru\Restengine\Engine\Engine( 'api', 'Ieru\Ieruapis' );
$api->start();

  1. Download https://github.com/symfony/ClassLoader/blob/master/ClassLoader.php and put it in a folder “vendor/Symfony/Component/”
  2. Create a structure:
  • path_to_localhost/ieru/Ieru/Ieruapis
  • path_to_localhost/ieru/Ieru/Restengine
  • path_to_localhost/.htaccess
  • path_to_localhost/api.php
  • path_to_localhost/vendor/Symfony/Component/ClassLoader.php

Requirements

  1. Apache server*
  2. PHP (At least version 5.3)
  3. cURL library
  4. Php pages with encode UTF-8

*Very important in apache configs to add Multiviews!! In <Directory "/var/www/html"> add:

  • Options Indexes FollowSymLinks MultiViews (/etc/httpd/conf or /etc/apache2/sites-available/default) (Apache Module mod_negotiation)
  • or in .htaccess add

 Options +Indexes +FollowSymLinks +MultiViews
RewriteEngine On

  • NOTE If there is a PHP firewall like(php suhosin) maybe you need to change the max url length:

/etc/php5/apache/confd/suhosin.ini

suhosin.get.max_value_length = ??? (default value 512 characters)

Configuration Instructions

Translation Services

Analytics Module supports currently two Machine Translation services namely XEROX and MS translation service. XEROX MT can be used for the core languages i.e. English from/to Italian, Spanish, German and French. These MT services are adapted to the agricultural domain. MS translation services can be used for all the languages. To configure the MT services and which languages are supported by each service the developer should edit the following configuration file:

'Ieru\Ieruapis\Analytics\Config\Config.php'

  • get_translation_services - Returns the routes allowed in this API
    return array( 'microsoft', 'celi', 'xerox', 'google' );
  • get_default_translation_services - Languages for which we have to use an specific translation service by default
    return array( 'es'=>'xerox', 'fr'=>'xerox', 'de'=>'xerox', 'it'=>'xerox' );

Authentication Token

To enter the authentication token for the XEROX and MS service the developer should edit the proper file which contains the name of the corresponding service in the folder 'Ieru\Ieruapis\Analytics\Providers\Translation\'  as indicated below.

  1. XEROX:
    In the function request
    $post_data['username'] = 'xxxx';
    $post_data['password'] = 'xxxx';
    or if there is a lifelong Xerox token just change the variable "$token"
  2. MS service
    In the function request
    // Client ID of the application.
    $clientID = 'xxxx';
    // Client Secret key of the application.
    $clientSecret = 'xxxx';

API cheatsheat

Any user can request the following information to the API. They are usually made through POST for simplicity. If any of the API calls needs access to any user data, there should be an OAuth request to the Organic.Edunet API for getting the permission of the user for sharing her information with the third-party service. At this moment, as GRNet is integrated in Organic.Edunet and only usable through the web, there is no need to request for user authorization. We suppose that the user is agreeing to sharing his data with GRNet. In any case, the request for aditional information about a specific resource should be done without adding ‘/grnet/’ to the URL of the resource, just in case the service is migrated somewhere else.


Textual search

The textual search function searches for a term in the resources of Organic.Edunet.

General
Method Request URI
GET analyticsapi/search
Parameters
Parameter Description
text the text for which the user wants to see results
usertoken (optional) the authentication OAuth token of the user that identifies him
lang (optional) the source language of the search term
limit number of results to get from the request
offset for pagination purposes, the first result to retrieve
service (optional) the translation service the user wants to use
options available: celi
Example
Request GET analyticsapi/search?text=potato&offset=0&limit=2
Response

{

"success":true,
“message":"Resources found.",
"data":
{
"total_records":344,
"retrieved_records":2,
"resources":
[
{
"resource”:”http://oe.confolio.org/1867”
},
{
“resource”:”http://oe.confolio.org/1871”
}
],
"facets":
[
{
"facet": "educationalContext",
"filters":
[
{
"filter": "higher education",
"resources": 244
},
{
"filter": "professional development",
"resources": 134
}
]
},
{
"facet": "language",
"filters":
[
{
"filter": "English",
"resources": 302
},
{
"filter": "German",
"resources": 18
}
]
},
{
"facet": "technicalFormat",
"filters":
[
{
"filter": "application/pdf",
"resources": 153
},
{
"filter": "text/html",
"resources": 83
}
]
}
]
}

}


Translate a word or phrase

This function is used to transalte a word or phrase. If the user does not select one, the API will decide what translation service to use automatically based among other parameters, on the rating of the recent translations for a language.

General
Method Request URI
GET analyticsapi/translate
Parameters
Parameter Description
to the language to translate the term to
from (optional) the language to translate the term from. Translates from english by default
usertoken (optional) the authentication OAuth token of the user
use_dictionary (optional) if the user wants to use a specific service better suited for translating a few words (one to three, for example, as in a dictionary translation)
options: true/false.
entry (optional) resource URI for which a translation is being requested. This is needed for logging purposes, and being able to rate a translation afterwards
entry_zone (optional) if the entry parameter is set, this tells the system for which zone the translation is for
options: title / description / keywords
service (optional) the translation service the user wants to use
options available: celi / xerox / microsoft / google
Example
Request GET analyticsapi/translate?text=church&to=es&use_dictionary=true
Response

{

"success":true,
"message":"Translation done.",
"data":
{
"translation":"Iglesia"
}

}


Rate a translation

With the rate function the user can rate with a numeric value an automatic translation made by the Analytics API

General
Method Request URI
POST analyticsapi/resources/(:entry)/translations/(:id)/ratings
Parameters
Parameter Description
entry the URI of the resource
id the identifier of the translation as stored in the database
usertoken (optional) the oauth authentication token of the user rating
rating the numeric valoration of the resource
Example
Request POST analyticsapi/resources/http___example_resource_html/ translations/1234/ratings

with POST parameters

rating=5
usertoken=56171b031295a2ee0ace8cf6b066aeacbe60f6a49c622910f03dcccca5edabcf<code>

Response <code>

{

"success":true,
"message":"Rating added to the resource.",

}


Get languages

With this function the API will provide the list of supported languages for translation from english. These languages can be used as parameters in the API

General
Method Request URI
GET analyticsapi/translate/languages
Parameters
Parameter Description
none
Example
Request GET analyticsapi/translate/languages
Response

{

"success":true,
"message":"Available translation languages retrieved.",
"data":
{
"languages":
[
{
“language”:”es”,
},
{
“language”:”el”,
},
]
}

}


Get providers

This function is used to get the list of the name of language services providers that are used by the Analytics Services module.

General
Method Request URI
GET analyticsapi/translate/providers
Parameters
Parameter Description
from (optional) the language to translate the text from
to (optional) the language to translate the text to
Example 1: get all available providers
Request GET analyticsapi/translate/providers
Response

{

"success":true,
"message":"Providers of translation services retrieved.",
"data":
{
"providers":
[
{
“provider”:”Microsoft Translator”,
"name”:”microsoft”
},
{
“provider”:”Xerox Services”,
“name”:”xerox”
},
...
]
}

}

Example 2: get the available providers for translating from english to spanish
Request GET analyticsapi/translate/providers?from=en&to=es
Response

{

"success":true,
"message":"Providers of translation services retrieved.",
"data":
{
"providers":
[
{
“provider”:”Microsoft Translator”,
“name”:”microsoft”
}
]
}

}

Example 3: resource that will throw an error
Request GET analyticsapi/translate/providers?from=en
Response

{

"success":false,
"message":"You have to specify the source language and the target language."

}

Ontology Service API

The scope of the Ontology Service API is to expose the ontology deployed on the Organic.Lingua platform to all others components in order to maintain the entire architecture synchronized with the same version of the ontology. The service exposes the ontology in two different interfaces:

  • Linked Open Data (LOD): this interface provides data in SKOS format built in agreement with the syntax provided by the AGROVOC SKOS format in order to maintain the compliance with the other main organic agriculture repositories
  • RESTful RDF: this interface exposes data in OWL2 or LOD format, depending of the invoked method, and it can be accessed by using both POST and GET requests.

Linked Open Data Interface

This interface exposes data in SKOS format. Each concept of the ontology can be accessed by using the following link structure:

General
URL structure
http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/ConceptName
Parameters
Parameter Description
ConceptName The concept name of the ontology to be accessed
Example
Request http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod
Response <?xml version="1.0" encoding="UTF-8"?>

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"

xmlns:j.0="http://www.w3.org/2004/02/skos/core#"
xmlns:j.1="http://purl.org/net/provenance/types#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:j.2="http://spinrdf.org/sp#"
xmlns:j.3="http://aims.fao.org/aos/common/"
xmlns:j.4="http://www.w3.org/2008/05/skos-xl#"
xmlns:j.5="http://www.w3.org/2004/03/trix/rdfg-1/"
xmlns:j.6="http://purl.org/net/provenance/ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/#">
<rdf:Description rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod">
<rdfs:label>
Practices used to enhance crop and livestock health and prevent weed, pest or disease problems without the use of chemical substances.
</rdfs:label>
<foaf:primaryTopic>
<j.0:Concept rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod">
<j.0:broader rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/Method"/>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="ar">أسلوب زراعي</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="bg">селскостопански метод</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="nl">landbouwmethode</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="en">agricultural method</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="et">põllumajandusmeetod</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="fr">méthode agricole</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="de">landwirtschaftliches verfahren</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="el">γεωργική μέθοδος</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="hi">कृषि प्रणाली</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="hu">mezőgazdasági eljárás</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="it">metodologia agricola</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="no">dyrkningsmetode</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="ro">metoda agricola</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="ru">сельскохозяйственные методы</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="sl">vpliva</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="es">método agrícola</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="tr">tarımsal yöntem</j.0:prefLabel>
</j.0:Concept>
</foaf:primaryTopic>
</rdf:Description>

</rdf:RDF>


RESTful RDF Interface

This interface permits to retrieve ontology data by sending POST or GET requests to the service. The interface can be accessed at the following URL and paramteres.

Url
https://dkmtools.fbk.eu/moki/multilingual/organiclingua/OntologyService/RequestManager.php
Parameters
Parameter Description
method the name of the method that the client wants to invoke (see the paragraphs below) for the list of the available methods)
concept the name of the concept for which the client wants to retrieve information
langid the identification code of the language used for filtering the results
updatetimestamp used when the client wants to retrieve only the list of the concepts updated after a certain timestamp

The methods that can be used are listed bellow.

getOntology()

Method Parameter Description
getOntology none Retrieves the entire ontology in OWL format
Example
Request https://dkmtools.fbk.eu/moki/multilingual/organiclingua/OntologyService/RequestManager.php?method=getOntology
Response

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE rdf:RDF [
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
<!ENTITY owl "http://www.w3.org/2002/07/owl#">
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
]>
<rdf:RDF xmlns:rdfs="&rdfs;" xmlns:xsd="&xsd;" xmlns:owl="&owl;" xmlns:rdf="&rdf;" xmlns="http://www.cc.uah.es/ie/ont/OE-OAAE#" xml:base="http://www.cc.uah.es/ie/ont/OE-OAAE">
<owl:Ontology rdf:about="">
</owl:Ontology>
<owl:ObjectProperty rdf:about="#IsUsedToMake">
<rdfs:domain>
<owl:Class rdf:about="#PlantOriginProcessedProduct"/>
</rdfs:domain>
</owl:ObjectProperty>
<owl:ObjectProperty rdf:about="#IsUsedToMake">
<rdfs:range>
<owl:Class rdf:about="#Product"/>
</rdfs:range>
</owl:ObjectProperty>
<owl:Class rdf:about="#IsUsedToMake">
<owl:hasTranslation lang="en">is used to make:</owl:hasTranslation>
</owl:Class>
<owl:Ontology rdf:about="">
</owl:Ontology>
<owl:ObjectProperty rdf:about="#PestOf">
<owl:inverseOf>
<owl:ObjectProperty rdf:about="#HasPest"/>
</owl:inverseOf>
</owl:ObjectProperty>
<owl:Class rdf:about="#PestOf">
<owl:hasTranslation lang="en">pest of:</owl:hasTranslation>
</owl:Class>
<owl:ObjectProperty rdf:about="#Test" />
<owl:ObjectProperty rdf:about="#TestProperty" />
...
</rdf:RDF>

getTranslatedOntology(lang_id)

Method Parameter Description
getTranslatedOntology lang_id Retrieves the entire ontology in OWL format, but labels in languages different from the lang id are discarded
Example
Request https://dkmtools.fbk.eu/moki/multilingual/organiclingua/OntologyService/RequestManager.php?method=getTranslatedOntology&langid=es
Response <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rdf:RDF [
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
<!ENTITY owl "http://www.w3.org/2002/07/owl#">
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
]>
<rdf:RDF xmlns:rdfs="&rdfs;" xmlns:xsd="&xsd;" xmlns:owl="&owl;" xmlns:rdf="&rdf;" xmlns="http://www.cc.uah.es/ie/ont/OE-OAAE#" xml:base="http://www.cc.uah.es/ie/ont/OE-OAAE">
<owl:Ontology rdf:about="">
</owl:Ontology>
<owl:Class rdf:about="#Activity">
<rdfs:subClassOf>
<owl:Class rdf:about="#OAAEConcept"/>
</rdfs:subClassOf>
</owl:Class>
<owl:Class rdf:about="#Activity">
<rdfs:label rdf:datatype="&xsd;string" xml:lang="es">actividad</rdfs:label>
<rdfs:comment rdf:datatype="&xsd;string" xml:lang="es">Un tipo de acción llevada a cabo por un agente en sentido general.</rdfs:comment>
</owl:Class>
...

</rdf:RDF>

getConcept(concept_name)

Method Parameter Description
getConcept concept_name Retrieves axioms in OWL format related to the concept given as input
Example
Request https://dkmtools.fbk.eu/moki/multilingual/organiclingua/OntologyService/RequestManager.php?method=getConcept&concept=AgriculturalMethod
Response <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE rdf:RDF [
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#">
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#">
<!ENTITY owl "http://www.w3.org/2002/07/owl#">
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#">
]>
<rdf:RDF xmlns:rdfs="&rdfs;" xmlns:xsd="&xsd;" xmlns:owl="&owl;" xmlns:rdf="&rdf;" xmlns="http://www.cc.uah.es/ie/ont/OE-OAAE#" xml:base="http://www.cc.uah.es/ie/ont/OE-OAAE">
<owl:Ontology rdf:about="">
</owl:Ontology>
<owl:Class rdf:about="#AgriculturalMethod">
<rdfs:subClassOf>
<owl:Class rdf:about="#Method"/>
</rdfs:subClassOf>
</owl:Class>
...
</rdf:RDF>

getSKOSConcept(concept_name)

Method Parameter Description
getSKOSConcept concept_name Retrieves axioms in AGROVOC SKOS format related to the concept given as input. This result is the same obtained by using the Linked Open Data interface
Example
Request https://dkmtools.fbk.eu/moki/multilingual/organiclingua/OntologyService/RequestManager.php?method=getSKOSConcept&concept=AgriculturalMethod
Response <?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:j.0="http://www.w3.org/2004/02/skos/core#"
xmlns:j.1="http://purl.org/net/provenance/types#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:j.2="http://spinrdf.org/sp#"
xmlns:j.3="http://aims.fao.org/aos/common/"
xmlns:j.4="http://www.w3.org/2008/05/skos-xl#"
xmlns:j.5="http://www.w3.org/2004/03/trix/rdfg-1/"
xmlns:j.6="http://purl.org/net/provenance/ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xml:base="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/#">
<rdf:Description rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod">
<rdfs:label>
Practices used to enhance crop and livestock health and prevent weed, pest or disease problems without the use of chemical substances.
</rdfs:label>
<foaf:primaryTopic>
<j.0:Concept rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod">
<j.0:broader rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/Method"/>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="ar">أسلوب زراعي:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="bg">селскостопански метод:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="nl">landbouwmethode:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="en">agricultural method:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="et">põllumajandusmeetod:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="fr">méthode agricole:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="de">landwirtschaftliches verfahren:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="el">γεωργική μέθοδος:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="hi">कृषि प्रणाली:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="hu">mezőgazdasági eljárás:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="it">metodologia agricola:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="no">dyrkningsmetode:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="ro">metoda agricola:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="ru">сельскохозяйственные методы:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="sl">vpliva:</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="es">método agrícola::</j.0:prefLabel>
<j.0:prefLabel rdf:about="http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod" xml:lang="tr">tarımsal yöntem::</j.0:prefLabel>
</j.0:Concept>
</foaf:primaryTopic>
</rdf:Description>
</rdf:RDF>

getUpdatedConcepts(timestamp)

Method Parameter Description
getUpdatedConcepts timestamp Retrieves the list, in Linked Open Data format, of the concepts updated after the timestamp given as input

In this example, concepts updated after 01/01/2013 00:00:00 are retrieved.

Example
Request https://dkmtools.fbk.eu/moki/multilingual/organiclingua/OntologyService/RequestManager.php?method=getUpdatedConcepts&updatetimestamp=1356998400
Response http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/Activity

http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AgriculturalMethod http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AnimalOriginProcessedProduct http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AnimalOriginProduct http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/AnimalOriginUnprocessedProduct
....
http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/TestProperty http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/UsesProcess

getReplacedConcepts()

Method Parameter Description
getReplacedConcepts none Retrieves the list, in Linked Open Data format, of the concepts that have been replaced with other concepts during the entire evolution of the Organic.Lingua ontology
Example
Request https://dkmtools.fbk.eu/moki/multilingual/organiclingua/OntologyService/RequestManager.php?method=getReplacedConcepts
Response http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/ReviewMeetingTestConceptParent2

getDeprecatedConcepts()

Method Parameter Description
getDeprecatedConcepts none Retrieves the list, in Linked Open Data format, of the concepts that have been deprecated during the entire evolution of the Organic.Lingua ontology
Example
Request https://dkmtools.fbk.eu/moki/multilingual/organiclingua/OntologyService/RequestManager.php?method=getDeprecatedConcepts
Response http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/ReviewMeetingTestConceptParent2

getMovedConcepts()

Method Parameter Description
getMovedConcepts none Retrieves the list, in Linked Open Data format, of the concepts that have been moved in the concept hierarchy during the entire evolution of the Organic.Lingua ontology
Example
Request https://dkmtools.fbk.eu/moki/multilingual/organiclingua/OntologyService/RequestManager.php?method=getMovedConcepts
Response http://dkmtools.fbk.eu/moki/multilingual/organiclingua/concept/ReviewMeetingTestConceptParent

getConceptEvolution(concept_name)

Method Parameter Description
getConceptEvolution concept_name Retrieves the entire evolution of a concept
Example
Request https://dkmtools.fbk.eu/moki/multilingual/organiclingua/OntologyService/RequestManager.php?method=getConceptEvolution&concept=AgriculturalMethod
Response none*

*The output has a triple structure in which concepts are described by using the Linked Data Format. The possible triples are the following:

http://NAMESPACE/AgriculturalMethod hasOldParent http://NAMESPACE/AgriculturalMethodOldParent
http://NAMESPACE/AgriculturalMethod replaces http://NAMESPACE/ReplacedConcept
http://NAMESPACE/AgriculturalMethod hasDeprecatedParent http://NAMESPACE/DeprecatedParent
http://NAMESPACE/AgriculturalMethod hasDeprecatedDescendant http://NAMESPACE/DeprecatedDescendant
Personal tools
Menu