The GEOSS Discovery And Access Broker APIs
Authors: Fabrizio Papeschi, Mattia Santoro, Stefano Nativi
API version: 1.4.3-beta

Concept

Module: Concept

This object represents a concept from a Controlled Vocabulary.

See also DAB concept method.
See also DAB discover method

Methods

description

() Array

Retrieves the descriptions of this concept

Returns:

Array:

An array of strings, each string is a description of this concept in different languages

extend

(
  • onResponse
  • [relation]
  • [options]
)
async

Retrieves concepts linked to this concept according to one or more relations from the remote Controlled Vocabulary.
The size of the extension, that is the number of concepts resulting from the extension, can be retrieved using the method extensionSize

 // extends a concept using two relations;
 // the following styles are equivalents

 // uses GIAPI.Relation instances
 var rel = [];
 rel.push(GIAPI.Relation.BROADER);
 rel.push(GIAPI.Relation.NARROWER);

 // uses GIAPI.Relation instances values
 rel = [];
 rel.push(GIAPI.Relation.BROADER.value);
 rel.push(GIAPI.Relation.NARROWER.value);

 // uses GIAPI.Relation instances value
 rel = [];
 rel.push('skos%3Abroader');
 rel.push('skos%3Anarrower');

 // uses a combined style
 rel = [];
 rel.push(GIAPI.Relation.BROADER);
 rel.push('skos%3Anarrower');

 // extends the concept
 concept.extend( function(result,error) {

 if(error){
    alert('Error occurred: '+error);
    return;
 }

 for (var i = 0; i < result.length; i++) {

    var con = concepts[i];
    var uri = con.uri();
    var label = con.label();
    var desc = con.description();
    var thes = con.sourceThesaurus();
    var rel = con.rootRelation();

    // invokes stringify method on all returned concepts
    alert(con.stringify());
   }
 }, rel);

Parameters:

  • onResponse Function

    Callback function for receiving asynchronous query response

    • result Array

      The array of linked concepts

    • error String

      In case of error, this argument contains a message which describes the problem occurred

  • [relation] Relation/String [] optional

    An array of relations or relations values used to retrieve the linked concepts. If omitted, all available relations are used

  • [options] Object optional

    Object literal of available options

    • [start] Integer optional

      The start index of the first returned concept, starting from 1

    • [count=10] Integer optional

      The maximum number of concepts to return

extensionSize

(
  • [relation]
)
Integer

Retrieves the number of concepts resulting from the extension of this concept with the specified relation

Parameters:

Returns:

Integer:

The number of concepts resulting from the extension of this concept with the specified relation

label

() Array

Retrieves the labels of this concept

Returns:

Array:

An array of strings. Each string is a label of this concept in different languages

property

(
  • onResponse
  • name
)
async

Retrieves the Property of this Concept with the specified name

Parameters:

  • onResponse Function

    Callback function for receiving asynchronous query response

    • property Property

      The Property with the specified name, or null in case of error or if no Property exists with the specified name

    • error String

      In case of error, this argument contains a message which describes the problem occurred

  • name String

    The name of the property. See also PropertyName

rootRelation

() Relation

Retrieves the relation used to find this concept from the origin concept

Returns:

Relation:

The relation which links this concept to the origin concept

sourceThesaurus

() String

Retrieves the name of the Controlled Vocabulary that originated this concept

Returns:

String:

The name of the Controlled Vocabulary

stringify

() String

Generates a string representation of this concept

Returns:

String:

The string representation of this concept

uri

() String

Retrieves the URI of this concept

Returns:

String:

The URI string of this concept