Précédent   Forum du club des développeurs et IT Pro > Webmasters - Développement Web > Web sémantique > SPARQL
SPARQL Forum d'entraide sur SPARQL.
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 06/01/2013, 23h03   #1
pussyycat
Invité de passage
 
Inscription : avril 2012
Messages : 39
Détails du profil
Informations forums :
Inscription : avril 2012
Messages : 39
Points : 2
Points : 2
Par défaut Valeur de retour d'une requête "select"

Bonsoir,
j'ai cette requete :
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
 
String queryString ="SELECT ?nom ?prenom WHERE {    ?Homme <http://lacot.org/public/owl/famille#prenom>  ?Paul." +
                "?Homme <http://lacot.org/public/owl/famille#nom> ?nom ." +
        "}";
 
        Query query = QueryFactory.create(queryString);
 
 
        // Execute the query and obtain results
        QueryExecution qe = QueryExecutionFactory.create(query, model);
        com.hp.hpl.jena.query.ResultSet rs =  qe.execSelect();
 
 
        for ( ; rs.hasNext() ; ){
 
            QuerySolution soln = ((com.hp.hpl.jena.query.ResultSet) rs).nextSolution() ;
 
        RDFNode c = soln.get("nom") ;
      String n=c.asNode().getLocalName();
      System.out.println(n);
 
      RDFNode b = soln.get("prenom") ;
       String p=b.asNode().getLocalName();
       System.out.println(p);
lors de l’exécution, il s'affiche une petite erreur.

Citation:
Exception in thread "main" java.lang.UnsupportedOperationException: "dupond"^^http://www.w3.org/2001/XMLSchema#String is not a URI node
at com.hp.hpl.jena.graph.Node.getLocalName(Node.java:219)
at Select.main(Select.java:115)
En googlant j'ai pas trouvé de solutions, y t-il quelqu'un qui a une idée?
Merci d'avance
pussyycat est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 19h31.


 
 
 
 
Partenaires

Hébergement Web