-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Xiaoqi Zhao
committed
Oct 1, 2024
1 parent
0cdb451
commit 8571551
Showing
5 changed files
with
94 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# filename: ex069.ttl | ||
|
||
@prefix ab: <http://learningsparql.com/ns/addressbook#> . | ||
@prefix d: <http://learningsparql.com/ns/data#> . | ||
|
||
# People | ||
|
||
d:i0432 ab:firstName "Rickard" ; | ||
ab:lastName "Mut" ; | ||
ab:email "[email protected]" . | ||
|
||
d:i9771 ab:firstName "Cindy" ; | ||
ab:lastName "Marshall" ; | ||
ab:email "[email protected]" . | ||
|
||
d:i8301 ab:firstName "Craig" ; | ||
ab:lastName "Ellis" ; | ||
ab:email "[email protected]" . | ||
|
||
# Courses | ||
|
||
d:course34 ab:couresTitle "Modeling Data with OWL" . | ||
d:course71 ab:couresTitle "Enhancing Websites with RDFs" . | ||
d:course59 ab:couresTitle "Using SPARQL with non-RDF Data" . | ||
d:course85 ab:couresTitle "Updating Data with SPARQL" . | ||
|
||
# Who's taking which courses | ||
|
||
d:i8301 ab:takingCourse d:course59 . | ||
d:i9771 ab:takingCourse d:course34 . | ||
d:i0432 ab:takingCourse d:course85 . | ||
d:i0432 ab:takingCourse d:course59 . | ||
d:i9771 ab:takingCourse d:course59 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# filename: ex122.ttl | ||
|
||
@prefix ab: <http://learningsparql.com/ns/addressbook#> . | ||
@prefix d: <http://learningsparql.com/ns/data#> . | ||
|
||
# People | ||
|
||
d:i5433 ab:firstName "Katherine" ; | ||
ab:lastName "Duncan" ; | ||
ab:email "[email protected]" . | ||
|
||
d:i2194 ab:firstName "Bradley" ; | ||
ab:lastName "Perry" ; | ||
ab:email "[email protected]" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# filename: ex125.ttl | ||
|
||
@prefix ab: <http://learningsparql.com/ns/addressbook#> . | ||
@prefix d: <http://learningsparql.com/ns/data#> . | ||
|
||
# Courses | ||
|
||
d:course42 ab:couresTitle "Combining Public and Private RDF Data" . | ||
d:course24 ab:couresTitle "Using Name Graphs" . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# filename: ex126.rq | ||
|
||
PREFIX ab: <http://learningsparql.com/ns/addressbook#> | ||
|
||
SELECT ?lastName ?courseName | ||
FROM <ex069.ttl> | ||
FROM NAMED <ex122.ttl> | ||
FROM NAMED <ex125.ttl> | ||
WHERE { | ||
{ | ||
?student ab:lastName ?lastName . | ||
} | ||
UNION | ||
{ | ||
?course ab:couresTitle ?courseName . | ||
} | ||
UNION | ||
{ | ||
GRAPH <ex122.ttl> { | ||
?student ab:lastName ?lastName . | ||
} | ||
} | ||
UNION | ||
{ | ||
GRAPH <ex125.ttl> { | ||
?course ab:couresTitle ?courseName . | ||
} | ||
} | ||
} |