Sie sind auf Seite 1von 6

http://www.dajobe.org/foaf.

rdf
Query 1 : A FOAF query that finds all people with a name and an IRC nick
Data: http://www.dajobe.org/foaf.rdf
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?nick, ?name
WHERE { ?x rdf:type foaf:Person . ?x foaf:nick ?nick . ?x foaf:name ?name }

Results
ount

nick

name

emiller

Eric Miller

em

Eric Miller

jang

Jan Grant

DanC

Dan Connolly

shellac

Damian Steer

zool

Jo Walsh

mortenf

Morten Frederiksen

ndw

Norm Walsh

sbp

Sean B. Palmer

10

libby

Libby Miller

11

danbri

Dan Brickley

1. A FOAF query that finds all people with a name and an IRC nick
Data: http://www.dajobe.org/foaf.rdf
Query:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?nick, ?name
WHERE { ?x rdf:type foaf:Person . ?x foaf:nick ?nick . ?x foaf:name ?name }

ount

nick

name

emiller

Eric Miller

em

Eric Miller

jang

Jan Grant

DanC

Dan Connolly

shellac

Damian Steer

zool

Jo Walsh

mortenf

Morten Frederiksen

ndw

Norm Walsh

sbp

Sean B. Palmer

10

libby

Libby Miller

11

danbri

Dan Brickley

2. An RSS 1.0 query that finds all the items in the feed
Data: http://www.w3.org/2000/08/w3c-synd/home.rss
Query:
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX doap: <http://usefulinc.com/ns/doap#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT $description $maintainerName
WHERE {
$project rdf:type doap:Project .
$project doap:description $description .
$project doap:maintainer $m .
$m foaf:name $maintainerName
}

Results
Variable bindings result format
Count

description

maintainerName

is a free software / Open Source C library that provides a set of


parsers and serializers that generate Resource Description
Framework (RDF) triples by parsing syntaxes or serialize the
triples into a syntax. The supported parsing syntaxes are
RDF/XML, N-Triples, TRiG, Turtle, RSS tag soup including all
Dave Beckett
versions of RSS, Atom 1.0 and 0.3, GRDDL and microformats for
HTML, XHTML and XML. The serializing syntaxes are
RDF/XML (regular, and abbreviated), N-Triples, RSS 1.0, Atom
1.0, XMP, Turtle, GraphViz DOT and JSON.@en
3. Print the description of a project and maintainer(s) using DOAP
Data: http://librdf.org/raptor/raptor.rdf
Query:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>


PREFIX doap: <http://usefulinc.com/ns/doap#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT $description $maintainerName
WHERE {
$project rdf:type doap:Project .
$project doap:description $description .
$project doap:maintainer $m .
$m foaf:name $maintainerName
}

Results
Variable bindings result format
Count

description

maintainerName

is a free software / Open Source C library that provides a set of


parsers and serializers that generate Resource Description
Framework (RDF) triples by parsing syntaxes or serialize the
triples into a syntax. The supported parsing syntaxes are
RDF/XML, N-Triples, TRiG, Turtle, RSS tag soup including all
Dave Beckett
versions of RSS, Atom 1.0 and 0.3, GRDDL and microformats for
HTML, XHTML and XML. The serializing syntaxes are
RDF/XML (regular, and abbreviated), N-Triples, RSS 1.0, Atom
1.0, XMP, Turtle, GraphViz DOT and JSON.@en
4. Print the names and optional nicks of people in my FOAF file where
available
Data: http://www.dajobe.org/foaf.rdf
Query:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>


PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT ?name ?nick
WHERE {
?x rdf:type foaf:Person .
?x foaf:name ?name .
OPTIONAL { ?x foaf:nick ?nick }
}

Results
Variable bindings result format
Count

name

nick

Phil McCarthy

Eric Miller

emiller

Eric Miller

em

Jan Grant

jang

Dan Connolly

DanC

Damian Steer

shellac

Jo Walsh

zool

Morten Frederiksen

mortenf

Norm Walsh

ndw

10

Sean B. Palmer

sbp

11

Jim Hendler

12

Bijan Parsia

13

Matt Biddulph

14

Libby Miller

libby

15

Dan Brickley

danbri

16

Tim Berners-Lee

17

Edd Dumbill

18

Dave Beckett

Found 18 results
5. What are the Noble Gases?
Data: http://www.daml.org/2003/01/periodictable/PeriodicTable.owl
Query:
PREFIX table: <http://www.daml.org/2003/01/periodictable/PeriodicTable#>
PREFIX xsd:
<http://www.w3.org/2001/XMLSchema#>
SELECT ?name ?symbol ?weight ?number
WHERE {
?element table:group ?group .
?group table:name "Noble gas"^^xsd:string .
?element table:name ?name .
?element table:symbol ?symbol .
?element table:atomicWeight ?weight .
?element table:atomicNumber ?number
}
ORDER BY ASC(?name)

Results
Variable bindings result format
C
ou
nt

name

symbol

weight

number

argon^^<http://www. Ar^^<http://www.w 39.948^^<http://www. 18^^<http://www.w3


1 w3.org/2001/XMLSch 3.org/2001/XMLSch w3.org/2001/XMLSch .org/2001/XMLSche
ema#string>
ema#string>
ema#float>
ma#integer>
helium^^<http://www. He^^<http://www.w 4.002602^^<http://ww 2^^<http://www.w3.
2 w3.org/2001/XMLSch 3.org/2001/XMLSch w.w3.org/2001/XMLS org/2001/XMLSche
ema#string>
ema#string>
chema#float>
ma#integer>
krypton^^<http://www Kr^^<http://www.w 83.798^^<http://www. 36^^<http://www.w3
3 .w3.org/2001/XMLSc 3.org/2001/XMLSch w3.org/2001/XMLSch .org/2001/XMLSche
hema#string>
ema#string>
ema#float>
ma#integer>
neon^^<http://www.w Ne^^<http://www.w 20.1797^^<http://ww 10^^<http://www.w3
4 3.org/2001/XMLSche 3.org/2001/XMLSch w.w3.org/2001/XMLS .org/2001/XMLSche
ma#string>
ema#string>
chema#float>
ma#integer>
5 radon^^<http://www. Rn^^<http://www.w 222^^<http://www.w3. 86^^<http://www.w3
w3.org/2001/XMLSch 3.org/2001/XMLSch org/2001/XMLSchem .org/2001/XMLSche

ema#string>

ema#string>

a#float>

ma#integer>

xenon^^<http://www. Xe^^<http://www.w 131.293^^<http://ww 54^^<http://www.w3


6 w3.org/2001/XMLSch 3.org/2001/XMLSch w.w3.org/2001/XMLS .org/2001/XMLSche
ema#string>
ema#string>
chema#float>
ma#integer>
Found 6 results
6. What are the last 10 updated items in an atom feed?
Data: http://www.tbray.org/ongoing/ongoing.atom
Query:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>


PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rss: <http://purl.org/rss/1.0/>
PREFIX atom: <http://www.w3.org/2005/Atom>
SELECT ?item ?title ?date
WHERE { ?item rdf:type rss:item .
?item rss:title ?title .
?item atom:updated ?date }
ORDER BY DESC(?date)
LIMIT 10

Results

Variable bindings result format


Cou
nt

item

title

date

The
Fixing2016-08https://www.tbray.org/ongoing/When/201x/2016/08/2
JSON
26T08:27:
2/Fixing-JSON-Redux
Conversat 04-07:00
ion

https://www.tbray.org/ongoing/When/201x/2016/08/2 Fixing
0/Fixing-JSON
JSON

Things
2016-08https://www.tbray.org/ongoing/When/201x/2016/08/1
About No 14T21:26:
3/Ten-Zen-No-Mans-Sky-Things
Mans Sky 42-07:00

Light
2016-08https://www.tbray.org/ongoing/When/201x/2016/08/1
Transmiss 13T12:51:
3/Light-Transmission
ion
53-07:00

Home
2016-07https://www.tbray.org/ongoing/When/201x/2016/07/2
Computer 21T22:36:
1/Home-Computer
?
30-07:00

2016-0820T11:04:
38-07:00

Susan
https://www.tbray.org/ongoing/When/201x/2016/07/1 and her
4/Melissa-and-SQL
SQL
Problem

2016-07https://www.tbray.org/ongoing/When/201x/2016/07/1 Corporate
13T23:38:
3/Easy-Pride
Pride
31-07:00

2016-07https://www.tbray.org/ongoing/When/201x/2016/07/1 Vegetable
10T21:48:
0/Farmers-Market
s!
11-07:00

2016-07https://www.tbray.org/ongoing/When/201x/2016/07/0 The REST


10T16:20:
9/RESTfulness
Report
19-07:00

10

2016-06https://www.tbray.org/ongoing/When/201x/2016/06/2 Video and


26T21:18:
6/Video-going-slow
Speed
49-07:00

2016-0716T11:34:
05-07:00

Found 10 results
7. Find the most recent 10 news items about Redland from multiple RSS 1.0 feeds
Data: http://librdf.org/NEWS.rdf http://librdf.org/raptor/NEWS.rdf
http://librdf.org/rasqal/NEWS.rdf http://librdf.org/bindings/NEWS.rdf
Query:
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX rss: <http://purl.org/rss/1.0/>
SELECT ?item ?title ?date
WHERE {
?item a rss:item ;
rss:title ?title ;
dc:date ?date
}
ORDER BY DESC(?date)
LIMIT 10

Das könnte Ihnen auch gefallen