Triply Academy - TriplyDB
T

Triply Academy

Triply-Academy-V2
Created on Mar 15th, 2023
Members

This query gives an example of a federated query for Iris dataset in TriplyDB and DBpedia

Created over 1 year ago, 2 versions

construct

Public

This construct query enables to create new triples that are not existing in the original dataset/graph

Created over 1 year ago, 1 version

This query example finds the top n predicates in the dataset using subquery

Created over 1 year ago, 1 version
Created over 3 years ago, 3 versions
Created over 3 years ago, 3 versions
Created over 3 years ago, 2 versions
Created over 3 years ago, 4 versions
Created over 3 years ago, 3 versions
Created over 3 years ago, 3 versions
Created over 3 years ago, 3 versions
Created over 3 years ago, 4 versions
Created over 3 years ago, 5 versions
Created over 3 years ago, 5 versions

The generic projection (select *) is used to include one column for every visible variable in the pattern component.

The order in which the columns are returned is not specified in the SPARQL standard and is implementation-specific. Often, columns are returned in the order in which the corresponding variables appear for the first time inside the pattern component, but this is not guaranteed. If the order of the columns is important, it is more robust to specify the variables explicitly.

Created over 3 years ago, 3 versions

This query only returns one column. This one column contains the colors of Pokémon (bindings for variable ?color).

The ?pokemon variable is used in the graph pattern, but its bindings are not returned in the projection. Variables like ?pokemon that are internal to the pattern component and are not exposed in the projection are called hidden variables.

Result sets must contain of at least one column. The same column may be included more than once.

Created over 3 years ago, 2 versions

Like this query, but with the order of the columns inverted: the projection specifies which columns are included in the result set, and also specifies the order in which they appear.

Created over 3 years ago, 2 versions

Identical to this query, but the lengthy predicate term that was used there is now abbreviated using alias (measure). This requires that the alias and IRI prefix are declared at the top of the query (keyword prefix).

The part of the query that appears before the projection, and that contains prefix declarations, is called the Prologue.

Notice that another IRI prefix observation is also declared. This prefix is not used in the query itself, but is used to abbreviate the values that appear the first column of the result set table. (This is a Triply-specific feature.)

Created over 3 years ago, 3 versions
Created over 3 years ago, 5 versions
Created over 3 years ago, 1 version

Binding a variable

The bind keyword allows variables to be introduced that do not appear in a graph pattern.

Created over 3 years ago, 5 versions

A simple select query that returns observations (bindings for the variable ?observation) and their colors (bindings for the variable ?petalLength), in that order.

Notice how the predicate term (i.e., the middle term) is bound to a specific IRI (<https://triplydb.com/triply/iris/def/measure/petalLength>) that denotes the relationship between things and their depiction.

Created over 3 years ago, 5 versions

This is a very simple select query. But it already contains all three main select query components:

Projection
The columns that are returned (select ?s ?p ?o)
Triple Pattern
How the cells will be filled based on graph matching (?s ?p ?o.)
Result set modifiers
Adaptations to the result table (limit)
Created over 3 years ago, 1 version