Requêtes SPARQL à tester avec Corese: http://wimmics.inria.fr/doc/tutorial/corese-3.2.2.jar Commencer par exécuter la requête: load Copier la requête avec CtrlC et coller la avec CtrlV _______________Introduction___________ prefix h: . select * where { ?x a h:Person ; h:name "David", ?name . ?x h:hasFriend ?y } prefix h: . select * where { ?x h:age ?age filter (?age >= 18) } prefix h: . select * where { ?x h:name ?n filter regex(?n, "o") } _____________ Clauses _______________ prefix h: . select * where { ?x h:hasFriend ?y } prefix h: . ask { ?x rdf:type h:Man } prefix h: . construct {?x rdfs:seeAlso ?z} where { ?x h:hasFriend ?y . ?y h:hasFriend ?z } describe prefix h: . describe ?x where { ?x h:name "Alice" } ___________ Statement _____________ prefix h: . select * where { {?x a h:Man, ?t} union {?x a h:Woman, ?t} } prefix h: . select * where { {?x a h:Woman} optional {?x h:hasSpouse ?n} } prefix h: . select * where { {?x a h:Woman} minus {?x h:hasFriend [ h:name "John"]} } prefix h: . select * where { ?x a h:Man filter exists {?x h:name ?n} } prefix h: . select * where { ?x a h:Person filter not exists {?x h:name ?n} } prefix h: . select * where { graph ?g {?x a h:Man} } prefix h: . select * where { ?x rdf:type/rdfs:subClassOf* h:Woman } prefix h: . select * where { ?x h:list ?y ?y rdf:rest*/rdf:first ?l } prefix h: . select * where { {select (max(?age) as ?max) where { ?x h:age ?age}} ?y h:age ?max } prefix h: . select * where { ?x h:age ?age bind (2 * ?age as ?twice) } prefix h: . select * where { ?x h:name ?v } values ?v { "John" "Alice" } select * where { service { select * where { ?x rdfs:label "Auguste"@fr ; ?p ?y} limit 10 }} ____________ Result Modifier _______________ prefix h: . select distinct ?x ?y where { ?x h:shoesize|h:shirtsize ?s ?y h:shoesize|h:shirtsize ?s filter (?x != ?y) } prefix h: . select * (datatype(?v) as ?dt) where { ?x h:age ?v } prefix h: . select (avg(?v) as ?avg where { ?x h:age ?v } prefix h: . select (group_concat(?v) as ?list) where { ?x h:name ?v } prefix h: . select * where { ?x h:age ?v } order by ?v prefix h: . select ?s (count(*) as ?nb) where { ?x h:shoesize ?s } group by ?s ________________ Update _________________ load prefix h: . load into graph h:rdfs prefix h: . prefix i: . insert data { i:Jim a h:Man ; h:age 18 . i:Jill a h:Woman ; h:age 81 . } prefix h: . prefix i: . delete data { i:Jim a h:Man ; h:age 18 . i:Jill a h:Woman ; h:age 81 . } prefix h: . delete { ?x h:age ?age } where { ?x a h:Man ; h:age ?age filter (?age > 70) } prefix h: . insert { ?x h:mail ?mail } where { ?x h:name ?n bind (concat (?n, "@acme.com") as ?mail) } prefix h: . delete {?x h:age ?age} insert {?x h:age ?new} where { ?x h:age ?age filter (?age >= 57) bind (?age / 2 as ?new) }