Skip to content

Commit

Permalink
add 05-02-08
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoqi Zhao committed Oct 7, 2024
1 parent e8ac8ae commit 65db516
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ch05/05-02/05-02-08/ex298.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# filename: ex298.ttl

@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix d: <http://learningsparql.com/ns/data#> .
@prefix t: <http://purl.org/tio/ns#> .

d:meeting1 t:starts "2024-10-14T12:30:00.000-05:00"^^xsd:dateTime .

d:meeting2 t:starts "2024-10-15T12:30:00"^^xsd:dateTime .

d:meeting3 t:starts "2024-10-15T12:30:00+08:00"^^xsd:dateTime .
17 changes: 17 additions & 0 deletions ch05/05-02/05-02-08/ex299.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# filename: ex299.rq

PREFIX d: <http://learningsparql.com/ns/data#>
PREFIX t: <http://purl.org/tio/ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT *
FROM <ex298.ttl>
WHERE {
?mtg t:starts ?startTime .
BIND (year(?startTime) AS ?yearTest)
BIND (month(?startTime) AS ?monthTest)
BIND (day(?startTime) AS ?dayTest)
BIND (hours(?startTime) AS ?hoursTest)
BIND (minutes(?startTime) AS ?minutesTest)
BIND (seconds(?startTime) AS ?secondsTest)
}
14 changes: 14 additions & 0 deletions ch05/05-02/05-02-08/ex301.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# filename: ex301.rq

PREFIX d: <http://learningsparql.com/ns/data#>
PREFIX t: <http://purl.org/tio/ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT *
FROM <ex298.ttl>
WHERE {
?mtg t:starts ?startTime .
BIND (timezone(?startTime) AS ?timezoneTest)
BIND (tz(?startTime) AS ?tzTest)
}
ORDER BY ?mtg
12 changes: 12 additions & 0 deletions ch05/05-02/05-02-08/ex303.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# filename: ex303.rq

PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

SELECT *
WHERE {
BIND (now() AS ?currentTime)
BIND (seconds(?currentTime) AS ?currentSeconds)
BIND (year(?currentTime) AS ?currentYear)
BIND (timezone(?currentTime) AS ?currentTimezone)
}
ORDER BY ?mtg

0 comments on commit 65db516

Please sign in to comment.