-
Notifications
You must be signed in to change notification settings - Fork 21
Federated query
You specify how the Linked Data Theatre retrieves the data. One way is to specify a sparql statement. SPARQL includes the option to retrieve data from multiple SPARQL endpoint (federated queries). You can use this capability to access multiple endpoints, for example:
stage:DBPediaQuery a elmo:Representation;
elmo:query '''
CONSTRUCT {
<http://dbpedia.org/resource/Amersfoort> ?p ?o
}
WHERE {
SERVICE <http://dbpedia.org/sparql> {
<http://dbpedia.org/resource/Amersfoort> ?p ?o
}
}
''';
.
A lot of Linked Data is available on the web, but only a few sites have an open SPARQL endpoint. What if the data is available as linked data, but not via a SPARQL endpoint?
The theatre has the ability to perform a [webpage call](Webpage and service call), but what if you want to include data from multiple endpoints? In such a case, you can use the 'virtual sparql endpoint' that is included with the LDT:
stage:DBPediaQuery a elmo:Representation;
elmo:query '''
CONSTRUCT {
<http://dbpedia.org/resource/Amersfoort> ?p ?o
}
WHERE {
SERVICE <http://localhost:8080/url> {
<http://dbpedia.org/resource/Amersfoort> ?p ?o
}
}
''';
.
The example above uses the virtual sparql endpoint at http://localhost:8080/url
. Because the syntax is identical to a normal sparql federated service, you can use the results as if they would have been retrieved from an actual sparql endpoint.
In this case, the virtual endpoint retrieves the information at the page http://dbpedia.org/resource/Amersfoort
and returns any triple ?s?p?o where ?s = http://dbpedia.org/resource/Amersfoort
.
In some cases, you want to retrieve any information of a page, regardless the original URI. In such a case, use the query below:
stage:DBPediaQuery a elmo:Representation;
elmo:query '''
SELECT ?s ?p ?o
WHERE {
SERVICE <http://localhost:8080/url> {
GRAPH <http://dbpedia.org/data/Amersfoort.rdf> {
?s ?p ?o
}
}
}
''';
.
This example retrieves all triples from the page http://dbpedia.org/data/Amersfoort.rdf
.
The examples above used pages that actually contained linked data. But normal webpages are possible as well, as long as they contain some markup. This is the same way that search engines look at pages!
stage:SchemaOrgPerson a elmo:Representation;
elmo:query '''
CONSTRUCT {?s ?p ?o}
WHERE {
{
SELECT * WHERE {
SERVICE <http://localhost:8080/url> {
GRAPH <http://www.imdb.com/title/tt0306414> {
?s ?p ?o
}
}
}
}
}
''';
.
- Home
- Theatre installation
- Tutorial
- Using the theatre
- Configuring the theatre
-
Appearances
- CarouselAppearance
- ChartAppearance
- ContentAppearance
- GeoAppearance
- GeoSelectAppearance
- GraphAppearance
- FormAppearance
- FrameAppearance
- HeaderAppearance
- HiddenAppearance
- HtmlAppearance
- IndexAppearance
- ImageAppearance
- LoginAppearance
- ModelAppearance
- NavbarAppearance
- NavbarSearchAppearance
- ShortTableAppearance
- TableAppearance
- TreeAppearance
- TextAppearance
- VocabularyAppearance
- LDT Vocabulary