Skip to content

Commit

Permalink
add 05-03
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiaoqi Zhao committed Oct 7, 2024
1 parent 0e92a09 commit 323a2b3
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
23 changes: 23 additions & 0 deletions ch05/05-03/ex012.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# filename: ex012.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:email "ricard49@hotmail.com" .

d:i9771 ab:firstName "Cindy" .
d:i9771 ab:lastName "Marshall" .
d:i9771 ab:homeTel "(245) 646-5488" .
d:i9771 ab:email "cindym@gmail.com" .

d:i8301 ab:firstName "Craig" .
d:i8301 ab:lastName "Ellis" .
d:i8301 ab:email "craigellis@yahoo.com" .
d:i8301 ab:email "c.ellis@usairwaysgroup.com" .

d:i8302 ab:firstName "Craig" .
d:i8302 ab:lastName "Wright" .
d:i8302 ab:email "craig.w@outlook.com" .
15 changes: 15 additions & 0 deletions ch05/05-03/ex308.rq
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# filename: ex308.rq

# PREFIX afn: <http://jena.hpl.hp.com/ARQ/function#>
PREFIX afn: <http://jena.apache.org/ARQ/function#>
PREFIX d: <http://learningsparql.com/ns/data#>

SELECT DISTINCT ?s ?sLocalname ?sNamespace
FROM <ex012.ttl>
WHERE {
?s ?p ?o .
BIND (afn:localname(?s) AS ?sLocalname)
BIND (afn:namespace(?s) AS ?sNamespace)
}

# new prefix from https://jena.apache.org/documentation/query/library-function.html

0 comments on commit 323a2b3

Please sign in to comment.