Concept
This object represents a concept from a Controlled Vocabulary.
See also DAB concept method.
See also DAB discover method
Item Index
Methods
extend
(
async
-
onResponse
-
[relation]
-
[options]
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);
extensionSize
(
Integer
-
[relation]
Retrieves the number of concepts resulting from the extension of this concept with the specified relation
Parameters:
-
[relation]
Relation optional
property
(
async
-
onResponse
-
name
Parameters:
sourceThesaurus
()
String
Retrieves the name of the Controlled Vocabulary that originated this concept
Returns:
String:
The name of the Controlled Vocabulary