Sparql Host Object
1.0 Introduction
Sparql hostobject allows you to do RDF querying and making use of the semantic data within a mashup. You can specify the RDF endpoint or the data source with the Sparql query and retrieve the dataset in XML or JSON.
1. Example
function sparqlQuery(sparqlEndPoint, rdfQuery, resultType) {
var sparql = new Sparql();
sparql.sparqlEndPoint = sparqlEndPoint;
sparql.spaqrlQuery = rdfQuery;
sparql.resultType = resultType;
return new XML(sparql.getDataFromSparqlEndPoint());
}
2 Resource Interface
{
property String sparqlEndPoint;
property String rdfDataSource;
property String spaqrlQuery;
property String resultType;
function String getDataFromRdfSource();
function String getDataFromSparqlEndPoint();
}
2. API Documentation
| Member | Description |
property String sparqlEndPoint |
This property is used to specify the RDF endpoint. |
property String rdfDataSource |
This property is used to specify RDF data source as a string. |
property String spaqrlQuery |
This property is used to specify the RDF query. |
property String resultType |
This property is used to specify the result type of the query. you can use either JSON or XML. If this property isn't set, it will use XML as the result type. |
String getDataFromRdfSource() |
This method is used to get the result from an RDF source. |
String getDataFromSparqlEndPoint() |
This method is used to get the result from an RDF endpoint. |