« SPARQL Protocol and RDF Query Language/Le protocole SPARQL » : différence entre les versions

Contenu supprimé Contenu ajouté
m Robot : Remplacement de texte automatisé (-\n(==={0,3})(?: *)([^\n=]+)(?: *)\1(?: *)\n +\n\1 \2 \1\n)
m Robot : Remplacement de texte automatisé (-(<|</)source([ \t>]) +\1syntaxhighlight\2)
Ligne 179 :
 
{{Exemple|titre=Exemple d'entête HTTP GET pour une requête SPARQL|contenu=
<sourcesyntaxhighlight lang="text">
GET /sparql/?query='''Requête_Encodée''' HTTP/1.1
Host: www.example.org
User-agent: my-sparql-client/0.1
</syntaxhighlight>
</source>
}}
 
{{Exemple|titre=Exemple d'entête HTTP POST pour une requête SPARQL|contenu=
<sourcesyntaxhighlight lang="text">
POST /sparql/ HTTP/1.1
Host: www.example.org
Ligne 195 :
 
query=Très_Longue_Requête_Encodée
</syntaxhighlight>
</source>
}}
 
Ligne 217 :
{{Exemple|titre=Exemple de session avec une requête SELECT|contenu=
Voici un exemple de requête SELECT :
<sourcesyntaxhighlight lang="text">
select * where { ?x ?y ?z .} limit 5
</syntaxhighlight>
</source>
 
Cette requête aura comme entête HTTP :
<sourcesyntaxhighlight lang="text">
GET /sparql/?query=select%20*%20where%20%20{%20?x%20?y%20?z%20.}%20limit%205 HTTP/1.1
Host: www.example.org
Accept: application/sparql-results+xml
</syntaxhighlight>
</source>
 
 
La réponse aura comme entête :
<sourcesyntaxhighlight lang="text">
HTTP/1.1 200 OK
Date: Fri, 26 Aug 2011 19:17:17 GMT
Ligne 236 :
Connection: close
Content-Type: application/xml
</syntaxhighlight>
</source>
 
Et la réponse contiendra le document [http://www.w3.org/TR/rdf-sparql-XMLres/ SPARQL result XML] :
<sourcesyntaxhighlight lang="text">
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
Ligne 262 :
</results>
</sparql>
</syntaxhighlight>
</source>
}}
 
{{Exemple|titre=Exemple de session avec une requête ASK|contenu=
Voici un exemple de requête '''ASK''' :
<sourcesyntaxhighlight lang="text">
PREFIX ex: <http://www.example.org/>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
ASK WHERE { ex:ID1 foaf:primaryTopic ex:ID2}
</syntaxhighlight>
</source>
 
Cette requête aura comme entête HTTP :
<sourcesyntaxhighlight lang="text">
GET /sparql/?query=PREFIX%20ex:%20%3Chttp://www.example.org/%3E%20PREFIX%20foaf:%20%3Chttp://xmlns.com/foaf/0.1/%3E%20ASK%20WHERE%20{%20ex:ID1%20foaf:primaryTopic%20ex:ID2} HTTP/1.1
Host: www.example.org
User-agent: Firefox/6.0
</syntaxhighlight>
</source>
 
La réponse aura comme entête :
<sourcesyntaxhighlight lang="text">
HTTP/1.1 200 OK
Date: Fri, 26 Aug 2011 19:17:17 GMT
Ligne 287 :
Connection: close
Content-Type: application/xml
</syntaxhighlight>
</source>
 
Et la réponse contiendra le document [http://www.w3.org/TR/rdf-sparql-XMLres/ SPARQL result XML] :
<sourcesyntaxhighlight lang="text">
<?xml version="1.0"?>
<sparql xmlns="http://www.w3.org/2005/sparql-results#">
Ligne 296 :
<boolean>true</boolean>
</sparql>
</syntaxhighlight>
</source>
}}
 
Ligne 302 :
{{Exemple|titre=Exemple de session avec une requête SELECT et en sortie du JSON|contenu=
Voici un exemple de requête SELECT :
<sourcesyntaxhighlight lang="text">
select * where { ?x ?y ?z .} limit 5
</syntaxhighlight>
</source>
 
Cette requête aura comme entête HTTP :
<sourcesyntaxhighlight lang="text">
GET /sparql/?query=select%20*%20where%20%20{%20?x%20?y%20?z%20.}%20limit%205 HTTP/1.1
Host: www.example.org
User-agent: Firefox/6.0
Accept: application/json
</syntaxhighlight>
</source>
 
ou bien pour Jena Fuseki :
<sourcesyntaxhighlight lang="text">
GET /sparql/?query=select%20*%20where%20%20{%20?x%20?y%20?z%20.}%20limit%205&output=json HTTP/1.1
Host: www.example.org
User-agent: Firefox/6.0
</syntaxhighlight>
</source>
 
La réponse aura comme entête :
<sourcesyntaxhighlight lang="text">
HTTP/1.1 200 OK
Date: Fri, 26 Aug 2011 19:17:17 GMT
Ligne 328 :
Connection: close
Content-Type: application/json
</syntaxhighlight>
</source>
 
Et la réponse contiendra le document [http://www.w3.org/TR/rdf-sparql-json-res/ JSON] :
<sourcesyntaxhighlight lang="text">
<?xml version="1.0"?>
{
Ligne 347 :
}
}
</syntaxhighlight>
</source>
}}
 
Ligne 359 :
{{Exemple|titre=Exemple de session avec une requête DESCRIBE|contenu=
Voici un exemple de requête '''DESCRIBE''' :
<sourcesyntaxhighlight lang="text">
PREFIX ex: <http://www.example.org/>
DESCRIBE ex:ID1
</syntaxhighlight>
</source>
 
Cette requête aura comme entête HTTP :
<sourcesyntaxhighlight lang="text">
GET /sparql?query=PREFIX%20ex:%20%3Chttp://www.example.org/%3E%20DESCRIBE%20ex:ID1 HTTP/1.1
Host: www.example.org
User-agent: Firefox/6.0
</syntaxhighlight>
</source>
 
La réponse aura comme entête :
<sourcesyntaxhighlight lang="text">
HTTP/1.1 200 OK
Date: Fri, 26 Aug 2011 19:17:17 GMT
Ligne 378 :
Connection: close
Content-Type: application/xml
</syntaxhighlight>
</source>
 
Et la réponse contiendra le document RDF XML:
<sourcesyntaxhighlight lang="text">
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
Ligne 394 :
</rdf:Description>
</rdf:RDF>
</syntaxhighlight>
</source>
}}
 
Ligne 400 :
{{Exemple|titre=Exemple de session avec une requête CONSTRUCT avec en sortie du Turtle|contenu=
Voici un exemple de requête '''CONSTRUCT''' :
<sourcesyntaxhighlight lang="text">
PREFIX skos: <http://www.w3.org/2008/05/skos#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
CONSTRUCT { ?x skos:Concept ?z. ?x ?p ?v . }
WHERE { ?x foaf:primaryTopic ?z. ?x ?p ?v . } LIMIT 5
</syntaxhighlight>
</source>
 
Cette requête aura comme entête HTTP :
<sourcesyntaxhighlight lang="text">
GET /sparql?query=PREFIX%20skos:%20%3Chttp://www.w3.org/2008/05/skos%23%3E%20PREFIX%20foaf:%20%3Chttp://xmlns.com/foaf/0.1/%3E%20CONSTRUCT%20{...}%20WHERE%20{...}%20LIMIT%205&output=turtle HTTP/1.1
Host: www.example.org
Accept: text/rdf+n3
</syntaxhighlight>
</source>
 
La réponse aura comme entête :
<sourcesyntaxhighlight lang="text">
HTTP/1.1 200 OK
Date: Fri, 26 Aug 2011 19:17:17 GMT
Ligne 421 :
Connection: close
Content-Type: text/turtle
</syntaxhighlight>
</source>
 
Et la réponse contiendra le document turtle :
<sourcesyntaxhighlight lang="text">
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix foaf: <http://xmlns.com/foaf/0.1/>.
Ligne 439 :
purl:modified "2008-11-03T21:12:31Z"^^xsd:dateTime.
...
</syntaxhighlight>
</source>
}}
 
Ligne 466 :
 
{{Exemple|titre=Exemple d'entête HTTP POST pour une requête Update|contenu=
<sourcesyntaxhighlight lang="text">
POST /update/ HTTP/1.1
Host: www.example.org
Ligne 474 :
 
update=Requête_Update
</syntaxhighlight>
</source>
}}