VIE.js
Semantic Interaction Examples
Find the capital of Mongolia
This code digs out the answer:
var vie = new VIE(); vie.use(new vie.DBPediaService()); var mongoliaURI = "
"; var capitalPropURI = "
"; vie .load({entity : mongoliaURI}) .using('dbpedia') .execute() .done(function (mongolia) { var capitalURI = mongolia.get(capitalPropURI); vie .load({entity : capitalURI}) .using('dbpedia') .execute() .done(function(capital) { var url = capital.getSubjectUri(); var label = VIE.Util.getPreferredLangForPreferredProperty(capital, ['rdfs:label'], ['en']); results.append( jQuery('
The capital of Mongolia is
' + label + '
.
') ); }); });
Run
Examples
Find the capital of Mongolia
Get enhancements for text
Height of the Eiffel Tower
Load the schema.org ontology