Koninklijke Bibliotheek

kb
Created on Sep 16th, 2018
Members

2-8-TimeLine

Created 5 years ago, 5 versions

2-7-PivotTable

Created 5 years ago, 2 versions

2-5-GEO

Created 5 years ago, 6 versions

2-4-Google-charts

Created 5 years ago, 3 versions

2-3-Gallery-Query

Created 5 years ago, 1 version

2-2-Raw-Data

Created 5 years ago, 1 version

2-1-Table-view

Created 5 years ago, 1 version

1-2-gallery-query

A simple saved query with an Gallery

Created 5 years ago, 3 versions

1-1-Simple-saved-query

Your first saved query

Created 5 years ago, 1 version

sparql-templating

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 5 years ago, 9 versions

sparql-html

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 5 years ago, 5 versions

property-histogram

Created 5 years ago, 4 versions

ask-2

Created 5 years ago, 7 versions

ask-1

Created 5 years ago, 10 versions

3-3

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 5 years ago, 8 versions

3-2-implicit-bracketed

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 5 years ago, 5 versions

3-2-implicit

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 5 years ago, 5 versions

3-2

Aggregation: count

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

Created 5 years ago, 6 versions

3-1

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 5 years ago, 6 versions

2-9

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 5 years ago, 4 versions

2-8

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 5 years ago, 4 versions

2-7

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

Created 5 years ago, 4 versions

2-6

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 5 years ago, 4 versions

2-5

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 5 years ago, 6 versions

2-4

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 5 years ago, 5 versions

2-3

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 5 years ago, 5 versions

2-2

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 5 years ago, 5 versions

2-11

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 5 years ago, 4 versions

2-10

Result set modifiers: order by

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

Created 5 years ago, 4 versions

2-1

Graph Pattern: 1 Triple Pattern

Lesson 1 dealt with SPARQL queries that consist of 1 Triple Pattern. (This often corresponds to one physical line in the query string.) One or more consecutive Triple Patterns together form a Graph Pattern.

Created 5 years ago, 3 versions