Skip to content

Commit

Permalink
add 03-02
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoqi Zhao committed Sep 21, 2024
1 parent 323e98e commit 7e35102
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 3 deletions.
9 changes: 6 additions & 3 deletions LearningSPARQL.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@ Graph Engine (GE) is a distributed in-memory data processing engine, underpinned
</node>
</node>
<node TEXT="03. SPARQL Queries: A Deeper Dive" POSITION="bottom_or_right" ID="ID_47418205" CREATED="1702253741683" MODIFIED="1702253761941">
<node TEXT="03.01 More Readable Query Results" ID="ID_502507515" CREATED="1702254891456" MODIFIED="1702254906770">
<node TEXT="03.01 More Readable Query Results" FOLDED="true" ID="ID_502507515" CREATED="1702254891456" MODIFIED="1702254906770">
<node TEXT="03.01.01 Using the Labels Provided by DBpedia - https://dbpedia.org/snorql/" ID="ID_103170033" CREATED="1702254908328" MODIFIED="1726895215293" LINK="https://dbpedia.org/snorql/">
<node TEXT="query: ex048-1" ID="ID_1064149533" CREATED="1726895190952" MODIFIED="1726895198042" LINK="https://dbpedia.org/snorql/?query=PREFIX+d%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0A%0D%0ASELECT+%3Fartist+%3Falbum%0D%0AWHERE+%7B%0D%0A++++%3Falbum+d%3Aproducer+%3ATimbaland+.%0D%0A++++%3Falbum+d%3Aartist+%3Fartist+.%0D%0A%7D"/>
<node TEXT="query: ex048-2" ID="ID_608879733" CREATED="1726895130472" MODIFIED="1726895138803" LINK="https://dbpedia.org/snorql/?query=PREFIX+d%3A+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2F%3E%0D%0A%0D%0ASELECT+%3FalbumName+%3FartistName%0D%0AWHERE+%7B%0D%0A++++%3Falbum+d%3Aproducer+%3ATimbaland+.%0D%0A++++%3Falbum+d%3Aartist+%3Fartist+.%0D%0A++++%3Falbum+rdfs%3Alabel+%3FalbumName+.%0D%0A++++%3Fartist+rdfs%3Alabel+%3FartistName+.%0D%0A%7D"/>
Expand All @@ -1100,8 +1100,11 @@ Graph Engine (GE) is a distributed in-memory data processing engine, underpinned
<node TEXT="03.01.02 Getting Labels from Schemas and Ontologies" ID="ID_1616598261" CREATED="1702254922055" MODIFIED="1702254933993"/>
</node>
<node TEXT="03.02 Data That Might Not Be There" ID="ID_835493373" CREATED="1702254954705" MODIFIED="1702254965179">
<node TEXT="OPTIONAL" ID="ID_1749097275" CREATED="1705768293632" MODIFIED="1705772198740">
<node TEXT="OPTIONAL" ID="ID_1749097275" CREATED="1705768293632" MODIFIED="1726920724635">
<arrowlink DESTINATION="ID_1415407541"/>
<arrowlink DESTINATION="ID_1647965527"/>
<node TEXT="The triples in the pattern work together as a unit, or as a graph pattern" ID="ID_386065804" CREATED="1726920749234" MODIFIED="1726920776547"/>
<node TEXT="The order of OPTIONAL graph patterns matters" ID="ID_507793727" CREATED="1726920800730" MODIFIED="1726920817556"/>
</node>
</node>
<node TEXT="03.03 Finding Data That Doesn&apos;t Meet Certain Conditions" FOLDED="true" ID="ID_1381710793" CREATED="1702254965352" MODIFIED="1702254982384">
Expand Down Expand Up @@ -1189,7 +1192,7 @@ Graph Engine (GE) is a distributed in-memory data processing engine, underpinned
<node TEXT="06.05.04 Deleting and Replacing Triples in Named Graphs" ID="ID_1230375298" CREATED="1702256978738" MODIFIED="1702256992845"/>
</node>
</node>
<node TEXT="07. Query Efficiency and Debugging" FOLDED="true" POSITION="bottom_or_right" ID="ID_1195747025" CREATED="1702253818300" MODIFIED="1702253827277">
<node TEXT="07. Query Efficiency and Debugging" POSITION="bottom_or_right" ID="ID_1195747025" CREATED="1702253818300" MODIFIED="1702253827277">
<node TEXT="07.01 Efficiency Inside the WHERE Clause" ID="ID_1844824567" CREATED="1702256999205" MODIFIED="1702257031184">
<node TEXT="07.01.01 Reduce the Search Space" ID="ID_474317469" CREATED="1702257031830" MODIFIED="1702257039836"/>
<node TEXT="07.01.02 OPTIONAL Is Very Optional" ID="ID_1647965527" CREATED="1702257040051" MODIFIED="1702257050092"/>
Expand Down
Binary file modified LearningSPARQL.pptx
Binary file not shown.
21 changes: 21 additions & 0 deletions ch03/03-02/ex054.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# filename: ex054.ttl

@prefix ab: <http://learningsparql.com/ns/addressbook#>
@prefix d: <http://learningsparql.com/ns/data#>

d:i0432 ab:firstName "Richard" .
d:i0432 ab:lastName "Mutt" .
d:i0432 ab:homeTel "(229) 276-5135" .
d:i0432 ab:nick "Dick" .
d:i0432 ab:email "[email protected]" .

d:i9771 ab:firstName "Cindy" .
d:i9771 ab:lastName "Marchall" .
d:i9771 ab:homeTel "(245) 646-5488" .
d:i9771 ab:email "[email protected]" .

d:i8301 ab:firstName "Craig" .
d:i8301 ab:lastName "Ellis" .
d:i8301 ab:workTel "(245) 315-5486" .
d:i8301 ab:email "[email protected]" .
d:i8301 ab:email "[email protected]" .
10 changes: 10 additions & 0 deletions ch03/03-02/ex055.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# filename: ex055.rq

PREFIX ab: <http://learningsparql.com/ns/addressbook#>

SELECT ?first ?last ?workTel
WHERE {
?s ab:firstName ?first ;
ab:lastName ?last ;
ab:workTel ?workTel .
}
14 changes: 14 additions & 0 deletions ch03/03-02/ex057.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# filename: ex057.rq

PREFIX ab: <http://learningsparql.com/ns/addressbook#>

SELECT ?first ?last ?workTel
WHERE {
?s ab:firstName ?first ;
ab:lastName ?last .
# above line can be ended either in ";" or ".", no error
OPTIONAL {
?s ab:workTel ?workTel .
}

}
15 changes: 15 additions & 0 deletions ch03/03-02/ex059.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# filename: ex059.rq

PREFIX ab: <http://learningsparql.com/ns/addressbook#>

SELECT ?first ?last ?workTel ?nick
WHERE {
?s ab:firstName ?first ;
ab:lastName ?last .
# above line can be ended either in ";" or ".", no error
OPTIONAL {
?s ab:workTel ?workTel ;
ab:nick ?nick .
}

}
16 changes: 16 additions & 0 deletions ch03/03-02/ex061.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# filename: ex061.rq

PREFIX ab: <http://learningsparql.com/ns/addressbook#>

SELECT ?first ?last ?workTel ?nick
WHERE {
?s ab:firstName ?first ;
ab:lastName ?last .
# above line can be ended either in ";" or ".", no error
OPTIONAL {
?s ab:workTel ?workTel .
}
OPTIONAL {
?s ab:nick ?nick .
}
}
14 changes: 14 additions & 0 deletions ch03/03-02/ex063.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# filename: ex063.rq

PREFIX ab: <http://learningsparql.com/ns/addressbook#>

SELECT ?first ?last
WHERE {
?s ab:lastName ?last .
OPTIONAL {
?s ab:nick ?first .
}
OPTIONAL {
?s ab:firstName ?first .
}
}

0 comments on commit 7e35102

Please sign in to comment.