$Revision: 1.3 500/code>Copyright © 2004 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark, and document use rules apply.
Abstract. This document lists a selection of queries that have been used in the discussions of the RDF Data Access Working Group.
Last updated 2004-09-28
This document is automatically built from the manifest files. Relevant files are:
trivial test
2 file test
selecting 1 file from 2 test
check files cant assert things against models
trivial test
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
_:alice
rdf:type foaf:Person ;
foaf:name "Alice" ;
foaf:mbox <mailto:alice@work> ;
foaf:knowns _:bob ;
.
_:bob
rdf:type foaf:Person ;
foaf:name "Bob" ;
foaf:knowns _:alice ;
foaf:mbox <mailto:bob@work> ;
foaf:mbox <mailto:bob@home> ;
.
_:eve
rdf:type foaf:Person ;
foaf:name "Eve" ;
foaf:knows _:fred ;
.
# Get name, and optionally the mbox, of each person
# (Appologies for using USING, my parser can't handle PREFIX yet)
SELECT ?name, ?source
WHERE SOURCE ?snode (?person <foaf:name> ?name),
(?snode <dc:source> ?source)
USING foaf FOR <http://xmlns.com/foaf/0.1/>,
dc FOR <http://purl.org/dc/elements/1.1/>
data/source/source-result-001.n3
| name | source |
|---|---|
| "Alice" | <file:data/source/source-data-01.n3> |
| "Bob" | <file:data/source/source-data-01.n3> |
| "Eve" | <file:data/source/source-data-01.n3> |
2 file test
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
_:alice
rdf:type foaf:Person ;
foaf:name "Alice" ;
foaf:mbox <mailto:alice@work> ;
.
data/source/source-data-01.n3
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
_:alice
rdf:type foaf:Person ;
foaf:name "Alice" ;
foaf:mbox <mailto:alice@work> ;
foaf:knowns _:bob ;
.
_:bob
rdf:type foaf:Person ;
foaf:name "Bob" ;
foaf:knowns _:alice ;
foaf:mbox <mailto:bob@work> ;
foaf:mbox <mailto:bob@home> ;
.
_:eve
rdf:type foaf:Person ;
foaf:name "Eve" ;
foaf:knows _:fred ;
.
# Get name, and optionally the mbox, of each person
# (Appologies for using USING, my parser can't handle PREFIX yet)
SELECT ?name, ?source
WHERE SOURCE ?snode (?person <foaf:name> ?name),
(?snode <dc:source> ?source)
USING foaf FOR <http://xmlns.com/foaf/0.1/>,
dc FOR <http://purl.org/dc/elements/1.1/>
data/source/source-result-002.n3
| name | source |
|---|---|
| "Alice" | <file:data/source/source-data-01.n3> |
| "Eve" | <file:data/source/source-data-01.n3> |
| "Bob" | <file:data/source/source-data-01.n3> |
| "Alice" | <file:data/source/source-data-02.n3> |
selecting 1 file from 2 test
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
_:alice
rdf:type foaf:Person ;
foaf:name "Alice" ;
foaf:mbox <mailto:alice@work> ;
.
data/source/source-data-01.n3
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
_:alice
rdf:type foaf:Person ;
foaf:name "Alice" ;
foaf:mbox <mailto:alice@work> ;
foaf:knowns _:bob ;
.
_:bob
rdf:type foaf:Person ;
foaf:name "Bob" ;
foaf:knowns _:alice ;
foaf:mbox <mailto:bob@work> ;
foaf:mbox <mailto:bob@home> ;
.
_:eve
rdf:type foaf:Person ;
foaf:name "Eve" ;
foaf:knows _:fred ;
.
# Finds person-name restioans from same source as alice's email address
SELECT DISTINCT ?name, ?mailbox
WHERE SOURCE ?snode (?person <foaf:name> ?name)
SOURCE ?snode (?person <foaf:mbox> ?mailbox)
SOURCE ?snode (?x <foaf:mbox> <mailto:bob@work>)
USING foaf FOR <http://xmlns.com/foaf/0.1/>,
dc FOR <http://purl.org/dc/elements/1.1/>
data/source/source-result-003.n3
| name | mailbox |
|---|---|
| "Bob" | <mailto:bob@home> |
| "Alice" | <mailto:alice@work> |
| "Bob" | <mailto:bob@work> |
check files cant assert things against models
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
<file:data/source/source-data-03.n3> <dc:source> <http://example.com> .
_:alice
rdf:type foaf:Person ;
foaf:name "Alice" ;
foaf:mbox <mailto:alice@work> ;
foaf:knowns _:bob ;
.
_:bob
rdf:type foaf:Person ;
foaf:name "Bob" ;
foaf:knowns _:alice ;
foaf:mbox <mailto:bob@work> ;
foaf:mbox <mailto:bob@home> ;
.
_:eve
rdf:type foaf:Person ;
foaf:name "Eve" ;
foaf:knows _:fred ;
.
# Get dc:sources of the SOURCE of this file, check users can't make assertions
# about it
SELECT DISTINCT ?source
WHERE SOURCE ?snode (?person <foaf:name> ?name),
(?snode <dc:source> ?source)
USING foaf FOR <http://xmlns.com/foaf/0.1/>,
dc FOR <http://purl.org/dc/elements/1.1/>
data/source/source-result-005.n3
| source |
|---|
| <file:data/source/source-data-01.n3> |