Koninklijke Bibliotheek

kbCreated on Sep 16th, 2018
Members
Created 10 months ago, 5 versions
Created 10 months ago, 2 versions
Created 10 months ago, 1 version
Created 10 months ago, 3 versions
Created 10 months ago, 3 versions
Created 10 months ago, 1 version
Created 10 months ago, 1 version
Created 10 months ago, 1 version

A simple saved query with an Gallery

Created 10 months ago, 3 versions

Your first saved query

Created 10 months ago, 1 version

Query that shows how Triply Templating can be used to simplify SPARQL queries with complex literals. This is specifically useful for SPARQL queries that return HTML literals, which can be rather complex.

This query is a simplified version of this query that does not use Triply Templating.

Created 10 months ago, 9 versions

This query shows how HTML literals can be returned by a SPARQL query.

Since the creation of complex HTML literals can be rather cumbersome, the query can be rewritten into this query that uses Triply Templates for simplification.

Created 10 months ago, 5 versions
Created 10 months ago, 4 versions
Created 10 months ago, 6 versions
Created 10 months ago, 9 versions

Aggregation: concatenate

This query applies the string concatenation function to the blocks of aggregated values.

Notice that the projection variables are calculated in sequence, so that later projection variables can make use of earlier ones.

Created 10 months ago, 8 versions

This query is similar to query 3-2-implicit, but uses anonymous node notation in order to omit the ?item subject term variable. By doing so, the meaning of this query is significantly changed, as can be seen by the result set.

How to read the aggregation in this query?

  1. We are dealing with aggregation, because at least one aggregation function (count) appears.
  2. No group by clause appears, so we are dealing with implicit grouping.
  3. Implicit grouping means grouping around the set of variables that are visible and not argument to an aggregation function. In this case, this set of variables is ∅ (the empty set).
  4. Grouping based on the empty set means that all results are part one one big group. So this query counts the number of names in the entire dataset.
Created 10 months ago, 5 versions

This query is similar to query 3.2, but uses implicit grouping.

Implicit grouping occurs when at least one aggregation function is used (in this case count) and no group by clause is given. In this case, grouping is performed based on the set of visible variables that are not themselves arguments to an aggregation function. In this query, implicit grouping result in grouping around the ?item variable.

Created 10 months ago, 5 versions

Aggregation: count

This query applies the count function to the blocks of names that appear with Creative works.

Created 10 months ago, 6 versions

The result set of this query consists of 'blocks' of values (names in this case) that appear with the same Creative Works.

Aggregation allows functions to be applied to these 'blocks' of values, resulting in one single value per grouping element.

The grouping element can consist of one or more variables.

Created 10 months ago, 6 versions

Every variable in a SPARQL query can be replaced by an RDF name (an IRI or literal). Replacing a variable with an RDF name makes the query more specific, i.e., results in a smaller result set.

This query is similar to query 2-8, but the ?typeName variable is replaced by the literal `"StillImage" so that only stillImages for the Creative works are returned.

Created 10 months ago, 4 versions

Abbreviation: property path notation

This query is similar to query 2-7, but uses Property Path notation (forward slash, /) in order to skip a node that was not used in the result set.

Created 10 months ago, 4 versions

This query has a Graph Pattern that consists of four Triple Patterns.

Created 10 months ago, 4 versions

Filter by language

This query uses the lang/1 function in order to return only those result rows in which one name is in Japanese (ja-ja) and one name is in US English (en-us).

The fact that both constraints must be satisfied is expressed by the Boolean conjunction operator (&&).

Created 10 months ago, 4 versions

Some properties can have multiple values for the same object. For example, one item has multiple values for the name property (item:name) in different languages.

Notice that when a Triple Pattern ends with the comma character (,) the next Triple Pattern implicitly has the same subject and predicate terms as the previous Triple Pattern. (If the number of object terms is small we are used to placing them on the same physical line, as in this query.)

The filter expression puts additional constraints on which results are returned: the two names must be different. Difference/non-identity is specified by the != operator.

Notice that use of != means that for every pair 〈A,B〉 the pair 〈B,A〉 is also included. Use the smaller than (<) or larger than (>) operator instead in order to exclude such symmetric name pairs in the result set.

Created 10 months ago, 6 versions

Abbreviation: repeated subject terms

This query is similar to query 2-3, but the subject term is not repeated.

Whenever consecutive Triple Patterns have the same subject term, the subject term of the next Triple Pattern can be skipped if the previous Triple Pattern ends in a semi-colon (;) instead of a dot (.).

Created 10 months ago, 5 versions

Graph Pattern: Four Triple Patterns

This query contains a Graph Pattern that consists of four Triple Patterns. Notice how all TP share the same subject term and how the last two TP also share the same predicate term.

Created 10 months ago, 5 versions

Graph Pattern: 2 Triple Patterns

This query has a Graph Pattern that consists of 2 Triple Patterns. Notice how the Triple Patterns are connect by a shared variable (?item).

Created 10 months ago, 5 versions

Result set modification

This query is similar to query 2-10, but inverts the sort with the descending (desc) keyword, resulting in the 25 newest images.

Created 10 months ago, 4 versions

Result set modifiers: order by

This query returns the 25 Creative works with the oldest date of publication.

Created 10 months ago, 4 versions